direct-io.hg

changeset 4979:f9b5fb17e2e5

bitkeeper revision 1.1446.1.1 (428b47a7E-qEps_VFpIpa2dT5I_afw)

XendDomain.py:
Move code to create dominfo entries for unknown domains into
domain_lookup.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
author cl349@firebug.cl.cam.ac.uk
date Wed May 18 13:48:23 2005 +0000 (2005-05-18)
parents b7ff11fc3c57
children 1034f1c883a8
files tools/python/xen/xend/XendDomain.py
line diff
     1.1 --- a/tools/python/xen/xend/XendDomain.py	Wed May 18 13:28:39 2005 +0000
     1.2 +++ b/tools/python/xen/xend/XendDomain.py	Wed May 18 13:48:23 2005 +0000
     1.3 @@ -313,13 +313,7 @@ class XendDomain:
     1.4          # Add entries for any domains we don't know about.
     1.5          for (id, d) in doms.items():
     1.6              if id not in self.domain_by_id:
     1.7 -                log.info("Creating entry for unknown domain: id=%s", id)
     1.8 -                savedinfo = None
     1.9 -                try:
    1.10 -                    dominfo = XendDomainInfo.vm_recreate(savedinfo, d)
    1.11 -                    self._add_domain(dominfo)
    1.12 -                except Exception, ex:
    1.13 -                    log.exception("Error creating domain info: id=%s", id)
    1.14 +                self.domain_lookup(id)
    1.15          # Remove entries for domains that no longer exist.
    1.16          # Update entries for existing domains.
    1.17          for d in self.domain_by_id.values():
    1.18 @@ -449,6 +443,15 @@ class XendDomain:
    1.19          dominfo = self.domain_by_name.get(name) or self.domain_by_id.get(name)
    1.20          if dominfo:
    1.21              return dominfo
    1.22 +        try:
    1.23 +            log.info("Creating entry for unknown domain: id=%s", name)
    1.24 +            d = self.xen_domain(name)
    1.25 +            if d:
    1.26 +                dominfo = XendDomainInfo.vm_recreate(None, d)
    1.27 +                self._add_domain(dominfo)
    1.28 +                return dominfo
    1.29 +        except Exception, ex:
    1.30 +            log.exception("Error creating domain info: id=%s", name)
    1.31          raise XendError('invalid domain: ' + name)
    1.32  
    1.33      def domain_exists(self, name):