All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] pci-hotplug-old: avoid lossing error message
@ 2014-09-18  8:53 arei.gonglei
  2014-09-18 12:21 ` Eric Blake
  0 siblings, 1 reply; 3+ messages in thread
From: arei.gonglei @ 2014-09-18  8:53 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gonglei, weidong.huang, armbru, mst

From: Gonglei <arei.gonglei@huawei.com>

When scsi_bus_legacy_add_drive() produce error,
we will loss error message. Using error_report
report it.

Cc: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
---
 hw/pci/pci-hotplug-old.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/hw/pci/pci-hotplug-old.c b/hw/pci/pci-hotplug-old.c
index cf2caeb..ed85f24 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);
-    if (!scsidev) {
+                                        false, -1, NULL, &local_err);
+    if (local_err) {
+        error_report("%s", error_get_pretty(local_err));
+        error_free(local_err);
         return -1;
     }
     dinfo->unit = scsidev->id;
-- 
1.7.12.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] pci-hotplug-old: avoid lossing error message
  2014-09-18  8:53 [Qemu-devel] [PATCH] pci-hotplug-old: avoid lossing error message arei.gonglei
@ 2014-09-18 12:21 ` Eric Blake
  2014-09-18 12:32   ` Gonglei (Arei)
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Blake @ 2014-09-18 12:21 UTC (permalink / raw)
  To: arei.gonglei, qemu-devel; +Cc: weidong.huang, armbru, mst

[-- Attachment #1: Type: text/plain, Size: 760 bytes --]

On 09/18/2014 02:53 AM, arei.gonglei@huawei.com wrote:
> From: Gonglei <arei.gonglei@huawei.com>

s/lossing/losing/ in the subject.

> 
> When scsi_bus_legacy_add_drive() produce error,

s/produce error/produces an error/

> we will loss error message. Using error_report

s/loss/lose the/
s/Using error_report/Use error_report to/

> report it.
> 
> Cc: Markus Armbruster <armbru@redhat.com>
> Signed-off-by: Gonglei <arei.gonglei@huawei.com>
> ---
>  hw/pci/pci-hotplug-old.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 

With the commit message improved,
Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 539 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] pci-hotplug-old: avoid lossing error message
  2014-09-18 12:21 ` Eric Blake
@ 2014-09-18 12:32   ` Gonglei (Arei)
  0 siblings, 0 replies; 3+ messages in thread
From: Gonglei (Arei) @ 2014-09-18 12:32 UTC (permalink / raw)
  To: Eric Blake, qemu-devel@nongnu.org
  Cc: Huangweidong (C), armbru@redhat.com, mst@redhat.com







> -----Original Message-----
> From: Eric Blake [mailto:eblake@redhat.com]
> Sent: Thursday, September 18, 2014 8:22 PM
> To: Gonglei (Arei); qemu-devel@nongnu.org
> Cc: Huangweidong (C); armbru@redhat.com; mst@redhat.com
> Subject: Re: [Qemu-devel] [PATCH] pci-hotplug-old: avoid lossing error message
> 
> On 09/18/2014 02:53 AM, arei.gonglei@huawei.com wrote:
> > From: Gonglei <arei.gonglei@huawei.com>
> 
> s/lossing/losing/ in the subject.
> 
> >
> > When scsi_bus_legacy_add_drive() produce error,
> 
> s/produce error/produces an error/
> 
> > we will loss error message. Using error_report
> 
> s/loss/lose the/
> s/Using error_report/Use error_report to/
> 
> > report it.
> >
> > Cc: Markus Armbruster <armbru@redhat.com>
> > Signed-off-by: Gonglei <arei.gonglei@huawei.com>
> > ---
> >  hw/pci/pci-hotplug-old.c | 7 +++++--
> >  1 file changed, 5 insertions(+), 2 deletions(-)
> >
> 
> With the commit message improved,
> Reviewed-by: Eric Blake <eblake@redhat.com>
> 

Thanks, Eric.

I posted v2 and Markus have reviewed. 
If you haven't dissidence for v2, I will post v3 by your comments 
and add your both 'R-b' tag. :)

Best regards,
-Gonglei

> --
> Eric Blake   eblake redhat com    +1-919-301-3266
> Libvirt virtualization library http://libvirt.org


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-09-18 12:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-18  8:53 [Qemu-devel] [PATCH] pci-hotplug-old: avoid lossing error message arei.gonglei
2014-09-18 12:21 ` Eric Blake
2014-09-18 12:32   ` Gonglei (Arei)

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.