aboutsummaryrefslogtreecommitdiff
path: root/hw/scsi
diff options
context:
space:
mode:
Diffstat (limited to 'hw/scsi')
-rw-r--r--hw/scsi/lsi53c895a.c7
-rw-r--r--hw/scsi/scsi-bus.c15
-rw-r--r--hw/scsi/spapr_vscsi.c2
3 files changed, 22 insertions, 2 deletions
diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c
index 292fa8795f..595c26017a 100644
--- a/hw/scsi/lsi53c895a.c
+++ b/hw/scsi/lsi53c895a.c
@@ -2268,3 +2268,10 @@ static void lsi53c895a_register_types(void)
}
type_init(lsi53c895a_register_types)
+
+void lsi53c895a_create(PCIBus *bus)
+{
+ LSIState *s = LSI53C895A(pci_create_simple(bus, -1, "lsi53c895a"));
+
+ scsi_bus_legacy_handle_cmdline(&s->bus, false);
+}
diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c
index b9111eea1e..8cc80bf177 100644
--- a/hw/scsi/scsi-bus.c
+++ b/hw/scsi/scsi-bus.c
@@ -261,7 +261,7 @@ SCSIDevice *scsi_bus_legacy_add_drive(SCSIBus *bus, BlockBackend *blk,
return SCSI_DEVICE(dev);
}
-void scsi_bus_legacy_handle_cmdline(SCSIBus *bus)
+void scsi_bus_legacy_handle_cmdline(SCSIBus *bus, bool deprecated)
{
Location loc;
DriveInfo *dinfo;
@@ -274,6 +274,17 @@ void scsi_bus_legacy_handle_cmdline(SCSIBus *bus)
continue;
}
qemu_opts_loc_restore(dinfo->opts);
+ if (deprecated) {
+ /* Handling -drive not claimed by machine initialization */
+ if (blk_get_attached_dev(blk_by_legacy_dinfo(dinfo))) {
+ continue; /* claimed */
+ }
+ if (!dinfo->is_default) {
+ error_report("warning: bus=%d,unit=%d is deprecated with this"
+ " machine type",
+ bus->busnr, unit);
+ }
+ }
scsi_bus_legacy_add_drive(bus, blk_by_legacy_dinfo(dinfo),
unit, false, -1, NULL, &error_fatal);
}
@@ -304,7 +315,7 @@ static int scsi_legacy_handle_cmdline_cb(Object *obj, void *opaque)
SCSIBus *bus = (SCSIBus *)object_dynamic_cast(obj, TYPE_SCSI_BUS);
if (bus && is_scsi_hba_with_legacy_magic(OBJECT(bus->qbus.parent))) {
- scsi_bus_legacy_handle_cmdline(bus);
+ scsi_bus_legacy_handle_cmdline(bus, true);
}
return 0;
diff --git a/hw/scsi/spapr_vscsi.c b/hw/scsi/spapr_vscsi.c
index 7d447718eb..55ee48c4da 100644
--- a/hw/scsi/spapr_vscsi.c
+++ b/hw/scsi/spapr_vscsi.c
@@ -1215,6 +1215,8 @@ void spapr_vscsi_create(VIOsPAPRBus *bus)
dev = qdev_create(&bus->bus, "spapr-vscsi");
qdev_init_nofail(dev);
+ scsi_bus_legacy_handle_cmdline(&VIO_SPAPR_VSCSI_DEVICE(dev)->bus,
+ false);
}
static int spapr_vscsi_devnode(VIOsPAPRDevice *dev, void *fdt, int node_off)