vm: make vm.get_power_state() return 'Halted' in offline_mode

Again, if libvirt or even Xen isn't running, we can safely assume VM
isn't too.
This commit is contained in:
Marek Marczykowski-Górecki 2017-06-04 01:12:30 +02:00
parent 313d7422e7
commit 89e025ca3b
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -1492,6 +1492,8 @@ class QubesVM(qubes.vm.mix.net.NetVMMixin, qubes.vm.BaseVM):
# isn't running
# reason for this "if": allow vm.is_running() in PCI (or other
# device) extension while constructing libvirt XML
if self.app.vmm.offline_mode:
return 'Halted'
if self._libvirt_domain is None:
try:
self._libvirt_domain = self.app.vmm.libvirt_conn.lookupByUUID(