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

Ján Tomko jtomko at redhat.com
Fri Sep 11 11:39:32 UTC 2020


On a Friday in 2020, Erik Skultety wrote:
>On Fri, Sep 11, 2020 at 03:06:08PM +0800, Lin Ma wrote:
>> 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>
>> ---
>
>qemuDomainPMSuspendAgent later in that same function already checks it, we
>don't need to check it twice.
>

It only does so after calling qemuDomainQueryWakeupSuspendSupport, which
requires grabbing a MODIFY job and executing a QMP command.

I think doing this check upfront is reasonable. We will error out as
soon as we know it, just for the price for two extra duplicit lines.

Jano

>NACK
>
>>  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
>>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20200911/9da7fb1e/attachment-0001.sig>


More information about the libvir-list mailing list