dom0/core: use QubesVm.pause/unpause instead of xl directly

This commit is contained in:
Marek Marczykowski 2012-03-08 12:03:49 +01:00
parent 63e19e1afa
commit fc283e22c8
2 changed files with 14 additions and 2 deletions

View File

@ -1406,6 +1406,18 @@ class QubesVm(object):
subprocess.call (['/usr/sbin/xl', 'destroy', self.name])
#xc.domain_destroy(self.get_xid())
def pause(self):
if dry_run:
return
xc.domain_pause(self.get_xid())
def unpause(self):
if dry_run:
return
xc.domain_unpause(self.get_xid())
def remove_from_disk(self):
if dry_run:
return

View File

@ -63,13 +63,13 @@ def vm_run_cmd(vm, cmd, options):
if options.pause:
if options.verbose:
print >> sys.stderr, "Pausing VM: '{0}'...".format(vm.name)
subprocess.call (["/usr/sbin/xl", "pause", vm.name])
vm.pause()
return
if options.unpause:
if options.verbose:
print >> sys.stderr, "UnPausing VM: '{0}'...".format(vm.name)
subprocess.call (["/usr/sbin/xl", "unpause", vm.name])
vm.unpause()
return
if options.verbose: