mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 10:40:03 +01:00
bitkeeper revision 1.1615 (429c80cbvtnzneyg7GyZAmZlQNm-Yg)
XendDomainInfo.py: g/c vm_restore: no longer used. Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
This commit is contained in:
1 parent
6a89fed7f6
commit
59f83bdc8f
1 file changed
-22
@@ -192,28 +192,6 @@ def vm_recreate(savedinfo, info):
|
||||
vm.savedinfo = None
|
||||
return vm
|
||||
|
||||
def vm_restore(src, progress=False):
|
||||
"""Restore a VM from a disk image.
|
||||
|
||||
src saved state to restore
|
||||
progress progress reporting flag
|
||||
raises VmError for invalid configuration
|
||||
"""
|
||||
vm = XendDomainInfo()
|
||||
ostype = "linux" #todo Set from somewhere (store in the src?).
|
||||
restorefn = getattr(xc, "%s_restore" % ostype)
|
||||
d = restorefn(state_file=src, progress=progress)
|
||||
dom = int(d['dom'])
|
||||
if dom < 0:
|
||||
raise VmError('restore failed')
|
||||
try:
|
||||
vmconfig = sxp.from_string(d['vmconfig'])
|
||||
config = sxp.child_value(vmconfig, 'config')
|
||||
except Exception, ex:
|
||||
raise VmError('config error: ' + str(ex))
|
||||
vm.dom_construct(dom, config)
|
||||
return vm
|
||||
|
||||
def dom_get(dom):
|
||||
"""Get info from xen for an existing domain.
|
||||
|
||||
|
||||