[libvirt] [PATCH 01/12] qemu: qemuDomainPMSuspendForDuration: Check availability of agent

Lin Ma morecache at gmail.com
Fri Sep 11 07:06:08 UTC 2020


It requires a guest agent configured and running in the domain's guest
OS, So check qemu agent during qemuDomainPMSuspendForDuration().

Signed-off-by: Lin Ma <lma at suse.de>
---
 src/qemu/qemu_driver.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 2e46931c71..bd287f259e 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -16820,6 +16820,9 @@ qemuDomainPMSuspendForDuration(virDomainPtr dom,
     if (virDomainPMSuspendForDurationEnsureACL(dom->conn, vm->def) < 0)
         goto cleanup;
 
+    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
-- 
2.26.0




More information about the libvir-list mailing list