From: "Andreas Färber" <afaerber@suse.de>
To: Hu Tao <hutao@cn.fujitsu.com>
Cc: Anthony Liguori <aliguori@us.ibm.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
Alexander Graf <agraf@suse.de>,
qemu-devel@nongnu.org, qemu-ppc <qemu-ppc@nongnu.org>,
Paul Brook <paul@codesourcery.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Luiz Capitulino <lcapitulino@redhat.com>,
Gerd Hoffmann <kraxel@redhat.com>
Subject: Re: [Qemu-devel] [PATCH qom-next] scsi: Improve error propagation for scsi_bus_legacy_handle_cmdline()
Date: Mon, 22 Jul 2013 12:24:04 +0200 [thread overview]
Message-ID: <51ED0844.1060809@suse.de> (raw)
In-Reply-To: <20130722091646.GC2668@G08FNSTD100614.fnst.cn.fujitsu.com>
Am 22.07.2013 11:16, schrieb Hu Tao:
> On Sun, Jul 21, 2013 at 12:30:54PM +0200, Andreas Färber wrote:
>> Let scsi_bus_legacy_add_drive() and scsi_bus_legacy_handle_cmdline()
>> return an Error**. Prepare qdev initfns for QOM realize error model.
>>
>> Signed-off-by: Andreas Färber <afaerber@suse.de>
>> ---
>> hw/pci/pci-hotplug-old.c | 2 +-
>> hw/scsi/esp-pci.c | 7 ++++++-
>> hw/scsi/esp.c | 6 ++++--
>> hw/scsi/lsi53c895a.c | 7 ++++++-
>> hw/scsi/megasas.c | 7 ++++++-
>> hw/scsi/scsi-bus.c | 22 +++++++++++++++-------
>> hw/scsi/spapr_vscsi.c | 7 ++++++-
>> hw/scsi/virtio-scsi.c | 7 ++++++-
>> hw/usb/dev-storage.c | 4 +++-
>> include/hw/scsi/scsi.h | 4 ++--
>> 10 files changed, 55 insertions(+), 18 deletions(-)
>>
>> diff --git a/hw/pci/pci-hotplug-old.c b/hw/pci/pci-hotplug-old.c
>> index 8077289..619fe47 100644
>> --- a/hw/pci/pci-hotplug-old.c
>> +++ b/hw/pci/pci-hotplug-old.c
>> @@ -127,7 +127,7 @@ 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);
>> + false, -1, NULL, NULL);
>> if (!scsidev) {
>> return -1;
>> }
>> diff --git a/hw/scsi/esp-pci.c b/hw/scsi/esp-pci.c
>> index 6cdfd53..2ac21d4 100644
>> --- a/hw/scsi/esp-pci.c
>> +++ b/hw/scsi/esp-pci.c
>> @@ -346,6 +346,7 @@ static int esp_pci_scsi_init(PCIDevice *dev)
>> DeviceState *d = DEVICE(dev);
>> ESPState *s = &pci->esp;
>> uint8_t *pci_conf;
>> + Error *err = NULL;
>>
>> pci_conf = dev->config;
>>
>> @@ -364,7 +365,11 @@ static int esp_pci_scsi_init(PCIDevice *dev)
>>
>> scsi_bus_new(&s->bus, d, &esp_pci_scsi_info, NULL);
>> if (!d->hotplugged) {
>> - return scsi_bus_legacy_handle_cmdline(&s->bus);
>> + scsi_bus_legacy_handle_cmdline(&s->bus, &err);
>> + if (err != NULL) {
>
> if (error_is_set(&err))
I was specifically instructed not to use error_is_set() on local err
variables. It is intended for potentially-NULL errp only, which &err
will never be.
Andreas
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
next prev parent reply other threads:[~2013-07-22 10:24 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-01 10:18 [Qemu-devel] [PATCH v2 00/26] use realizefn for SysBusDevice, part 1 Hu Tao
2013-07-01 10:18 ` [Qemu-devel] [PATCH v2 01/26] sysbus: document SysBusDeviceClass about @init Hu Tao
2013-07-03 1:19 ` Andreas Färber
2013-07-03 1:24 ` Hu Tao
2013-07-01 10:18 ` [Qemu-devel] [PATCH v2 02/26] ohci: QOM'ify some more Hu Tao
2013-07-03 1:52 ` Andreas Färber
2013-07-01 10:18 ` [Qemu-devel] [PATCH v2 03/26] ohci: use realize for ohci Hu Tao
2013-07-07 15:22 ` Andreas Färber
2013-07-01 10:18 ` [Qemu-devel] [PATCH v2 04/26] i440fx-pcihost: use realize for i440fx-pcihost Hu Tao
2013-07-07 21:24 ` Andreas Färber
2013-07-01 10:18 ` [Qemu-devel] [PATCH v2 05/26] i440fx: use type-safe cast instead of directly access of parent dev Hu Tao
2013-07-07 17:03 ` Andreas Färber
2013-07-01 10:18 ` [Qemu-devel] [PATCH v2 06/26] q35: " Hu Tao
2013-07-07 23:05 ` Andreas Färber
2013-07-01 10:18 ` [Qemu-devel] [PATCH v2 07/26] q35: use realize for q35 host Hu Tao
2013-07-08 1:20 ` Andreas Färber
2013-07-01 10:18 ` [Qemu-devel] [PATCH v2 08/26] fdc: QOM'ify some more Hu Tao
2013-07-01 10:18 ` [Qemu-devel] [PATCH v2 09/26] fdc: use realize for fdc Hu Tao
2013-07-21 9:27 ` Andreas Färber
2013-07-21 9:31 ` [Qemu-devel] [PATCH qom-next] fdc: Improve error propagation for QOM realize Andreas Färber
2013-07-22 7:38 ` Hu Tao
2013-07-22 8:26 ` Stefan Hajnoczi
2013-07-01 10:18 ` [Qemu-devel] [PATCH v2 10/26] pflash-cfi01: QOM'ify some more Hu Tao
2013-07-01 10:18 ` [Qemu-devel] [PATCH v2 11/26] pflash_cfi01: use realize for pflash_cfi01 Hu Tao
2013-07-01 10:18 ` [Qemu-devel] [PATCH v2 12/26] pflash-cfi02: QOM'ify some more Hu Tao
2013-07-01 10:18 ` [Qemu-devel] [PATCH v2 13/26] pflash_cfi02: use realize for pflash_cfi02 Hu Tao
2013-07-01 10:18 ` [Qemu-devel] [PATCH v2 14/26] ahci: QOM'ify some more Hu Tao
2013-07-01 10:18 ` [Qemu-devel] [PATCH v2 15/26] ahci: use realize for ahci Hu Tao
2013-07-21 9:13 ` Andreas Färber
2013-07-01 10:18 ` [Qemu-devel] [PATCH v2 16/26] fwcfg: QOM'ify some more Hu Tao
2013-07-01 10:18 ` [Qemu-devel] [PATCH v2 17/26] fwcfg: use realize for fwcfg Hu Tao
2013-07-21 9:35 ` Andreas Färber
2013-07-22 8:37 ` Hu Tao
2013-07-01 10:18 ` [Qemu-devel] [PATCH v2 18/26] scsi esp: QOM'ify some more Hu Tao
2013-07-01 10:18 ` [Qemu-devel] [PATCH v2 19/26] scsi esp: use realize for scsi esp Hu Tao
2013-07-21 9:47 ` Andreas Färber
2013-07-21 10:30 ` [Qemu-devel] [PATCH qom-next] scsi: Improve error propagation for scsi_bus_legacy_handle_cmdline() Andreas Färber
2013-07-22 9:16 ` Hu Tao
2013-07-22 10:24 ` Andreas Färber [this message]
2013-07-01 10:18 ` [Qemu-devel] [PATCH v2 20/26] hpet: QOM'ify some more Hu Tao
2013-07-01 10:18 ` [Qemu-devel] [PATCH v2 21/26] hpet: use realize for hpet Hu Tao
2013-07-01 10:18 ` [Qemu-devel] [PATCH v2 22/26] kvmclock: QOM'ify some more Hu Tao
2013-07-16 14:00 ` Andreas Färber
2013-07-01 10:18 ` [Qemu-devel] [PATCH v2 23/26] kvmclock: use realize for kvmclock Hu Tao
2013-07-01 10:18 ` [Qemu-devel] [PATCH v2 24/26] kvmvapic realize Hu Tao
2013-07-01 10:18 ` [Qemu-devel] [PATCH v2 25/26] ioapic: use realize for ioapic Hu Tao
2013-07-21 10:35 ` Andreas Färber
2013-07-01 10:18 ` [Qemu-devel] [PATCH v2 26/26] isa bus: remove isabus_bridge_init since it does nothing Hu Tao
2013-07-21 10:58 ` [Qemu-devel] [PATCH v2 00/26] use realizefn for SysBusDevice, part 1 Andreas Färber
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51ED0844.1060809@suse.de \
--to=afaerber@suse.de \
--cc=agraf@suse.de \
--cc=aliguori@us.ibm.com \
--cc=hutao@cn.fujitsu.com \
--cc=kraxel@redhat.com \
--cc=lcapitulino@redhat.com \
--cc=mst@redhat.com \
--cc=paul@codesourcery.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).