[libvirt] [REBASE PATCH v2 1/9] qemu: Add support for DUMP_COMPLETED event
Jiri Denemark
jdenemar at redhat.com
Thu Jan 25 16:59:54 UTC 2018
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
More information about the libvir-list
mailing list