[libvirt] [REBASE PATCH v2 1/9] qemu: Add support for DUMP_COMPLETED event
John Ferlan
jferlan at redhat.com
Fri Jan 26 13:43:38 UTC 2018
On 01/25/2018 11:59 AM, Jiri Denemark wrote:
> On Fri, Jan 19, 2018 at 14:53:08 -0500, John Ferlan wrote:
>> The event is fired when the domain memory only dump completes.
>>
>> Wire up the code to extract and send along the status.
>>
>> Signed-off-by: John Ferlan <jferlan at redhat.com>
>> ---
>> src/qemu/qemu_monitor.c | 18 ++++++++++++++++++
>> src/qemu/qemu_monitor.h | 19 +++++++++++++++++++
>> src/qemu/qemu_monitor_json.c | 31 +++++++++++++++++++++++++++++++
>> 3 files changed, 68 insertions(+)
> ...
>> +static void
>> +qemuMonitorJSONHandleDumpCompleted(qemuMonitorPtr mon,
>> + virJSONValuePtr data)
>> +{
>> + const char *statusstr;
>> + qemuMonitorDumpStatus status;
>> + virJSONValuePtr result;
>> +
>> + if (!(result = virJSONValueObjectGetObject(data, "result"))) {
>> + VIR_WARN("missing result in dump completed event");
>> + return;
>> + }
>> +
>> + if (!(statusstr = virJSONValueObjectGetString(result, "status"))) {
>> + VIR_WARN("missing status string in dump completed event");
>> + return;
>> + }
>> +
>> + status = qemuMonitorDumpStatusTypeFromString(statusstr);
>> + if (status < 0) {
>> + VIR_WARN("invalid status string '%s' in dump completed event",
>> + statusstr);
>> + return;
>> + }
>> +
>> + qemuMonitorEmitDumpCompleted(mon, status);
>
> According to qapi-schema the DUMP_COMPLETED event may contain an error
> string. Don't we want to consume it here too?
>
> Jirka
>
We could I suppose, passing it back through like EmitBlockJob and
BlockJobCallback. Once I page all this code back into short term memory
(Nov. seems so long ago), I'll work through the other comments as well
and post a new version.
I'm trying to think about the common stats parser right now and how to
handle errors as the dump completed event code would use VIR_WARN when
failing to parse the result, but the query code would use virReportError
Tks -
John
More information about the libvir-list
mailing list