From edecda6a978b23f2c0b3ebaea836be77eb3d6d2d Mon Sep 17 00:00:00 2001 From: Marek Marczykowski Date: Thu, 15 Mar 2012 20:58:12 +0100 Subject: [PATCH] dom0/qvm-start: support for custom Xen config --- dom0/qvm-core/qubes.py | 6 ++++++ dom0/qvm-tools/qvm-start | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/dom0/qvm-core/qubes.py b/dom0/qvm-core/qubes.py index 934680b1..15c398d6 100755 --- a/dom0/qvm-core/qubes.py +++ b/dom0/qvm-core/qubes.py @@ -881,9 +881,15 @@ class QubesVm(object): return args + @property + def uses_custom_config(self): + return self.conf_file != self.absolute_path(self.name + ".conf", None) + def create_config_file(self, file_path = None, source_template = None, prepare_dvm = False): if file_path is None: file_path = self.conf_file + if self.uses_custom_config: + return if source_template is None: source_template = self.template diff --git a/dom0/qvm-tools/qvm-start b/dom0/qvm-tools/qvm-start index 5ec3c1c5..9b4f5995 100755 --- a/dom0/qvm-tools/qvm-start +++ b/dom0/qvm-tools/qvm-start @@ -41,6 +41,8 @@ def main(): help="Temporarily attach specified drive as CD/DVD") parser.add_option ("--dvm", action="store_true", dest="preparing_dvm", default=False, help="Do actions necessary when preparing DVM image") + parser.add_option ("--custom-config", action="store", dest="custom_config", default=None, + help="Use custom Xen config instead of Qubes-generated one") (options, args) = parser.parse_args () if (len (args) != 1): @@ -64,6 +66,9 @@ def main(): print >> sys.stderr, "This VM does not support attaching drives" exit (1) + if options.custom_config: + vm.conf_file = options.custom_config + try: vm.verify_files() xid = vm.start(debug_console=options.debug_console, verbose=options.verbose, preparing_dvm=options.preparing_dvm)