ia64/xen-unstable

changeset 6811:f562c0f1d222

Fix domain list build/cleanup code with xend subdirectory.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
author cl349@firebug.cl.cam.ac.uk
date Tue Sep 13 16:57:45 2005 +0000 (2005-09-13)
parents d38da169752e
children 26cf3cfd3bed
files tools/python/xen/xend/XendDomain.py
line diff
     1.1 --- a/tools/python/xen/xend/XendDomain.py	Tue Sep 13 16:56:02 2005 +0000
     1.2 +++ b/tools/python/xen/xend/XendDomain.py	Tue Sep 13 16:57:45 2005 +0000
     1.3 @@ -130,8 +130,11 @@ class XendDomain:
     1.4          doms = self.xen_domains()
     1.5          self.dbmap.readDB()
     1.6          for domdb in self.dbmap.values():
     1.7 +            if not domdb.has_key("xend"):
     1.8 +                continue
     1.9 +            db = domdb.addChild("xend")
    1.10              try:
    1.11 -                domid = int(domdb.id)
    1.12 +                domid = int(db.id)
    1.13              except:
    1.14                  domid = None
    1.15              # XXX if domid in self.domains, then something went wrong
    1.16 @@ -139,7 +142,7 @@ class XendDomain:
    1.17                  domdb.delete()
    1.18              elif domid in doms:
    1.19                  try:
    1.20 -                    self._new_domain(domdb['uuid'], domdb, doms[domid]) 
    1.21 +                    self._new_domain(db.uuid, db, doms[domid]) 
    1.22                  except Exception, ex:
    1.23                      log.exception("Error recreating domain info: id=%d", domid)
    1.24                      self._delete_domain(domid)
    1.25 @@ -204,8 +207,11 @@ class XendDomain:
    1.26                  eserver.inject('xend.domain.died', [info.name, info.id])
    1.27          # XXX this should not be needed
    1.28          for domdb in self.dbmap.values():
    1.29 +            if not domdb.has_key("xend"):
    1.30 +                continue
    1.31 +            db = domdb.addChild("xend")
    1.32              try:
    1.33 -                domid = int(domdb.id)
    1.34 +                domid = int(db.id)
    1.35              except:
    1.36                  domid = None
    1.37              if (domid is None) or (domid == id):