On a Tuesday in 2022, Michal Privoznik wrote:
Introduced in QEMU's commit of v4.0.0-rc0~202^2~3 the
query-current-machine command is always available for all QEMU
versions we support (4.2.0, currently). Therefore, we can assume
the capability is always set and thus doesn't need to be checked
for.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/qemu/qemu_driver.c | 11 -----------
1 file changed, 11 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index bcdd55b089..d793c0f52d 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -16307,12 +16307,8 @@ static int
qemuDomainQueryWakeupSuspendSupport(virDomainObj *vm,
bool *wakeupSupported)
{
- qemuDomainObjPrivate *priv = vm->privateData;
int ret = -1;
- if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_QUERY_CURRENT_MACHINE))
- return -1;
-
if (virDomainObjBeginJob(vm, VIR_JOB_QUERY) < 0)
return -1;
@@ -16389,13 +16385,6 @@ qemuDomainPMSuspendForDuration(virDomainPtr dom,
if (!qemuDomainAgentAvailable(vm, true))
goto cleanup;
- /*
- * The case we want to handle here is when QEMU has the API (i.e.
- * QEMU_CAPS_QUERY_CURRENT_MACHINE is set). Otherwise, do not interfere
- * with the suspend process. This means that existing running domains,
- * that don't know about this cap, will keep their old behavior of
- * suspending 'in the dark'.
- */
if (qemuDomainQueryWakeupSuspendSupport(vm, &wakeupSupported) == 0) {
If query-current-machine is supported by all QEMUs, then we should error
out if this cannot be probed.
Jano
if (!wakeupSupported) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
--
2.37.4