backup: Do not try to attach devices during backup verification

The "restored" VM object will be discarded anyway, and it doesn't have
real 'attach' method.

Fixes QubesOS/qubes-issues#4830
This commit is contained in:
Marek Marczykowski-Górecki 2019-02-23 15:49:18 +01:00
parent 2ad9b57961
commit 5e4831ede4
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -1968,7 +1968,8 @@ class BackupRestore(object):
options=options, options=options,
persistent=True) persistent=True)
try: try:
new_vm.devices[bus].attach(assignment) if not self.options.verify_only:
new_vm.devices[bus].attach(assignment)
except Exception as err: # pylint: disable=broad-except except Exception as err: # pylint: disable=broad-except
self.log.error('Error attaching device %s:%s to %s: %s', self.log.error('Error attaching device %s:%s to %s: %s',
bus, ident, vm.name, err) bus, ident, vm.name, err)