qubes/vm: fix pause handling

1. There is no such thing as libvirt_domain.pause().
2. libvirt_domain.state() returns [state, reason]
This commit is contained in:
Marek Marczykowski-Górecki 2016-08-09 05:08:55 +02:00
parent d2393f91e8
commit d4e534bc05
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -811,10 +811,7 @@ class QubesVM(qubes.vm.mix.net.NetVMMixin, qubes.vm.BaseVM):
'Cannot suspend domain {!r} which has PCI devices attached'
.format(self.name))
else:
if self.hvm:
self.libvirt_domain.pause()
else:
self.libvirt_domain.suspend()
self.libvirt_domain.suspend()
return self
@ -1317,7 +1314,7 @@ class QubesVM(qubes.vm.mix.net.NetVMMixin, qubes.vm.BaseVM):
'''
return self.libvirt_domain \
and self.libvirt_domain.state() == libvirt.VIR_DOMAIN_PAUSED
and self.libvirt_domain.state()[0] == libvirt.VIR_DOMAIN_PAUSED
def is_qrexec_running(self):
'''Check whether qrexec for this domain is available.