From caad4eb345dc5119d326b8af08452cc0f90f8548 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Sun, 21 Jul 2013 12:16:34 +0200 Subject: scsi: Improve error propagation for scsi_bus_legacy_handle_cmdline() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- hw/scsi/megasas.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'hw/scsi/megasas.c') diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c index 2ae434683e..eb52164f6d 100644 --- a/hw/scsi/megasas.c +++ b/hw/scsi/megasas.c @@ -2102,6 +2102,7 @@ static int megasas_scsi_init(PCIDevice *dev) MegasasState *s = MEGASAS(dev); uint8_t *pci_conf; int i, bar_type; + Error *err = NULL; pci_conf = dev->config; @@ -2172,7 +2173,11 @@ static int megasas_scsi_init(PCIDevice *dev) scsi_bus_new(&s->bus, DEVICE(dev), &megasas_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) { + error_free(err); + return -1; + } } return 0; } -- cgit v1.2.3