dom0/core: use QubesVm.pause/unpause instead of xl directly
This commit is contained in:
parent
fc573d0467
commit
07f560042c
@ -1420,6 +1420,18 @@ class QubesVm(object):
|
|||||||
subprocess.call (['/usr/sbin/xl', 'destroy', self.name])
|
subprocess.call (['/usr/sbin/xl', 'destroy', self.name])
|
||||||
#xc.domain_destroy(self.get_xid())
|
#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):
|
def remove_from_disk(self):
|
||||||
if dry_run:
|
if dry_run:
|
||||||
return
|
return
|
||||||
|
@ -63,13 +63,13 @@ def vm_run_cmd(vm, cmd, options):
|
|||||||
if options.pause:
|
if options.pause:
|
||||||
if options.verbose:
|
if options.verbose:
|
||||||
print >> sys.stderr, "Pausing VM: '{0}'...".format(vm.name)
|
print >> sys.stderr, "Pausing VM: '{0}'...".format(vm.name)
|
||||||
subprocess.call (["/usr/sbin/xl", "pause", vm.name])
|
vm.pause()
|
||||||
return
|
return
|
||||||
|
|
||||||
if options.unpause:
|
if options.unpause:
|
||||||
if options.verbose:
|
if options.verbose:
|
||||||
print >> sys.stderr, "UnPausing VM: '{0}'...".format(vm.name)
|
print >> sys.stderr, "UnPausing VM: '{0}'...".format(vm.name)
|
||||||
subprocess.call (["/usr/sbin/xl", "unpause", vm.name])
|
vm.unpause()
|
||||||
return
|
return
|
||||||
|
|
||||||
if options.verbose:
|
if options.verbose:
|
||||||
|
Loading…
Reference in New Issue
Block a user