[libvirt] [PATCH 3/4] qemu: monitor: Extract additional info from GUEST_PANICKED event

Jiri Denemark jdenemar at redhat.com
Mon Mar 27 13:36:16 UTC 2017


On Tue, Mar 21, 2017 at 08:47:49 +0100, Peter Krempa wrote:
> For certain kinds of panic notifiers (notably hyper-v) qemu is able to
> report some data regarding the crash passed from the guest.
> 
> Make the data accessible to the callback in qemu so that it can be
> processed further.
> ---
>  src/qemu/qemu_monitor.c      | 15 ++++++++++--
>  src/qemu/qemu_monitor.h      | 32 ++++++++++++++++++++++++-
>  src/qemu/qemu_monitor_json.c | 56 ++++++++++++++++++++++++++++++++++++++++++--
>  src/qemu/qemu_process.c      |  2 ++
>  4 files changed, 100 insertions(+), 5 deletions(-)
> 
> diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
> index 79da47237..4a7e71e8f 100644
> --- a/src/qemu/qemu_monitor.c
> +++ b/src/qemu/qemu_monitor.c
> @@ -1359,11 +1359,12 @@ qemuMonitorEmitResume(qemuMonitorPtr mon)
> 
> 
>  int
> -qemuMonitorEmitGuestPanic(qemuMonitorPtr mon)
> +qemuMonitorEmitGuestPanic(qemuMonitorPtr mon,
> +                          qemuMonitorEventPanicInfoPtr info)
>  {
>      int ret = -1;
>      VIR_DEBUG("mon=%p", mon);
> -    QEMU_MONITOR_CALLBACK(mon, ret, domainGuestPanic, mon->vm);
> +    QEMU_MONITOR_CALLBACK(mon, ret, domainGuestPanic, mon->vm, info);
>      return ret;
>  }
> 
> @@ -4184,3 +4185,13 @@ qemuMonitorQueryQMPSchema(qemuMonitorPtr mon)
> 
>      return qemuMonitorJSONQueryQMPSchema(mon);
>  }
> +
> +
> +void
> +qemuMonitorEventPanicInfoFree(qemuMonitorEventPanicInfoPtr info)
> +{
> +    if (!info)
> +        return;

This check is redundant... unless you add more staff in the structure
which would need to be explicitly freed here.

> +
> +    VIR_FREE(info);
> +}

ACK

Jirka




More information about the libvir-list mailing list