diff options
Diffstat (limited to 'hw')
-rw-r--r-- | hw/scsi/scsi-bus.c | 9 | ||||
-rw-r--r-- | hw/usb/dev-storage.c | 3 |
2 files changed, 10 insertions, 2 deletions
diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c index 965becf..05e501e 100644 --- a/hw/scsi/scsi-bus.c +++ b/hw/scsi/scsi-bus.c @@ -224,6 +224,7 @@ static void scsi_qdev_unrealize(DeviceState *qdev, Error **errp) /* handle legacy '-drive if=scsi,...' cmd line args */ SCSIDevice *scsi_bus_legacy_add_drive(SCSIBus *bus, BlockBackend *blk, int unit, bool removable, int bootindex, + bool share_rw, const char *serial, Error **errp) { const char *driver; @@ -254,6 +255,12 @@ SCSIDevice *scsi_bus_legacy_add_drive(SCSIBus *bus, BlockBackend *blk, object_unparent(OBJECT(dev)); return NULL; } + object_property_set_bool(OBJECT(dev), share_rw, "share-rw", &err); + if (err != NULL) { + error_propagate(errp, err); + object_unparent(OBJECT(dev)); + return NULL; + } object_property_set_bool(OBJECT(dev), true, "realized", &err); if (err != NULL) { error_propagate(errp, err); @@ -288,7 +295,7 @@ void scsi_bus_legacy_handle_cmdline(SCSIBus *bus, bool deprecated) } } scsi_bus_legacy_add_drive(bus, blk_by_legacy_dinfo(dinfo), - unit, false, -1, NULL, &error_fatal); + unit, false, -1, false, NULL, &error_fatal); } loc_pop(&loc); } diff --git a/hw/usb/dev-storage.c b/hw/usb/dev-storage.c index e44a5c7..b56c75a 100644 --- a/hw/usb/dev-storage.c +++ b/hw/usb/dev-storage.c @@ -633,7 +633,8 @@ static void usb_msd_storage_realize(USBDevice *dev, Error **errp) scsi_bus_new(&s->bus, sizeof(s->bus), DEVICE(dev), &usb_msd_scsi_info_storage, NULL); scsi_dev = scsi_bus_legacy_add_drive(&s->bus, blk, 0, !!s->removable, - s->conf.bootindex, dev->serial, + s->conf.bootindex, s->conf.share_rw, + dev->serial, errp); blk_unref(blk); if (!scsi_dev) { |