aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoriap10@freefall.cl.cam.ac.uk <iap10@freefall.cl.cam.ac.uk>2005-08-17 12:30:04 +0000
committeriap10@freefall.cl.cam.ac.uk <iap10@freefall.cl.cam.ac.uk>2005-08-17 12:30:04 +0000
commit4a58a25381626269f089ae80501266fccdbaf960 (patch)
tree7fbea2adf9a11009571d74d61e69864cc344fe40
parent34ef2473015da351dceae5403dbbf128b255418b (diff)
parent9dc02cdad077cdc3732a3de7a698484157b32648 (diff)
downloadxen-4a58a25381626269f089ae80501266fccdbaf960.tar.gz
xen-4a58a25381626269f089ae80501266fccdbaf960.tar.bz2
xen-4a58a25381626269f089ae80501266fccdbaf960.zip
merge
-rw-r--r--tools/python/xen/xend/XendDomain.py3
-rw-r--r--tools/python/xen/xend/XendDomainInfo.py4
2 files changed, 4 insertions, 3 deletions
diff --git a/tools/python/xen/xend/XendDomain.py b/tools/python/xen/xend/XendDomain.py
index 2315aaea20..3959b2e917 100644
--- a/tools/python/xen/xend/XendDomain.py
+++ b/tools/python/xen/xend/XendDomain.py
@@ -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):
diff --git a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py
index 570bb6dbda..4bacd19deb 100644
--- a/tools/python/xen/xend/XendDomainInfo.py
+++ b/tools/python/xen/xend/XendDomainInfo.py
@@ -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'))