From b8e40895b39d6f0f6193796520313d6559e86627 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Sat, 26 Dec 2015 11:31:56 +0100 Subject: [PATCH] Add qvm-start --skip-if-running option QubesOS/qubes-issues#1528 --- qvm-tools/qvm-start | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/qvm-tools/qvm-start b/qvm-tools/qvm-start index 42deeb54..002c272e 100755 --- a/qvm-tools/qvm-start +++ b/qvm-tools/qvm-start @@ -57,6 +57,9 @@ def main(): help="Do actions necessary when preparing DVM image") parser.add_option ("--custom-config", action="store", dest="custom_config", default=None, help="Use custom Xen config instead of Qubes-generated one") + parser.add_option("--skip-if-running", action="store_true", + dest="skip_if_running", default=False, + help="Do not fail if the VM is already running") parser.add_option ("--debug", action="store_true", dest="debug", default=False, help="Enable debug mode for this VM (until its shutdown)") @@ -104,6 +107,9 @@ def main(): if options.debug: vm.debug = True + if options.skip_if_running and vm.is_running(): + return + try: vm.verify_files() xid = vm.start(verbose=options.verbose, preparing_dvm=options.preparing_dvm, start_guid=not options.noguid, notify_function=tray_notify_generic if options.tray else None)