[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 06/12] qmp: Expose qemu_announce_self as a qmp c
From: |
Vlad Yasevich |
Subject: |
Re: [Qemu-devel] [PATCH 06/12] qmp: Expose qemu_announce_self as a qmp command |
Date: |
Fri, 26 May 2017 09:19:45 -0400 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 |
On 05/26/2017 09:16 AM, Eric Blake wrote:
> On 05/24/2017 01:05 PM, Vladislav Yasevich wrote:
>> Add a qmp command that can trigger guest announcements.
>>
>> Based on work of Germano Veit Michel <address@hidden>
>>
>> Signed-off-by: Vladislav Yasevich <address@hidden>
>> ---
>> migration/savevm.c | 14 ++++++++++++++
>> qapi-schema.json | 19 +++++++++++++++++++
>> 2 files changed, 33 insertions(+)
>>
>
>> +void qmp_announce_self(bool has_params, AnnounceParameters *params,
>> + Error **errp)
>> +{
>> + AnnounceParameters announce_params;
>> +
>> + memcpy(&announce_params, qemu_get_announce_params(),
>> + sizeof(announce_params));
>
> Shallow copies of a QAPI type happen to work when the type is all scalar
> (as AnnounceParameters currently is), but it's more robust to use
> QAPI_CLONE() or QAPI_CLONE_MEMBERS() so that any future non-scalar
> additions to the parameters type will be correctly copied without
> introducing memory leaks or double frees.
>
> Even this might be better:
> AnnounceParameters announce_params = { 0 };
> qemu_set_announce_parameters(&announce_params, qemu_get_announce_params());
>
Ok.
>> +
>> + if (has_params)
>> + qemu_set_announce_parameters(&announce_params, params);
>> +
>> + qemu_announce_self(&announce_params);
>> +}
> The QMP changes look okay. Do you have a testsuite covering the new QMP
> command somewhere in the series?
>
There is basic test in patch 12.
Thanks
-vlad
[Qemu-devel] [PATCH 07/12] migration: Allow for a limited number of announce timers, Vladislav Yasevich, 2017/05/24
[Qemu-devel] [PATCH 08/12] announce_timer: Add ability to reset an existing, Vladislav Yasevich, 2017/05/24