From 04635e7e80303f7d724baa5e3bb11c2b5cf82706 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Wed, 14 Feb 2018 04:04:29 +0100 Subject: [PATCH] backup: skip dom0's properties while restoring core2 backup Fixes QubesOS/qubes-issues#3467 --- qubesadmin/backup/core2.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/qubesadmin/backup/core2.py b/qubesadmin/backup/core2.py index c60cf57..3f13d86 100644 --- a/qubesadmin/backup/core2.py +++ b/qubesadmin/backup/core2.py @@ -267,6 +267,15 @@ class Core2Qubes(qubesadmin.backup.BackupApp): vm.template = \ self.qid_map[int(element.get('template_qid'))] vm.klass = "AppVM" + + vm.backup_content = element.get('backup_content', False) == 'True' + vm.backup_path = element.get('backup_path', None) + vm.size = element.get('backup_size', 0) + + if vm.klass == 'AdminVM': + # don't set any other dom0 property + return + # simple attributes for attr, default in { #'installed_by_rpm': 'False', @@ -324,10 +333,6 @@ class Core2Qubes(qubesadmin.backup.BackupApp): feature = repl_feature vm.features[feature] = value - vm.backup_content = element.get('backup_content', False) == 'True' - vm.backup_path = element.get('backup_path', None) - vm.size = element.get('backup_size', 0) - pci_strictreset = element.get('pci_strictreset', True) pcidevs = element.get('pcidevs') if pcidevs: