backup: fixup restore options just before restoring VMs

When user included/excluded some VMs for restoration, it may be
neceesarry to fix dependencies between them (for example when default
template is no longer going to be restored).
Also fix handling conflicting names.
This commit is contained in:
Marek Marczykowski-Górecki 2016-10-26 21:37:26 +02:00
parent 043d20c05d
commit af182c4fd1
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -2021,7 +2021,7 @@ class BackupRestore(object):
vm_info.problems.add(self.VMToRestore.EXCLUDED)
if not self.options.verify_only and \
vm in self.app.domains:
vm_info.name in self.app.domains:
if self.options.rename_conflicting:
new_name = self.generate_new_name_for_conflicting_vm(
vm, restore_info
@ -2343,6 +2343,8 @@ class BackupRestore(object):
# FIXME handle locking
restore_info = self.restore_info_verify(restore_info)
self._restore_vms_metadata(restore_info)
# Perform VM restoration in backup order