Add qvm-start --skip-if-running option

QubesOS/qubes-issues#1528
This commit is contained in:
Marek Marczykowski-Górecki 2015-12-26 11:31:56 +01:00
parent 1b5daea771
commit b8e40895b3
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -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)