diff mbox series

[10/14] hw/scsi: remove 'scsi-disk' device

Message ID 20210224131142.1952027-11-berrange@redhat.com (mailing list archive)
State New, archived
Headers show
Series deprecations: remove many old deprecations | expand

Commit Message

Daniel P. Berrangé Feb. 24, 2021, 1:11 p.m. UTC
The 'scsi-hd' and 'scsi-cd' devices provide suitable alternatives.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 docs/system/deprecated.rst       |  9 -----
 docs/system/removed-features.rst |  6 ++++
 hw/i386/pc.c                     |  1 -
 hw/scsi/scsi-disk.c              | 62 --------------------------------
 hw/sparc64/sun4u.c               |  1 -
 scripts/device-crash-test        |  1 -
 tests/qemu-iotests/051           |  2 --
 tests/qemu-iotests/051.pc.out    | 10 ------
 8 files changed, 6 insertions(+), 86 deletions(-)

Comments

Thomas Huth Feb. 24, 2021, 2:26 p.m. UTC | #1
On 24/02/2021 14.11, Daniel P. Berrangé wrote:
> The 'scsi-hd' and 'scsi-cd' devices provide suitable alternatives.
> 
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>   docs/system/deprecated.rst       |  9 -----
>   docs/system/removed-features.rst |  6 ++++
>   hw/i386/pc.c                     |  1 -
>   hw/scsi/scsi-disk.c              | 62 --------------------------------
>   hw/sparc64/sun4u.c               |  1 -
>   scripts/device-crash-test        |  1 -
>   tests/qemu-iotests/051           |  2 --
>   tests/qemu-iotests/051.pc.out    | 10 ------
>   8 files changed, 6 insertions(+), 86 deletions(-)

I see some occurrances of "scsi-disk" in the config files in the 
docs/config/ directory, too ... I guess they should also be removed?

> diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c
> index d7c27144ba..cda7df36e3 100644
> --- a/hw/sparc64/sun4u.c
> +++ b/hw/sparc64/sun4u.c
> @@ -749,7 +749,6 @@ static char *sun4u_fw_dev_path(FWPathProvider *p, BusState *bus,
>                                  DeviceState *dev)
>   {
>       PCIDevice *pci;
> -    int bus_id;
>   
>       if (!strcmp(object_get_typename(OBJECT(dev)), "pbm-bridge")) {
>           pci = PCI_DEVICE(dev);

This lonely hunk should be squashed into the previous (ide-disk) patch instead.

  Thomas
Daniel P. Berrangé March 11, 2021, 10:46 a.m. UTC | #2
On Wed, Feb 24, 2021 at 03:26:59PM +0100, Thomas Huth wrote:
> On 24/02/2021 14.11, Daniel P. Berrangé wrote:
> > The 'scsi-hd' and 'scsi-cd' devices provide suitable alternatives.
> > 
> > Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> > ---
> >   docs/system/deprecated.rst       |  9 -----
> >   docs/system/removed-features.rst |  6 ++++
> >   hw/i386/pc.c                     |  1 -
> >   hw/scsi/scsi-disk.c              | 62 --------------------------------
> >   hw/sparc64/sun4u.c               |  1 -
> >   scripts/device-crash-test        |  1 -
> >   tests/qemu-iotests/051           |  2 --
> >   tests/qemu-iotests/051.pc.out    | 10 ------
> >   8 files changed, 6 insertions(+), 86 deletions(-)
> 
> I see some occurrances of "scsi-disk" in the config files in the
> docs/config/ directory, too ... I guess they should also be removed?

Those aren't referring to the "scsi-disk" device type, they are qdev
IDs, and do indeed already use "scsi-hd" as the  device type.

> 
> > diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c
> > index d7c27144ba..cda7df36e3 100644
> > --- a/hw/sparc64/sun4u.c
> > +++ b/hw/sparc64/sun4u.c
> > @@ -749,7 +749,6 @@ static char *sun4u_fw_dev_path(FWPathProvider *p, BusState *bus,
> >                                  DeviceState *dev)
> >   {
> >       PCIDevice *pci;
> > -    int bus_id;
> >       if (!strcmp(object_get_typename(OBJECT(dev)), "pbm-bridge")) {
> >           pci = PCI_DEVICE(dev);
> 
> This lonely hunk should be squashed into the previous (ide-disk) patch instead.
> 
>  Thomas

Regards,
Daniel
Thomas Huth March 15, 2021, 12:21 p.m. UTC | #3
On 24/02/2021 14.11, Daniel P. Berrangé wrote:
> The 'scsi-hd' and 'scsi-cd' devices provide suitable alternatives.
> 
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>   docs/system/deprecated.rst       |  9 -----
>   docs/system/removed-features.rst |  6 ++++
>   hw/i386/pc.c                     |  1 -
>   hw/scsi/scsi-disk.c              | 62 --------------------------------
>   hw/sparc64/sun4u.c               |  1 -
>   scripts/device-crash-test        |  1 -
>   tests/qemu-iotests/051           |  2 --
>   tests/qemu-iotests/051.pc.out    | 10 ------
>   8 files changed, 6 insertions(+), 86 deletions(-)
> 
> diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst
> index f5c82a46dc..cb88fea94f 100644
> --- a/docs/system/deprecated.rst
> +++ b/docs/system/deprecated.rst
> @@ -239,15 +239,6 @@ The ``I7200`` guest CPU relies on the nanoMIPS ISA, which is deprecated
>   (the ISA has never been upstreamed to a compiler toolchain). Therefore
>   this CPU is also deprecated.
>   
> -System emulator devices
> ------------------------
> -
> -``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.
> -
>   System emulator machines
>   ------------------------
>   
> diff --git a/docs/system/removed-features.rst b/docs/system/removed-features.rst
> index 8fd3fafb32..bb6bc8dfc8 100644
> --- a/docs/system/removed-features.rst
> +++ b/docs/system/removed-features.rst
> @@ -222,6 +222,12 @@ System emulator devices
>   The 'ide-drive' device has been removed. Users should use 'ide-hd' or
>   'ide-cd' as appropriate to get an IDE hard disk or CD-ROM as needed.
>   
> +``scsi-disk`` (removed in 6.0)
> +''''''''''''''''''''''''''''''
> +
> +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.

s/is deprecated/has been removed/

> diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c
> index d7c27144ba..cda7df36e3 100644
> --- a/hw/sparc64/sun4u.c
> +++ b/hw/sparc64/sun4u.c
> @@ -749,7 +749,6 @@ static char *sun4u_fw_dev_path(FWPathProvider *p, BusState *bus,
>                                  DeviceState *dev)
>   {
>       PCIDevice *pci;
> -    int bus_id;
>   
>       if (!strcmp(object_get_typename(OBJECT(dev)), "pbm-bridge")) {
>           pci = PCI_DEVICE(dev);

Please squash this hunk into the 'ide-drive' patch instead.

With the two nits fixed:
Reviewed-by: Thomas Huth <thuth@redhat.com>
diff mbox series

Patch

diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst
index f5c82a46dc..cb88fea94f 100644
--- a/docs/system/deprecated.rst
+++ b/docs/system/deprecated.rst
@@ -239,15 +239,6 @@  The ``I7200`` guest CPU relies on the nanoMIPS ISA, which is deprecated
 (the ISA has never been upstreamed to a compiler toolchain). Therefore
 this CPU is also deprecated.
 
-System emulator devices
------------------------
-
-``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.
-
 System emulator machines
 ------------------------
 
diff --git a/docs/system/removed-features.rst b/docs/system/removed-features.rst
index 8fd3fafb32..bb6bc8dfc8 100644
--- a/docs/system/removed-features.rst
+++ b/docs/system/removed-features.rst
@@ -222,6 +222,12 @@  System emulator devices
 The 'ide-drive' device has been removed. Users should use 'ide-hd' or
 'ide-cd' as appropriate to get an IDE hard disk or CD-ROM as needed.
 
+``scsi-disk`` (removed in 6.0)
+''''''''''''''''''''''''''''''
+
+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.
+
 Related binaries
 ----------------
 
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 828122e21e..28a77df0d0 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -339,7 +339,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 ed52fcd49f..2c8f68d3f0 100644
--- a/hw/scsi/scsi-disk.c
+++ b/hw/scsi/scsi-disk.c
@@ -2490,28 +2490,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),
@@ -3131,45 +3109,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);
@@ -3178,7 +3117,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)
diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c
index d7c27144ba..cda7df36e3 100644
--- a/hw/sparc64/sun4u.c
+++ b/hw/sparc64/sun4u.c
@@ -749,7 +749,6 @@  static char *sun4u_fw_dev_path(FWPathProvider *p, BusState *bus,
                                DeviceState *dev)
 {
     PCIDevice *pci;
-    int bus_id;
 
     if (!strcmp(object_get_typename(OBJECT(dev)), "pbm-bridge")) {
         pci = PCI_DEVICE(dev);
diff --git a/scripts/device-crash-test b/scripts/device-crash-test
index 3981209165..6d809ac711 100755
--- a/scripts/device-crash-test
+++ b/scripts/device-crash-test
@@ -93,7 +93,6 @@  ERROR_RULE_LIST = [
     {'device':'pci-bridge-seat', 'expected':True},         # Bridge chassis not specified. Each bridge is required to be assigned a unique chassis id > 0.
     {'device':'pxb', 'expected':True},                     # Bridge chassis not specified. Each bridge is required to be assigned a unique chassis id > 0.
     {'device':'scsi-block', 'expected':True},              # drive property not set
-    {'device':'scsi-disk', 'expected':True},               # drive property not set
     {'device':'scsi-generic', 'expected':True},            # drive property not set
     {'device':'scsi-hd', 'expected':True},                 # drive property not set
     {'device':'spapr-pci-host-bridge', 'expected':True},   # BUID not specified for PHB
diff --git a/tests/qemu-iotests/051 b/tests/qemu-iotests/051
index 8b334fe41d..f92161d8ef 100755
--- a/tests/qemu-iotests/051
+++ b/tests/qemu-iotests/051
@@ -186,7 +186,6 @@  case "$QEMU_DEFAULT_MACHINE" in
         run_qemu -drive if=none,id=disk -device ide-cd,drive=disk
         run_qemu -drive if=none,id=disk -device lsi53c895a -device scsi-cd,drive=disk
         run_qemu -drive if=none,id=disk -device ide-hd,drive=disk
-        run_qemu -drive if=none,id=disk -device lsi53c895a -device scsi-disk,drive=disk
         run_qemu -drive if=none,id=disk -device lsi53c895a -device scsi-hd,drive=disk
         ;;
      *)
@@ -238,7 +237,6 @@  case "$QEMU_DEFAULT_MACHINE" in
         run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device ide-cd,drive=disk
         run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device lsi53c895a -device scsi-cd,drive=disk
         run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device ide-hd,drive=disk
-        run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device lsi53c895a -device scsi-disk,drive=disk
         run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device lsi53c895a -device scsi-hd,drive=disk
         ;;
      *)
diff --git a/tests/qemu-iotests/051.pc.out b/tests/qemu-iotests/051.pc.out
index 2e23a4caa0..845fe0149f 100644
--- a/tests/qemu-iotests/051.pc.out
+++ b/tests/qemu-iotests/051.pc.out
@@ -160,11 +160,6 @@  Testing: -drive if=none,id=disk -device ide-hd,drive=disk
 QEMU X.Y.Z monitor - type 'help' for more information
 (qemu) QEMU_PROG: -device ide-hd,drive=disk: Device needs media, but drive is empty
 
-Testing: -drive if=none,id=disk -device lsi53c895a -device scsi-disk,drive=disk
-QEMU X.Y.Z monitor - type 'help' for more information
-(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
 QEMU X.Y.Z monitor - type 'help' for more information
 (qemu) QEMU_PROG: -device scsi-hd,drive=disk: Device needs media, but drive is empty
@@ -227,11 +222,6 @@  Testing: -drive file=TEST_DIR/t.qcow2,if=none,id=disk,readonly=on -device ide-hd
 QEMU X.Y.Z monitor - type 'help' for more information
 (qemu) QEMU_PROG: -device ide-hd,drive=disk: Block node is read-only
 
-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) 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
 QEMU X.Y.Z monitor - type 'help' for more information
 (qemu) quit