diff options
author | Andreas Färber <afaerber@suse.de> | 2013-07-21 12:16:34 +0200 |
---|---|---|
committer | Andreas Färber <afaerber@suse.de> | 2013-07-23 00:37:35 +0200 |
commit | caad4eb345dc5119d326b8af08452cc0f90f8548 (patch) | |
tree | 3f253049cf4d7807579c5a158f801e65fb6e245b /hw/scsi/esp.c | |
parent | 22d6aa03fd87ba5f219d26bc1810646d0f95842a (diff) |
scsi: Improve error propagation for scsi_bus_legacy_handle_cmdline()
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>
Diffstat (limited to 'hw/scsi/esp.c')
-rw-r--r-- | hw/scsi/esp.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c index c24b6326ce..94639b8391 100644 --- a/hw/scsi/esp.c +++ b/hw/scsi/esp.c @@ -676,6 +676,7 @@ static void sysbus_esp_realize(DeviceState *dev, Error **errp) SysBusDevice *sbd = SYS_BUS_DEVICE(dev); SysBusESPState *sysbus = ESP(dev); ESPState *s = &sysbus->esp; + Error *err = NULL; sysbus_init_irq(sbd, &s->irq); assert(sysbus->it_shift != -1); @@ -688,8 +689,9 @@ static void sysbus_esp_realize(DeviceState *dev, Error **errp) qdev_init_gpio_in(dev, sysbus_esp_gpio_demux, 2); scsi_bus_new(&s->bus, dev, &esp_scsi_info, NULL); - if (scsi_bus_legacy_handle_cmdline(&s->bus) < 0) { - error_setg(errp, "Handling legacy SCSI command line failed"); + scsi_bus_legacy_handle_cmdline(&s->bus, &err); + if (err != NULL) { + error_propagate(errp, err); return; } } |