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).
This commit is contained in:
Marek Marczykowski-Górecki 2016-08-16 00:00:14 +02:00
parent eb637147fb
commit 2f977ff4f5
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -1617,7 +1617,8 @@ class BackupRestore(object):
""" """
if self.header_data.version == 1: if self.header_data.version == 1:
backup_app = qubes.core2migration.Core2Qubes( 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 return backup_app
else: else:
self._verify_hmac("qubes.xml.000", "qubes.xml.000.hmac") 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]: if self.header_data.version in [2, 3]:
backup_app = qubes.core2migration.Core2Qubes( backup_app = qubes.core2migration.Core2Qubes(
os.path.join(self.tmpdir, 'qubes.xml')) os.path.join(self.tmpdir, 'qubes.xml'), offline_mode=True)
else: 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 # Not needed anymore - all the data stored in backup_app
os.unlink(os.path.join(self.tmpdir, 'qubes.xml')) os.unlink(os.path.join(self.tmpdir, 'qubes.xml'))
return backup_app return backup_app