ia64/xen-unstable

changeset 6226:80291913492d

Restore domains with a different uuid than they had.
Needed for migration to localhost and migration between hosts with
a shared/distributed xenstore.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
author cl349@firebug.cl.cam.ac.uk
date Wed Aug 17 12:25:50 2005 +0000 (2005-08-17)
parents 8203b7d536d3
children 6b6588e66b96
files tools/python/xen/xend/XendDomain.py tools/python/xen/xend/XendDomainInfo.py
line diff
     1.1 --- a/tools/python/xen/xend/XendDomain.py	Wed Aug 17 10:18:34 2005 +0000
     1.2 +++ b/tools/python/xen/xend/XendDomain.py	Wed Aug 17 12:25:50 2005 +0000
     1.3 @@ -320,8 +320,7 @@ class XendDomain:
     1.4          @param vmconfig: vm configuration
     1.5          """
     1.6          config = sxp.child_value(vmconfig, 'config')
     1.7 -        uuid = sxp.child_value(vmconfig, 'uuid')
     1.8 -        dominfo = XendDomainInfo.restore(self.dbmap, config, uuid=uuid)
     1.9 +        dominfo = XendDomainInfo.restore(self.dbmap, config)
    1.10          return dominfo
    1.11  
    1.12      def domain_restore(self, src, progress=False):
     2.1 --- a/tools/python/xen/xend/XendDomainInfo.py	Wed Aug 17 10:18:34 2005 +0000
     2.2 +++ b/tools/python/xen/xend/XendDomainInfo.py	Wed Aug 17 12:25:50 2005 +0000
     2.3 @@ -195,13 +195,15 @@ class XendDomainInfo:
     2.4  
     2.5      recreate = classmethod(recreate)
     2.6  
     2.7 -    def restore(cls, parentdb, config, uuid):
     2.8 +    def restore(cls, parentdb, config, uuid=None):
     2.9          """Create a domain and a VM object to do a restore.
    2.10  
    2.11          @param parentdb:  parent db
    2.12          @param config:    domain configuration
    2.13          @param uuid:      uuid to use
    2.14          """
    2.15 +        if not uuid:
    2.16 +            uuid = getUuid()
    2.17          db = parentdb.addChild(uuid)
    2.18          vm = cls(db)
    2.19          ssidref = int(sxp.child_value(config, 'ssidref'))