core: add offline mode to qvm-pci
Called on LiveUSB system before libvirtd starts.
This commit is contained in:
parent
c4a28a943a
commit
a425873e73
@ -26,6 +26,8 @@ from optparse import OptionParser
|
|||||||
import subprocess
|
import subprocess
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
from qubes.qubes import vmm
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
usage = "usage: %prog -l [options] <vm-name>\n"\
|
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 ("-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 ("-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 ("-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 ()
|
(options, args) = parser.parse_args ()
|
||||||
if (len (args) < 1):
|
if (len (args) < 1):
|
||||||
@ -48,6 +53,9 @@ def main():
|
|||||||
print >> sys.stderr, "Only one of -l -a -d is allowed!"
|
print >> sys.stderr, "Only one of -l -a -d is allowed!"
|
||||||
exit (1)
|
exit (1)
|
||||||
|
|
||||||
|
if options.offline_mode:
|
||||||
|
vmm.offline_mode = True
|
||||||
|
|
||||||
if options.do_add or options.do_delete:
|
if options.do_add or options.do_delete:
|
||||||
qvm_collection = QubesVmCollection()
|
qvm_collection = QubesVmCollection()
|
||||||
qvm_collection.lock_db_for_writing()
|
qvm_collection.lock_db_for_writing()
|
||||||
|
Loading…
Reference in New Issue
Block a user