[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v5 2/7] spapr.c: avoid sending MEM_UNPLUG_ERROR if dev->id is
From: |
Greg Kurz |
Subject: |
Re: [PATCH v5 2/7] spapr.c: avoid sending MEM_UNPLUG_ERROR if dev->id is NULL |
Date: |
Fri, 16 Jul 2021 13:21:34 +0200 |
On Mon, 12 Jul 2021 16:43:34 -0300
Daniel Henrique Barboza <danielhb413@gmail.com> wrote:
> As done in hw/acpi/memory_hotplug.c, avoid sending
> qapi_event_send_mem_unplug_error() if dev->id is NULL.
>
> Suggested-by: Markus Armbruster <armbru@redhat.com>
> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
> ---
Reviewed-by: Greg Kurz <groug@kaod.org>
> hw/ppc/spapr.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index 81699d4f8b..1611d7ab05 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -3688,9 +3688,11 @@ void spapr_memory_unplug_rollback(SpaprMachineState
> *spapr, DeviceState *dev)
> * Tell QAPI that something happened and the memory
> * hotunplug wasn't successful.
> */
> - qapi_error = g_strdup_printf("Memory hotunplug rejected by the guest "
> - "for device %s", dev->id);
> - qapi_event_send_mem_unplug_error(dev->id, qapi_error);
> + if (dev->id) {
> + qapi_error = g_strdup_printf("Memory hotunplug rejected by the guest
> "
> + "for device %s", dev->id);
> + qapi_event_send_mem_unplug_error(dev->id, qapi_error);
> + }
> }
>
> /* Callback to be called during DRC release. */
- [PATCH v5 0/7] DEVICE_UNPLUG_ERROR QAPI event, Daniel Henrique Barboza, 2021/07/12
- [PATCH v5 1/7] hw/acpi/memory_hotplug.c: avoid sending MEM_UNPLUG_ERROR if dev->id is NULL, Daniel Henrique Barboza, 2021/07/12
- [PATCH v5 2/7] spapr.c: avoid sending MEM_UNPLUG_ERROR if dev->id is NULL, Daniel Henrique Barboza, 2021/07/12
- Re: [PATCH v5 2/7] spapr.c: avoid sending MEM_UNPLUG_ERROR if dev->id is NULL,
Greg Kurz <=
- [PATCH v5 3/7] spapr_drc.c: do not error_report() when drc->dev->id == NULL, Daniel Henrique Barboza, 2021/07/12
- [PATCH v5 4/7] qapi/qdev.json: fix DEVICE_DELETED parameters doc, Daniel Henrique Barboza, 2021/07/12
- [PATCH v5 5/7] qapi/qdev.json: add DEVICE_UNPLUG_ERROR QAPI event, Daniel Henrique Barboza, 2021/07/12
- [PATCH v5 6/7] spapr: use DEVICE_UNPLUG_ERROR to report unplug errors, Daniel Henrique Barboza, 2021/07/12
- [PATCH v5 7/7] memory_hotplug.c: send DEVICE_UNPLUG_ERROR in acpi_memory_hotplug_write(), Daniel Henrique Barboza, 2021/07/12