qemu: qemuDomainPMSuspendForDuration: Check availability of agent

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@suse.de>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Lin Ma 2020-09-11 15:06:08 +08:00 committed by Ján Tomko
parent 6de6d6c771
commit 308ec831bb

View File

@ -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