ia64/xen-unstable

changeset 2166:0b8b66772eb7

bitkeeper revision 1.1159.1.34 (4118d9b1ZXvgrP7sHLCZ6HCI8E4V0g)

Fix some restore problems.
author mjw@wray-m-3.hpl.hp.com
date Tue Aug 10 14:20:33 2004 +0000 (2004-08-10)
parents 01bf507e2306
children c6a98003938a 2de6aedb2442
files tools/python/xen/xend/XendDomainInfo.py
line diff
     1.1 --- a/tools/python/xen/xend/XendDomainInfo.py	Tue Aug 10 14:01:18 2004 +0000
     1.2 +++ b/tools/python/xen/xend/XendDomainInfo.py	Tue Aug 10 14:20:33 2004 +0000
     1.3 @@ -309,6 +309,7 @@ def vm_restore(src, progress=0):
     1.4      deferred = vm.dom_construct(dom, config)
     1.5      def vifs_cb(val, vm):
     1.6          vif_up(vm.ipaddrs)
     1.7 +        return vm
     1.8      deferred.addCallback(vifs_cb, vm)
     1.9      return deferred
    1.10      
    1.11 @@ -318,7 +319,7 @@ def dom_get(dom):
    1.12      @param dom: domain id
    1.13      @return: info or None
    1.14      """
    1.15 -    domlist = xc.domain_getinfo(dom=dom)
    1.16 +    domlist = xc.domain_getinfo(dom, 1)
    1.17      if domlist and dom == domlist[0]['dom']:
    1.18          return domlist[0]
    1.19      return None
    1.20 @@ -633,7 +634,7 @@ class XendDomainInfo:
    1.21          try:
    1.22              return xc.domain_destroy(dom=self.dom)
    1.23          except Exception, err:
    1.24 -            log.exception("Domain destroy failed: ", self.name)
    1.25 +            log.exception("Domain destroy failed: %s", self.name)
    1.26  
    1.27      def cleanup(self):
    1.28          """Cleanup vm resources: release devices.
    1.29 @@ -937,21 +938,15 @@ class XendDomainInfo:
    1.30          d = dom_get(dom)
    1.31          if not d:
    1.32              raise VmError("Domain not found: %d" % dom)
    1.33 +        print 'dom_construct>', dom, config
    1.34          try:
    1.35 -            self.config = config
    1.36              self.restore = 1
    1.37              self.setdom(dom)
    1.38              self.name = d['name']
    1.39 -            self.memory = d['memory']/1024
    1.40 -            deferred = self.construct()
    1.41 -            def cberr(err):
    1.42 -                self.destroy()
    1.43 -                return err
    1.44 -            deferred.addErrback(cberr)
    1.45 +            self.memory = d['mem_kb']/1024
    1.46 +            deferred = self.construct(config)
    1.47 +        finally:
    1.48              self.restore = 0
    1.49 -        except StandardError, ex:
    1.50 -            self.destroy()
    1.51 -            raise
    1.52          return deferred
    1.53  
    1.54      def configure_fields(self):