ChangeSet 1.1446.1.1, 2005/05/18 14:48:23+01:00, cl349@xxxxxxxxxxxxxxxxxxxx
XendDomain.py:
Move code to create dominfo entries for unknown domains into
domain_lookup.
Signed-off-by: Christian Limpach <Christian.Limpach@xxxxxxxxxxxx>
XendDomain.py | 17 ++++++++++-------
1 files changed, 10 insertions(+), 7 deletions(-)
diff -Nru a/tools/python/xen/xend/XendDomain.py
b/tools/python/xen/xend/XendDomain.py
--- a/tools/python/xen/xend/XendDomain.py 2005-05-18 10:08:35 -04:00
+++ b/tools/python/xen/xend/XendDomain.py 2005-05-18 10:08:35 -04:00
@@ -313,13 +313,7 @@
# Add entries for any domains we don't know about.
for (id, d) in doms.items():
if id not in self.domain_by_id:
- log.info("Creating entry for unknown domain: id=%s", id)
- savedinfo = None
- try:
- dominfo = XendDomainInfo.vm_recreate(savedinfo, d)
- self._add_domain(dominfo)
- except Exception, ex:
- log.exception("Error creating domain info: id=%s", id)
+ self.domain_lookup(id)
# Remove entries for domains that no longer exist.
# Update entries for existing domains.
for d in self.domain_by_id.values():
@@ -449,6 +443,15 @@
dominfo = self.domain_by_name.get(name) or self.domain_by_id.get(name)
if dominfo:
return dominfo
+ try:
+ log.info("Creating entry for unknown domain: id=%s", name)
+ d = self.xen_domain(name)
+ if d:
+ dominfo = XendDomainInfo.vm_recreate(None, d)
+ self._add_domain(dominfo)
+ return dominfo
+ except Exception, ex:
+ log.exception("Error creating domain info: id=%s", name)
raise XendError('invalid domain: ' + name)
def domain_exists(self, name):
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|