From 2f977ff4f55b4be90ec170c3c1d20a3fce5817f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Tue, 16 Aug 2016 00:00:14 +0200 Subject: [PATCH] backup: open backup collection in offline mode Otherwise it may try to manipulate live libvirt objects with the same names (and probably different UUIDs, which would fail). --- qubes/backup.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/qubes/backup.py b/qubes/backup.py index 2af86474..f37d5ef6 100644 --- a/qubes/backup.py +++ b/qubes/backup.py @@ -1617,7 +1617,8 @@ class BackupRestore(object): """ if self.header_data.version == 1: backup_app = qubes.core2migration.Core2Qubes( - os.path.join(self.backup_location, 'qubes.xml')) + os.path.join(self.backup_location, 'qubes.xml'), + offline_mode=True) return backup_app else: self._verify_hmac("qubes.xml.000", "qubes.xml.000.hmac") @@ -1634,9 +1635,10 @@ class BackupRestore(object): if self.header_data.version in [2, 3]: backup_app = qubes.core2migration.Core2Qubes( - os.path.join(self.tmpdir, 'qubes.xml')) + os.path.join(self.tmpdir, 'qubes.xml'), offline_mode=True) else: - backup_app = qubes.Qubes(os.path.join(self.tmpdir, 'qubes.xml')) + backup_app = qubes.Qubes(os.path.join(self.tmpdir, 'qubes.xml'), + offline_mode=True) # Not needed anymore - all the data stored in backup_app os.unlink(os.path.join(self.tmpdir, 'qubes.xml')) return backup_app