@@ -90,7 +90,8 @@ SCSIDevice *scsi_bus_legacy_add_drive(SCSIBus *bus, DriveInfo *dinfo, int unit)
const char *driver;
DeviceState *dev;
- driver = bdrv_is_sg(dinfo->bdrv) ? "scsi-generic" : "scsi-disk";
+ driver = bdrv_is_bsg(dinfo->bdrv) ? "scsi-bsg" :
+ bdrv_is_sg(dinfo->bdrv) ? "scsi-generic" : "scsi-disk";
dev = qdev_create(&bus->qbus, driver);
qdev_prop_set_uint32(dev, "scsi-id", unit);
qdev_prop_set_drive(dev, "drive", dinfo);
@@ -704,6 +704,10 @@ static int scsi_disk_initfn(SCSIDevice *dev)
error_report("scsi-disk: unwanted /dev/sg*");
return -1;
}
+ if (bdrv_is_bsg(s->bs)) {
+ error_report("scsi-disk: unwanted BSG");
+ return -1;
+ }
if (bdrv_get_type_hint(s->bs) == BDRV_TYPE_CDROM) {
s->qdev.blocksize = 2048;