scsi: deprecate scsi-disk
It's an old compatibility shim that just delegates to scsi-cd or scsi-hd. Just like ide-drive, we don't need this. Acked-by: Peter Krempa <pkrempa@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
2f34ebf222
commit
0d074bf8e7
|
@ -254,8 +254,18 @@ SCSIDevice *scsi_bus_legacy_add_drive(SCSIBus *bus, BlockBackend *blk,
|
||||||
char *name;
|
char *name;
|
||||||
DeviceState *dev;
|
DeviceState *dev;
|
||||||
Error *err = NULL;
|
Error *err = NULL;
|
||||||
|
DriveInfo *dinfo;
|
||||||
|
|
||||||
driver = blk_is_sg(blk) ? "scsi-generic" : "scsi-disk";
|
if (blk_is_sg(blk)) {
|
||||||
|
driver = "scsi-generic";
|
||||||
|
} else {
|
||||||
|
dinfo = blk_legacy_dinfo(blk);
|
||||||
|
if (dinfo && dinfo->media_cd) {
|
||||||
|
driver = "scsi-cd";
|
||||||
|
} else {
|
||||||
|
driver = "scsi-hd";
|
||||||
|
}
|
||||||
|
}
|
||||||
dev = qdev_create(&bus->qbus, driver);
|
dev = qdev_create(&bus->qbus, driver);
|
||||||
name = g_strdup_printf("legacy[%d]", unit);
|
name = g_strdup_printf("legacy[%d]", unit);
|
||||||
object_property_add_child(OBJECT(bus), name, OBJECT(dev), NULL);
|
object_property_add_child(OBJECT(bus), name, OBJECT(dev), NULL);
|
||||||
|
|
|
@ -2481,6 +2481,9 @@ static void scsi_disk_realize(SCSIDevice *dev, Error **errp)
|
||||||
DriveInfo *dinfo;
|
DriveInfo *dinfo;
|
||||||
Error *local_err = NULL;
|
Error *local_err = NULL;
|
||||||
|
|
||||||
|
warn_report("'scsi-disk' is deprecated, "
|
||||||
|
"please use 'scsi-hd' or 'scsi-cd' instead");
|
||||||
|
|
||||||
if (!dev->conf.blk) {
|
if (!dev->conf.blk) {
|
||||||
scsi_realize(dev, &local_err);
|
scsi_realize(dev, &local_err);
|
||||||
assert(local_err);
|
assert(local_err);
|
||||||
|
|
|
@ -259,6 +259,11 @@ their usecases.
|
||||||
The 'ide-drive' device is deprecated. Users should use 'ide-hd' or
|
The 'ide-drive' device is deprecated. Users should use 'ide-hd' or
|
||||||
'ide-cd' as appropriate to get an IDE hard disk or CD-ROM as needed.
|
'ide-cd' as appropriate to get an IDE hard disk or CD-ROM as needed.
|
||||||
|
|
||||||
|
@subsection scsi-disk (since 4.2)
|
||||||
|
|
||||||
|
The 'scsi-disk' device is deprecated. Users should use 'scsi-hd' or
|
||||||
|
'scsi-cd' as appropriate to get a SCSI hard disk or CD-ROM as needed.
|
||||||
|
|
||||||
@section System emulator machines
|
@section System emulator machines
|
||||||
|
|
||||||
@subsection pc-0.12, pc-0.13, pc-0.14 and pc-0.15 (since 4.0)
|
@subsection pc-0.12, pc-0.13, pc-0.14 and pc-0.15 (since 4.0)
|
||||||
|
|
|
@ -167,7 +167,8 @@ QEMU X.Y.Z monitor - type 'help' for more information
|
||||||
|
|
||||||
Testing: -drive if=none,id=disk -device lsi53c895a -device scsi-disk,drive=disk
|
Testing: -drive if=none,id=disk -device lsi53c895a -device scsi-disk,drive=disk
|
||||||
QEMU X.Y.Z monitor - type 'help' for more information
|
QEMU X.Y.Z monitor - type 'help' for more information
|
||||||
(qemu) QEMU_PROG: -device scsi-disk,drive=disk: Device needs media, but drive is empty
|
(qemu) QEMU_PROG: -device scsi-disk,drive=disk: warning: 'scsi-disk' is deprecated, please use 'scsi-hd' or 'scsi-cd' instead
|
||||||
|
QEMU_PROG: -device scsi-disk,drive=disk: Device needs media, but drive is empty
|
||||||
|
|
||||||
Testing: -drive if=none,id=disk -device lsi53c895a -device scsi-hd,drive=disk
|
Testing: -drive if=none,id=disk -device lsi53c895a -device scsi-hd,drive=disk
|
||||||
QEMU X.Y.Z monitor - type 'help' for more information
|
QEMU X.Y.Z monitor - type 'help' for more information
|
||||||
|
@ -238,7 +239,8 @@ QEMU X.Y.Z monitor - type 'help' for more information
|
||||||
|
|
||||||
Testing: -drive file=TEST_DIR/t.qcow2,if=none,id=disk,readonly=on -device lsi53c895a -device scsi-disk,drive=disk
|
Testing: -drive file=TEST_DIR/t.qcow2,if=none,id=disk,readonly=on -device lsi53c895a -device scsi-disk,drive=disk
|
||||||
QEMU X.Y.Z monitor - type 'help' for more information
|
QEMU X.Y.Z monitor - type 'help' for more information
|
||||||
(qemu) quit
|
(qemu) QEMU_PROG: -device scsi-disk,drive=disk: warning: 'scsi-disk' is deprecated, please use 'scsi-hd' or 'scsi-cd' instead
|
||||||
|
quit
|
||||||
|
|
||||||
Testing: -drive file=TEST_DIR/t.qcow2,if=none,id=disk,readonly=on -device lsi53c895a -device scsi-hd,drive=disk
|
Testing: -drive file=TEST_DIR/t.qcow2,if=none,id=disk,readonly=on -device lsi53c895a -device scsi-hd,drive=disk
|
||||||
QEMU X.Y.Z monitor - type 'help' for more information
|
QEMU X.Y.Z monitor - type 'help' for more information
|
||||||
|
|
Loading…
Reference in New Issue