]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemuDomainPMSuspendForDuration: check for wake-up support
authorDaniel Henrique Barboza <danielhb413@gmail.com>
Wed, 24 Apr 2019 21:16:29 +0000 (18:16 -0300)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 25 Apr 2019 09:43:53 +0000 (11:43 +0200)
commitcc1d1dbbd5fa18876a5ca8ac99a991b32ad49409
treecf8cd3f25a54f23557a4ca48f1150ecf9774888e
parent70a4e3ee075ca12723fadaece13b62b767e40547
qemuDomainPMSuspendForDuration: check for wake-up support

If the current QEMU guest can't wake up from suspend properly,
and we are able to determine that, avoid suspending the guest
at all. To be able to determine this support, QEMU needs to
implement the 'query-current-machine' QMP call. This is reflected
by the QEMU_CAPS_QUERY_CURRENT_MACHINE cap.

If the cap is enabled, a new function qemuDomainProbeQMPCurrentMachine
is called. This is wrapper for qemuMonitorGetCurrentMachineInfo,
where the 'wakeup-suspend-support' flag is retrieved from
'query-current-machine'. If wakeupSuspendSupport is true,
proceed with the regular flow of qemuDomainPMSuspendForDuration.

The absence of QEMU_CAPS_QUERY_CURRENT_MACHINE indicates that
we're dealing with a QEMU version older than 4.0 (which implements
the required QMP API). In this case, proceed as usual with the
suspend logic of qemuDomainPMSuspendForDuration, since we can't
assume whether the guest has support or not.

Fixes: https://bugs.launchpad.net/ubuntu/+source/qemu/+bug/1759509
Reported-by: Balamuruhan S <bala24@linux.vnet.ibm.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_driver.c