From fc283e22c8f6696b6c3b8cf2f6212fefcc2a37b9 Mon Sep 17 00:00:00 2001 From: Marek Marczykowski Date: Thu, 8 Mar 2012 12:03:49 +0100 Subject: [PATCH] dom0/core: use QubesVm.pause/unpause instead of xl directly --- dom0/qvm-core/qubes.py | 12 ++++++++++++ dom0/qvm-tools/qvm-run | 4 ++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/dom0/qvm-core/qubes.py b/dom0/qvm-core/qubes.py index f5cff8bc..e729c190 100755 --- a/dom0/qvm-core/qubes.py +++ b/dom0/qvm-core/qubes.py @@ -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 diff --git a/dom0/qvm-tools/qvm-run b/dom0/qvm-tools/qvm-run index 73f929d0..db5ad720 100755 --- a/dom0/qvm-tools/qvm-run +++ b/dom0/qvm-tools/qvm-run @@ -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: