From 4d5a314e77a08f0ae2410adbc7cd67ce48134d8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Tue, 9 Aug 2016 04:28:18 +0200 Subject: [PATCH] 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. --- qubes/tools/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/qubes/tools/__init__.py b/qubes/tools/__init__.py index 1cff3fd4..f26fb3f9 100644 --- a/qubes/tools/__init__.py +++ b/qubes/tools/__init__.py @@ -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)