QEMU commit 46ea94ca9cf ("qmp: query-current-machine with
wakeup-suspend-support") added a new QMP command called
'query-current-machine' that retrieves guest parameters that
can vary in the same machine model (e.g. ACPI support for x86 VMs
depends on the '--no-acpi' option). Currently, this API has a single
flag, 'wakeup-suspend-support', that indicates whether the guest has
the capability of waking up from suspended state.
The original intent of this new API is to avoid situations such as [1],
where an user can execute "virsh dompmsuspend" in a guest that
can't wake up due to lack of support, making the guest unusable.
This is currently the case for any non-x86 arch guests and for
some x86 guests that starts with --no-acpi (q35 machines implements
suspend support even with the --no-acpi flag).
This is the Libvirt side of this API that will be available in
QEMU 4.0. QEMU_CAPS_QUERY_CURRENT_MACHINE is a new
virQEMUCapsCommands that will indicate if the QEMU binary
supports the 'query-current-machine' API. QEMU_CAPS_PM_WAKEUP_SUPPORT
is a flag that reflects the 'wakeup-suspend-support' value
for the current QEMU instance. In the next patches these
two caps will be populated and used in qemu_driver.c,
'qemuDomainPMSuspendForDuration', to complete the fix
for [1].
[1]
https://github.com/open-power-host-os/qemu/issues/31
Signed-off-by: Daniel Henrique Barboza <danielhb413(a)gmail.com>
---
src/qemu/qemu_capabilities.c | 5 +++++
src/qemu/qemu_capabilities.h | 4 ++++
tests/qemucapabilitiesdata/caps_4.0.0.riscv32.xml | 1 +
tests/qemucapabilitiesdata/caps_4.0.0.riscv64.xml | 1 +
tests/qemucapabilitiesdata/caps_4.0.0.x86_64.xml | 1 +
5 files changed, 12 insertions(+)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 71d4c01296..5c1b41aa3e 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -523,6 +523,10 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST,
"nvdimm.unarmed",
"scsi-disk.device_id",
"virtio-pci-non-transitional",
+ "query-current-machine",
+
+ /* 330 */
+ "wakeup-suspend-support",
This is unused capability yet. I rather see it introduced with its usage.
Michal