dom0/qvm-start: support for custom Xen config
This commit is contained in:
parent
0c9781648a
commit
049a74d5af
@ -870,9 +870,15 @@ class QubesVm(object):
|
|||||||
|
|
||||||
return args
|
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):
|
def create_config_file(self, file_path = None, source_template = None, prepare_dvm = False):
|
||||||
if file_path is None:
|
if file_path is None:
|
||||||
file_path = self.conf_file
|
file_path = self.conf_file
|
||||||
|
if self.uses_custom_config:
|
||||||
|
return
|
||||||
if source_template is None:
|
if source_template is None:
|
||||||
source_template = self.template
|
source_template = self.template
|
||||||
|
|
||||||
|
@ -39,6 +39,8 @@ def main():
|
|||||||
help="Attach debugging console to the newly started VM")
|
help="Attach debugging console to the newly started VM")
|
||||||
parser.add_option ("--dvm", action="store_true", dest="preparing_dvm", default=False,
|
parser.add_option ("--dvm", action="store_true", dest="preparing_dvm", default=False,
|
||||||
help="Do actions necessary when preparing DVM image")
|
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 ()
|
(options, args) = parser.parse_args ()
|
||||||
if (len (args) != 1):
|
if (len (args) != 1):
|
||||||
@ -55,6 +57,9 @@ def main():
|
|||||||
print >> sys.stderr, "A VM with the name '{0}' does not exist in the system.".format(vmname)
|
print >> sys.stderr, "A VM with the name '{0}' does not exist in the system.".format(vmname)
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
|
if options.custom_config:
|
||||||
|
vm.conf_file = options.custom_config
|
||||||
|
|
||||||
try:
|
try:
|
||||||
vm.verify_files()
|
vm.verify_files()
|
||||||
xid = vm.start(debug_console=options.debug_console, verbose=options.verbose, preparing_dvm=options.preparing_dvm)
|
xid = vm.start(debug_console=options.debug_console, verbose=options.verbose, preparing_dvm=options.preparing_dvm)
|
||||||
|
Loading…
Reference in New Issue
Block a user