dom0/core: do not inherit kernel version from template (#488)

This commit is contained in:
Marek Marczykowski 2012-03-28 00:35:14 +02:00
parent 71b98f9d95
commit 3650ac837e
2 changed files with 6 additions and 15 deletions

View File

@ -240,11 +240,10 @@ class QubesVm(object):
# Internal VM (not shown in qubes-manager, doesn't create appmenus entries
"internal": { "default": False },
"vcpus": { "default": None },
"kernel": { "default": None, 'eval': \
'self.template.kernel if self.template is not None else value' },
"uses_default_kernel": { "default": True },
"uses_default_kernelopts": { "default": True },
"kernelopts": { "default": "", "eval": \
"kernel": { "default": None, 'order': 30 },
"uses_default_kernel": { "default": True, 'order': 30 },
"uses_default_kernelopts": { "default": True, 'order': 30 },
"kernelopts": { "default": "", 'order': 30, "eval": \
'value if not self.uses_default_kernelopts else default_kernelopts_pcidevs if len(self.pcidevs) > 0 else default_kernelopts' },
"mac": { "attr": "_mac", "default": None },
"include_in_backups": { "default": True },
@ -255,8 +254,7 @@ class QubesVm(object):
'self.template.appmenus_templates_dir if self.template is not None else None' },
"config_file_template": { "eval": "config_template_pv" },
"icon_path": { "eval": 'self.dir_path + "/icon.png" if self.dir_path is not None else None' },
"kernels_dir": { 'eval': 'self.template.kernels_dir if self.template is not None else ' + \
'qubes_kernels_base_dir + "/" + self.kernel if self.kernel is not None else ' + \
"kernels_dir": { 'eval': 'qubes_kernels_base_dir + "/" + self.kernel if self.kernel is not None else ' + \
# for backward compatibility (or another rare case): kernel=None -> kernel in VM dir
'self.dir_path + "/" + default_kernels_subdir' },
}

View File

@ -60,9 +60,7 @@ def do_list(vm):
print fmt.format ("memory", vm.memory)
print fmt.format ("maxmem", vm.maxmem)
print fmt.format ("MAC", "%s%s" % (vm.mac, " (auto)" if vm._mac is None else ""))
if vm.template is not None:
print fmt.format ("kernel", "%s (from template)" % vm.kernel)
elif vm.uses_default_kernel:
if vm.uses_default_kernel:
print fmt.format ("kernel", "%s (default)" % vm.kernel)
else:
print fmt.format ("kernel", vm.kernel)
@ -71,7 +69,6 @@ def do_list(vm):
else:
print fmt.format ("kernelopts", vm.kernelopts)
def set_label(vms, vm, args):
if len (args) != 1:
print >> sys.stderr, "Missing label name argument!"
@ -153,10 +150,6 @@ def set_netvm(vms, vm, args):
vm.netvm = netvm
def set_kernel(vms, vm, args):
if vm.template is not None:
print >> sys.stderr, "Cannot set kernel for template-based VM. Set it for template instead."
return False
if len (args) != 1:
print >> sys.stderr, "Missing kernel version argument!"
print >> sys.stderr, "Possible values:"