From bbbe045b62c47bfd253a84f7a171a4830ba5b4d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Wed, 17 Aug 2016 01:18:11 +0200 Subject: [PATCH] qubes/backup: better handle restoring kernel=None case It makes sense for HVM domains, so allow such configuration. --- qubes/backup.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/qubes/backup.py b/qubes/backup.py index f37d5ef6..fb413426 100644 --- a/qubes/backup.py +++ b/qubes/backup.py @@ -1844,9 +1844,12 @@ class BackupRestore(object): installed_kernels = os.listdir(os.path.join( qubes.config.qubes_base_dir, qubes.config.system_path['qubes_kernels_base_dir'])) - if not vm_info.vm.property_is_default('kernel') \ - and vm_info.vm.kernel \ - and vm_info.vm.kernel not in installed_kernels: + # if uses default kernel - do not validate it + # allow kernel=None only for HVM, + # otherwise require valid kernel + if not (vm_info.vm.property_is_default('kernel') + or (not vm_info.vm.kernel and vm_info.vm.hvm) + or vm_info.vm.kernel in installed_kernels): if self.options.use_default_kernel: vm_info.vm.kernel = qubes.property.DEFAULT else: