[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH 03/10] hw/misc/vmcoreinfo: Un-inline vmcoreinfo_find()
From: |
Daniel P . Berrangé |
Subject: |
Re: [RFC PATCH 03/10] hw/misc/vmcoreinfo: Un-inline vmcoreinfo_find() |
Date: |
Thu, 19 Dec 2024 16:57:07 +0000 |
User-agent: |
Mutt/2.2.13 (2024-03-09) |
On Thu, Dec 19, 2024 at 04:38:50PM +0100, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> include/hw/misc/vmcoreinfo.h | 13 ++++++-------
> hw/misc/vmcoreinfo.c | 16 +++++++++++++---
> 2 files changed, 19 insertions(+), 10 deletions(-)
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
> diff --git a/hw/misc/vmcoreinfo.c b/hw/misc/vmcoreinfo.c
> index ad5a4dec596..c5bb5c9fa52 100644
> --- a/hw/misc/vmcoreinfo.c
> +++ b/hw/misc/vmcoreinfo.c
> @@ -42,11 +42,12 @@ static void vmcoreinfo_realize(DeviceState *dev, Error
> **errp)
> /* for gdb script dump-guest-memory.py */
> static VMCoreInfoState * volatile vmcoreinfo_state G_GNUC_UNUSED;
>
> - /* Given that this function is executing, there is at least one
> VMCOREINFO
> - * device. Check if there are several.
> + /*
> + * Given that this function is executing, there is at least one
> + * VMCOREINFO instance. Check if there are several.
> */
> if (!vmcoreinfo_find()) {
> - error_setg(errp, "at most one %s device is permitted",
> + error_setg(errp, "at most one %s instance is permitted",
> VMCOREINFO_DEVICE);
> return;
> }
This chunk is unrelated to the claimed goal of this
commit. It makes sense as a change though, so feel
free to add my R-B when splitting into a separate
commit.
> @@ -103,3 +104,12 @@ static const TypeInfo vmcoreinfo_types[] = {
> };
>
> DEFINE_TYPES(vmcoreinfo_types)
> +
> +VMCoreInfoState *vmcoreinfo_find(void)
> +{
> + Object *obj;
> +
> + obj = object_resolve_path_type("", TYPE_VMCOREINFO_DEVICE, NULL);
> +
> + return obj ? (VMCoreInfoState *)obj : NULL;
> +}
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
> --
> 2.47.1
>
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
- [RFC PATCH 00/10] hw/misc/vmcoreinfo: Convert from QDev to plain Object, Philippe Mathieu-Daudé, 2024/12/19
- [RFC PATCH 03/10] hw/misc/vmcoreinfo: Un-inline vmcoreinfo_find(), Philippe Mathieu-Daudé, 2024/12/19
- Re: [RFC PATCH 03/10] hw/misc/vmcoreinfo: Un-inline vmcoreinfo_find(),
Daniel P . Berrangé <=
- [RFC PATCH 01/10] hw/misc/vmcoreinfo: Declare QOM type using DEFINE_TYPES macro, Philippe Mathieu-Daudé, 2024/12/19
- [RFC PATCH 04/10] hw/misc/vmcoreinfo: Rename VMCOREINFO_DEVICE -> TYPE_VMCOREINFO_DEVICE, Philippe Mathieu-Daudé, 2024/12/19
- [RFC PATCH 09/10] hw/misc/vmcoreinfo: Deprecate '-device vmcoreinfo', Philippe Mathieu-Daudé, 2024/12/19
- [RFC PATCH 05/10] hw/misc/vmcoreinfo: Convert to three-phase reset interface, Philippe Mathieu-Daudé, 2024/12/19
- [RFC PATCH 07/10] hw/misc/vmcoreinfo: Factor vmcoreinfo_device_realize() out, Philippe Mathieu-Daudé, 2024/12/19
- [RFC PATCH 02/10] hw/misc/vmcoreinfo: Rename opaque pointer as 'opaque', Philippe Mathieu-Daudé, 2024/12/19