qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v4 3/8] stubs: add vmcoreinfo_get() stub


From: Laszlo Ersek
Subject: Re: [Qemu-devel] [PATCH v4 3/8] stubs: add vmcoreinfo_get() stub
Date: Fri, 14 Jul 2017 22:09:33 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1

On 07/14/17 20:20, Marc-André Lureau wrote:
> Common dump code may call vmcoreinfo_get() which is not available on
> all targets.
> 
> Signed-off-by: Marc-André Lureau <address@hidden>
> ---
>  stubs/vmcoreinfo.c  | 9 +++++++++
>  stubs/Makefile.objs | 1 +
>  2 files changed, 10 insertions(+)
>  create mode 100644 stubs/vmcoreinfo.c
> 
> diff --git a/stubs/vmcoreinfo.c b/stubs/vmcoreinfo.c
> new file mode 100644
> index 0000000000..a994153832
> --- /dev/null
> +++ b/stubs/vmcoreinfo.c
> @@ -0,0 +1,9 @@
> +#include "qemu/osdep.h"
> +
> +#include "hw/acpi/vmcoreinfo.h"
> +
> +bool vmcoreinfo_get(VMCoreInfoState *vis, uint64_t *paddr, uint32_t *size,
> +                    Error **errp)
> +{
> +    return false;
> +}
> diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs
> index f5b47bfd74..3bedc73252 100644
> --- a/stubs/Makefile.objs
> +++ b/stubs/Makefile.objs
> @@ -36,6 +36,7 @@ stub-obj-y += qmp_pc_dimm_device_list.o
>  stub-obj-y += target-monitor-defs.o
>  stub-obj-y += target-get-monitor-def.o
>  stub-obj-y += pc_madt_cpu_entry.o
> +stub-obj-y += vmcoreinfo.o
>  stub-obj-y += vmgenid.o
>  stub-obj-y += xen-common.o
>  stub-obj-y += xen-hvm.o
> 

Looks like a good idea -- but now that you are adding this patch, I
think we should actually report an error like "unsupported" via errp:

  error_setg(errp, QERR_UNSUPPORTED);

In patch #5 you report the error (as a warning) with warn_report_err(),
and I think that's going to crash there -- err is pre-inited to NULL,
the above impl. doesn't change it, and warn_report_err() doesn't expect
NULL.

Thanks
Laszlo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]