From abcd6416fc72708a300e6cf30f954e2ee0d3171d Mon Sep 17 00:00:00 2001 From: Marek Marczykowski Date: Fri, 14 Oct 2011 11:59:33 +0200 Subject: [PATCH] dom0: move shutdown to qvm-core --- dom0/qvm-core/qubes.py | 7 +++++++ dom0/qvm-tools/qvm-run | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/dom0/qvm-core/qubes.py b/dom0/qvm-core/qubes.py index 6b63f9aa..b50546a6 100755 --- a/dom0/qvm-core/qubes.py +++ b/dom0/qvm-core/qubes.py @@ -1082,6 +1082,13 @@ class QubesVm(object): return xid + def shutdown(self): + if dry_run: + return + + subprocess.call (['/usr/sbin/xl', 'shutdown', self.name]) + #xc.domain_destroy(self.get_xid()) + def force_shutdown(self): if dry_run: return diff --git a/dom0/qvm-tools/qvm-run b/dom0/qvm-tools/qvm-run index 2777b9ee..7c69bc95 100755 --- a/dom0/qvm-tools/qvm-run +++ b/dom0/qvm-tools/qvm-run @@ -80,7 +80,7 @@ def vm_run_cmd(vm, cmd, options): if options.shutdown: if options.verbose: print >> sys.stderr, "Shutting down VM: '{0}'...".format(vm.name) - subprocess.call (["/usr/sbin/xl", "shutdown", vm.name]) + vm.shutdown() return if options.pause: