Patchwork [11/17] scsi: Error locations for -drive if=scsi device initialization

login
register
mail settings
Submitter Kevin Wolf
Date July 6, 2010, 3:33 p.m.
Message ID <1278430406-18667-12-git-send-email-kwolf@redhat.com>
Download mbox | patch
Permalink /patch/58036/
State New
Headers show

Comments

Kevin Wolf - July 6, 2010, 3:33 p.m.
From: Markus Armbruster <armbru@redhat.com>

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 hw/scsi-bus.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

Patch

diff --git a/hw/scsi-bus.c b/hw/scsi-bus.c
index b84b9b9..d69c74c 100644
--- a/hw/scsi-bus.c
+++ b/hw/scsi-bus.c
@@ -102,19 +102,23 @@  SCSIDevice *scsi_bus_legacy_add_drive(SCSIBus *bus, BlockDriverState *bdrv, int
 
 int scsi_bus_legacy_handle_cmdline(SCSIBus *bus)
 {
+    Location loc;
     DriveInfo *dinfo;
     int res = 0, unit;
 
+    loc_push_none(&loc);
     for (unit = 0; unit < MAX_SCSI_DEVS; unit++) {
         dinfo = drive_get(IF_SCSI, bus->busnr, unit);
         if (dinfo == NULL) {
             continue;
         }
+        qemu_opts_loc_restore(dinfo->opts);
         if (!scsi_bus_legacy_add_drive(bus, dinfo->bdrv, unit)) {
             res = -1;
             break;
         }
     }
+    loc_pop(&loc);
     return res;
 }