core: add offline mode to qvm-pci

Called on LiveUSB system before libvirtd starts.
This commit is contained in:
Marek Marczykowski-Górecki 2015-07-31 02:39:17 +02:00
parent c4a28a943a
commit a425873e73
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -26,6 +26,8 @@ from optparse import OptionParser
import subprocess
import os
import sys
from qubes.qubes import vmm
def main():
usage = "usage: %prog -l [options] <vm-name>\n"\
@ -37,6 +39,9 @@ def main():
parser.add_option ("-l", "--list", action="store_true", dest="do_list", default=False)
parser.add_option ("-a", "--add", action="store_true", dest="do_add", default=False)
parser.add_option ("-d", "--delete", action="store_true", dest="do_delete", default=False)
parser.add_option ("--offline-mode", dest="offline_mode",
action="store_true", default=False,
help="Offline mode")
(options, args) = parser.parse_args ()
if (len (args) < 1):
@ -48,6 +53,9 @@ def main():
print >> sys.stderr, "Only one of -l -a -d is allowed!"
exit (1)
if options.offline_mode:
vmm.offline_mode = True
if options.do_add or options.do_delete:
qvm_collection = QubesVmCollection()
qvm_collection.lock_db_for_writing()