diff --git a/qubes/tests/vm/qubesvm.py b/qubes/tests/vm/qubesvm.py index 5e60dc29..cb006e34 100644 --- a/qubes/tests/vm/qubesvm.py +++ b/qubes/tests/vm/qubesvm.py @@ -360,6 +360,11 @@ class TC_90_QubesVM(QubesVMTestsMixin, qubes.tests.QubesTestCase): self.assertPropertyInvalidValue(vm, 'kernel', 123) self.assertPropertyInvalidValue(vm, 'kernel', 'invalid') + def test_252_kernel_empty(self): + vm = self.get_vm() + self.assertPropertyValue(vm, 'kernel', '', '', '') + self.assertPropertyValue(vm, 'kernel', None, '', '') + def test_260_kernelopts(self): vm = self.get_vm() self.assertPropertyDefaultValue(vm, 'kernelopts', diff --git a/qubes/vm/qubesvm.py b/qubes/vm/qubesvm.py index 5aca3cd4..ac5d12c2 100644 --- a/qubes/vm/qubesvm.py +++ b/qubes/vm/qubesvm.py @@ -755,6 +755,8 @@ class QubesVM(qubes.vm.mix.net.NetVMMixin, qubes.vm.BaseVM): @qubes.events.handler('property-pre-set:kernel') def on_property_pre_set_kernel(self, event, name, newvalue, oldvalue=None): # pylint: disable=unused-argument + if not newvalue: + return dirname = os.path.join( qubes.config.system_path['qubes_base_dir'], qubes.config.system_path['qubes_kernels_base_dir'],