qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v4] pci-hotplug-old: avoid losing error message


From: Gonglei (Arei)
Subject: Re: [Qemu-devel] [PATCH v4] pci-hotplug-old: avoid losing error message
Date: Mon, 29 Sep 2014 02:53:56 +0000

Hi, Michael

Would you like to pick up this patch, which had
been reviewed by Markus and Eric? 

Thanks. :)


Best regards,
-Gonglei

> -----Original Message-----
> From: Gonglei (Arei)
> Sent: Thursday, September 18, 2014 9:06 PM
> To: address@hidden
> Cc: address@hidden; Huangweidong (C); address@hidden;
> address@hidden; Gonglei (Arei)
> Subject: [PATCH v4] pci-hotplug-old: avoid losing error message
> 
> From: Gonglei <address@hidden>
> 
> When scsi_bus_legacy_add_drive() produces an error,
> we will lose the error message. Using error_report
> to report it.
> 
> Cc: Markus Armbruster <address@hidden>
> Signed-off-by: Gonglei <address@hidden>
> Reviewed-by: Markus Armbruster <address@hidden>
> Reviewed-by: Eric Blake <address@hidden>
> ---
> v4:
>  fix typo in the subject (Eric), Thanks.
> v3:
>  fix some typos/grammar issues (Eric) and add 'R-by' tag
> v2:
>  using original condition instead of local_err (Markus)
> ---
>  hw/pci/pci-hotplug-old.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/pci/pci-hotplug-old.c b/hw/pci/pci-hotplug-old.c
> index cf2caeb..d87c469 100644
> --- a/hw/pci/pci-hotplug-old.c
> +++ b/hw/pci/pci-hotplug-old.c
> @@ -107,6 +107,7 @@ static int scsi_hot_add(Monitor *mon, DeviceState
> *adapter,
>  {
>      SCSIBus *scsibus;
>      SCSIDevice *scsidev;
> +    Error *local_err = NULL;
> 
>      scsibus = (SCSIBus *)
>          object_dynamic_cast(OBJECT(QLIST_FIRST(&adapter->child_bus)),
> @@ -127,8 +128,10 @@ static int scsi_hot_add(Monitor *mon, DeviceState
> *adapter,
>      dinfo->unit = qemu_opt_get_number(dinfo->opts, "unit", -1);
>      dinfo->bus = scsibus->busnr;
>      scsidev = scsi_bus_legacy_add_drive(scsibus, dinfo->bdrv, dinfo->unit,
> -                                        false, -1, NULL, NULL);
> +                                        false, -1, NULL, &local_err);
>      if (!scsidev) {
> +        error_report("%s", error_get_pretty(local_err));
> +        error_free(local_err);
>          return -1;
>      }
>      dinfo->unit = scsidev->id;
> --
> 1.7.12.4
> 




reply via email to

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