mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 10:40:03 +01:00
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>
This commit is contained in:
1 parent
f9c5a6235f
commit
fb008da966
2 files changed
+4
-3
No files matched your search
@@ -320,8 +320,7 @@ class XendDomain:
|
||||
@param vmconfig: vm configuration
|
||||
"""
|
||||
config = sxp.child_value(vmconfig, 'config')
|
||||
uuid = sxp.child_value(vmconfig, 'uuid')
|
||||
dominfo = XendDomainInfo.restore(self.dbmap, config, uuid=uuid)
|
||||
dominfo = XendDomainInfo.restore(self.dbmap, config)
|
||||
return dominfo
|
||||
|
||||
def domain_restore(self, src, progress=False):
|
||||
|
||||
@@ -195,13 +195,15 @@ class XendDomainInfo:
|
||||
|
||||
recreate = classmethod(recreate)
|
||||
|
||||
def restore(cls, parentdb, config, uuid):
|
||||
def restore(cls, parentdb, config, uuid=None):
|
||||
"""Create a domain and a VM object to do a restore.
|
||||
|
||||
@param parentdb: parent db
|
||||
@param config: domain configuration
|
||||
@param uuid: uuid to use
|
||||
"""
|
||||
if not uuid:
|
||||
uuid = getUuid()
|
||||
db = parentdb.addChild(uuid)
|
||||
vm = cls(db)
|
||||
ssidref = int(sxp.child_value(config, 'ssidref'))
|
||||
|
||||