Преглед изворни кода

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.
Marek Marczykowski-Górecki пре 7 година
родитељ
комит
4d5a314e77
1 измењених фајлова са 5 додато и 1 уклоњено
  1. 5 1
      qubes/tools/__init__.py

+ 5 - 1
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)