qubes/tools: add hidden --offline-mode options

It is useful on some cases to prevent talking to hypervisor.

Warning - it may have sense only when action do not access any runtime
VM status. For example running the domain will fail, but changing its
properties should work.
This commit is contained in:
Marek Marczykowski-Górecki 2016-08-09 04:28:18 +02:00
parent 96d032919a
commit 4d5a314e77
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -316,6 +316,7 @@ class QubesArgumentParser(argparse.ArgumentParser):
Currenty supported options:
``--force-root`` (optional)
``--qubesxml`` location of :file:`qubes.xml` (help is suppressed)
``--offline-mode`` do not talk to hypervisor (help is suppressed)
``--verbose`` and ``--quiet``
'''
@ -331,6 +332,8 @@ class QubesArgumentParser(argparse.ArgumentParser):
if self._want_app:
self.add_argument('--qubesxml', metavar='FILE', action='store',
dest='app', help=argparse.SUPPRESS)
self.add_argument('--offline-mode', action='store_true',
default=False, dest='offline_mode', help=argparse.SUPPRESS)
self.add_argument('--verbose', '-v', action='count',
@ -357,7 +360,8 @@ class QubesArgumentParser(argparse.ArgumentParser):
if self._want_app and not self._want_app_no_instance:
self.set_qubes_verbosity(namespace)
namespace.app = qubes.Qubes(namespace.app)
namespace.app = qubes.Qubes(namespace.app,
offline_mode=namespace.offline_mode)
if self._want_force_root:
self.dont_run_as_root(namespace)