diff options
author | Daniel P. Berrangé <berrange@redhat.com> | 2021-02-22 13:40:56 +0000 |
---|---|---|
committer | Daniel P. Berrangé <berrange@redhat.com> | 2021-03-18 09:22:55 +0000 |
commit | 879be3af49132d232602e0ca783ec9b4112530fa (patch) | |
tree | 527298850da80a21e5df103a84300a716d9cc0d3 /hw | |
parent | b50101833987b47e0740f1621de48637c468c3d1 (diff) | |
download | qemu-879be3af49132d232602e0ca783ec9b4112530fa.zip qemu-879be3af49132d232602e0ca783ec9b4112530fa.tar.gz qemu-879be3af49132d232602e0ca783ec9b4112530fa.tar.bz2 |
hw/scsi: remove 'scsi-disk' device
The 'scsi-hd' and 'scsi-cd' devices provide suitable alternatives.
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/i386/pc.c | 1 | ||||
-rw-r--r-- | hw/scsi/scsi-disk.c | 62 |
2 files changed, 0 insertions, 63 deletions
diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 804913b..35e1770 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -338,7 +338,6 @@ GlobalProperty pc_compat_1_4[] = { PC_CPU_MODEL_IDS("1.4.0") { "scsi-hd", "discard_granularity", "0" }, { "scsi-cd", "discard_granularity", "0" }, - { "scsi-disk", "discard_granularity", "0" }, { "ide-hd", "discard_granularity", "0" }, { "ide-cd", "discard_granularity", "0" }, { "virtio-blk-pci", "discard_granularity", "0" }, diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index 2eaea7e..3580e7e 100644 --- a/hw/scsi/scsi-disk.c +++ b/hw/scsi/scsi-disk.c @@ -2476,28 +2476,6 @@ static void scsi_cd_realize(SCSIDevice *dev, Error **errp) aio_context_release(ctx); } -static void scsi_disk_realize(SCSIDevice *dev, Error **errp) -{ - DriveInfo *dinfo; - Error *local_err = NULL; - - warn_report("'scsi-disk' is deprecated, " - "please use 'scsi-hd' or 'scsi-cd' instead"); - - if (!dev->conf.blk) { - scsi_realize(dev, &local_err); - assert(local_err); - error_propagate(errp, local_err); - return; - } - - dinfo = blk_legacy_dinfo(dev->conf.blk); - if (dinfo && dinfo->media_cd) { - scsi_cd_realize(dev, errp); - } else { - scsi_hd_realize(dev, errp); - } -} static const SCSIReqOps scsi_disk_emulate_reqops = { .size = sizeof(SCSIDiskReq), @@ -3161,45 +3139,6 @@ static const TypeInfo scsi_block_info = { }; #endif -static Property scsi_disk_properties[] = { - DEFINE_SCSI_DISK_PROPERTIES(), - DEFINE_PROP_BIT("removable", SCSIDiskState, features, - SCSI_DISK_F_REMOVABLE, false), - DEFINE_PROP_BIT("dpofua", SCSIDiskState, features, - SCSI_DISK_F_DPOFUA, false), - DEFINE_PROP_UINT64("wwn", SCSIDiskState, qdev.wwn, 0), - DEFINE_PROP_UINT64("port_wwn", SCSIDiskState, qdev.port_wwn, 0), - DEFINE_PROP_UINT16("port_index", SCSIDiskState, port_index, 0), - DEFINE_PROP_UINT64("max_unmap_size", SCSIDiskState, max_unmap_size, - DEFAULT_MAX_UNMAP_SIZE), - DEFINE_PROP_UINT64("max_io_size", SCSIDiskState, max_io_size, - DEFAULT_MAX_IO_SIZE), - DEFINE_PROP_INT32("scsi_version", SCSIDiskState, qdev.default_scsi_version, - 5), - DEFINE_PROP_END_OF_LIST(), -}; - -static void scsi_disk_class_initfn(ObjectClass *klass, void *data) -{ - DeviceClass *dc = DEVICE_CLASS(klass); - SCSIDeviceClass *sc = SCSI_DEVICE_CLASS(klass); - - sc->realize = scsi_disk_realize; - sc->alloc_req = scsi_new_request; - sc->unit_attention_reported = scsi_disk_unit_attention_reported; - dc->fw_name = "disk"; - dc->desc = "virtual SCSI disk or CD-ROM (legacy)"; - dc->reset = scsi_disk_reset; - device_class_set_props(dc, scsi_disk_properties); - dc->vmsd = &vmstate_scsi_disk_state; -} - -static const TypeInfo scsi_disk_info = { - .name = "scsi-disk", - .parent = TYPE_SCSI_DISK_BASE, - .class_init = scsi_disk_class_initfn, -}; - static void scsi_disk_register_types(void) { type_register_static(&scsi_disk_base_info); @@ -3208,7 +3147,6 @@ static void scsi_disk_register_types(void) #ifdef __linux__ type_register_static(&scsi_block_info); #endif - type_register_static(&scsi_disk_info); } type_init(scsi_disk_register_types) |