]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: qemuDomainPMSuspendAgent: Don't assign to 'ret' in a conditional
authorErik Skultety <eskultet@redhat.com>
Fri, 11 Sep 2020 12:44:27 +0000 (14:44 +0200)
committerErik Skultety <eskultet@redhat.com>
Fri, 11 Sep 2020 12:48:40 +0000 (14:48 +0200)
When the guest agent isn't running, we still report success on a PM
suspend action even though we logged an error correctly, this is because
we poisoned the 'ret' value a few lines above.

Fixes: a663a860819287e041c3de672aad1d8543098ecc
Signed-off-by: Erik Skultety <eskultet@redhat.com>
src/qemu/qemu_driver.c

index 2e46931c7163b95db2fab47bc350e5a324ec9beb..fcdee31971af306d12b4a3f048ec745615a5b0d6 100644 (file)
@@ -16770,7 +16770,7 @@ qemuDomainPMSuspendAgent(virQEMUDriverPtr driver,
     if (qemuDomainObjBeginAgentJob(driver, vm, QEMU_AGENT_JOB_MODIFY) < 0)
         return -1;
 
-    if ((ret = virDomainObjCheckActive(vm)) < 0)
+    if (virDomainObjCheckActive(vm) < 0)
         goto endjob;
 
     if (!qemuDomainAgentAvailable(vm, true))