backup/restore: distinguish dom0 by name

Getting name of QubesVM object doesn't require Admin API call that could
be not allowed by this VM

QubesOS/qubes-issues#5310
This commit is contained in:
Marek Marczykowski-Górecki 2019-09-08 05:03:29 +02:00
parent b7eca976b5
commit 2b6b4e7954
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -921,7 +921,7 @@ class BackupRestore(object):
#: VM from which backup should be retrieved
self.backup_vm = backup_vm
if backup_vm and backup_vm.qid == 0:
if backup_vm and backup_vm.name == 'dom0':
self.backup_vm = None
#: backup path, inside VM pointed by :py:attr:`backup_vm`