Skip to contentSkip to conversation

Remove the deprecated pc-1.x machine types and related stuff

PATCH Applied Thomas Huth 7 participants 17 messages Feb 3, 2021 – Feb 15, 2021

lore
Share & tools
lore
#0 lore raw

cover Remove the deprecated pc-1.x machine types and related stuff

The pc-1.x machine types have been deprecated since QEMU v5.0 already, and nobody complained, so they can now be removed. While we're at it, also remove some compatibility switches and related code that are now not necessary anymore after these machine types have been removed. (We could maybe even remove more stuff like the various host_features switches in the virtio devices, but they still might be useful in certain cases, so I decided not to remove them yet)

Thomas Huth (4):
hw/i386: Remove the deprecated pc-1.x machine types hw/block/fdc: Remove the check_media_rate property hw/virtio/virtio-balloon: Remove the "class" property hw/usb/bus: Remove the "full-path" property

 docs/system/deprecated.rst       |  6 --
 docs/system/removed-features.rst |  6 ++
 hw/block/fdc.c                   | 17 +-----
 hw/i386/pc_piix.c                | 94 --------------------------------
 hw/usb/bus.c                     |  7 +--
 hw/virtio/virtio-balloon-pci.c   | 11 +---
 include/hw/usb.h                 |  2 +-
 tests/qemu-iotests/172.out       | 35 ------------
 8 files changed, 11 insertions(+), 167 deletions(-)
Signature · 1 line
2.27.0
#1 lore raw

PATCH 1/4 hw/i386: Remove the deprecated pc-1.x machine types

They have been deprecated since QEMU v5.0, time to remove them now.

---
 docs/system/deprecated.rst       |  6 --
 docs/system/removed-features.rst |  6 ++
 hw/i386/pc_piix.c                | 94 --------------------------------
 3 files changed, 6 insertions(+), 100 deletions(-)
docs/system/deprecated.rst +0 -6
index 6ac757ed9f..2fcac7861e 100644
@@ -322,12 +322,6 @@ The 'scsi-disk' device is deprecated. Users should use 'scsi-hd' or
 System emulator machines
 ------------------------
 
-``pc-1.0``, ``pc-1.1``, ``pc-1.2`` and ``pc-1.3`` (since 5.0)
-'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
-
-These machine types are very old and likely can not be used for live migration
-from old QEMU versions anymore. A newer machine type should be used instead.
-
 Raspberry Pi ``raspi2`` and ``raspi3`` machines (since 5.2)
 '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
 
docs/system/removed-features.rst +6 -0
index 88b81a6156..c8481cafbd 100644
@@ -136,6 +136,12 @@ mips ``fulong2e`` machine alias (removed in 6.0)
 
 This machine has been renamed ``fuloong2e``.
 
+``pc-1.0``, ``pc-1.1``, ``pc-1.2`` and ``pc-1.3`` (removed in 6.0)
+''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
+
+These machine types were very old and likely could not be used for live
+migration from old QEMU versions anymore. Use a newer machine type instead.
+
 Related binaries
 ----------------
 
hw/i386/pc_piix.c +0 -94

106 lines not on this page · raw message

Signature · 1 line
2.27.0
Reviewed-by on v1 1/4
#2 lore raw

Re: [PATCH 1/4] hw/i386: Remove the deprecated pc-1.x machine types

Quoted 8 lines · Thomas Huth

They have been deprecated since QEMU v5.0, time to remove them now.

---
 docs/system/deprecated.rst       |  6 --
 docs/system/removed-features.rst |  6 ++
 hw/i386/pc_piix.c                | 94 --------------------------------
 3 files changed, 6 insertions(+), 100 deletions(-)

Ack from libvirt side,

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#3 lore raw

PATCH 2/4 hw/block/fdc: Remove the check_media_rate property

In reply to Thomas Huth

This was only required for the pc-1.0 and earlier machine types. Now that these have been removed, we can also drop the corresponding code from the FDC device.

---
 hw/block/fdc.c             | 17 ++---------------
 tests/qemu-iotests/172.out | 35 -----------------------------------
 2 files changed, 2 insertions(+), 50 deletions(-)
hw/block/fdc.c +2 -15
index 292ea87805..198940e737 100644
@@ -874,7 +874,6 @@ struct FDCtrl {
         FloppyDriveType type;
     } qdev_for_drives[MAX_FD];
     int reset_sensei;
-    uint32_t check_media_rate;
     FloppyDriveType fallback; /* type=auto failure fallback */
     /* Timers state */
     uint8_t timer0;
@@ -1021,18 +1020,10 @@ static const VMStateDescription vmstate_fdrive_media_changed = {
     }
 };
 
-static bool fdrive_media_rate_needed(void *opaque)
-{
-    FDrive *drive = opaque;
-
-    return drive->fdctrl->check_media_rate;
-}
-
 static const VMStateDescription vmstate_fdrive_media_rate = {
     .name = "fdrive/media_rate",
     .version_id = 1,
     .minimum_version_id = 1,
-    .needed = fdrive_media_rate_needed,
     .fields = (VMStateField[]) {
         VMSTATE_UINT8(media_rate, FDrive),
         VMSTATE_END_OF_LIST()
@@ -1689,8 +1680,7 @@ static void fdctrl_start_transfer(FDCtrl *fdctrl, int direction)
 
     /* Check the data rate. If the programmed data rate does not match
      * the currently inserted medium, the operation has to fail. */
-    if (fdctrl->check_media_rate &&
-        (fdctrl->dsr & FD_DSR_DRATEMASK) != cur_drv->media_rate) {
+    if ((fdctrl->dsr & FD_DSR_DRATEMASK) != cur_drv->media_rate) {
         FLOPPY_DPRINTF("data rate mismatch (fdc=%d, media=%d)\n",
                        fdctrl->dsr & FD_DSR_DRATEMASK, cur_drv->media_rate);
         fdctrl_stop_transfer(fdctrl, FD_SR0_ABNTERM, FD_SR1_MA, 0x00);
@@ -2489,8 +2479,7 @@ static void fdctrl_result_timer(void *opaque)
         cur_drv->sect = (cur_drv->sect % cur_drv->last_sect) + 1;
     }
     /* READ_ID can't automatically succeed! */
-    if (fdctrl->check_media_rate &&
-        (fdctrl->dsr & FD_DSR_DRATEMASK) != cur_drv->media_rate) {
+    if ((fdctrl->dsr & FD_DSR_DRATEMASK) != cur_drv->media_rate) {
         FLOPPY_DPRINTF("read id rate mismatch (fdc=%d, media=%d)\n",
                        fdctrl->dsr & FD_DSR_DRATEMASK, cur_drv->media_rate);
         fdctrl_stop_transfer(fdctrl, FD_SR0_ABNTERM, FD_SR1_MA, 0x00);
@@ -2895,8 +2884,6 @@ static Property isa_fdc_properties[] = {
     DEFINE_PROP_UINT32("dma", FDCtrlISABus, dma, 2),
     DEFINE_PROP_DRIVE("driveA", FDCtrlISABus, state.qdev_for_drives[0].blk),
     DEFINE_PROP_DRIVE("driveB", FDCtrlISABus, state.qdev_for_drives[1].blk),
-    DEFINE_PROP_BIT("check_media_rate", FDCtrlISABus, state.check_media_rate,
-                    0, true),
     DEFINE_PROP_SIGNED("fdtypeA", FDCtrlISABus, state.qdev_for_drives[0].type,
                         FLOPPY_DRIVE_TYPE_AUTO, qdev_prop_fdc_drive_type,
                         FloppyDriveType),
tests/qemu-iotests/172.out +0 -35
index 2cd4a8fd83..349ae51d6c 100644
@@ -14,7 +14,6 @@ Testing:
             dma = 2 (0x2)
             driveA = ""
             driveB = ""
-            check_media_rate = true
             fdtypeA = "auto"
             fdtypeB = "auto"
             fallback = "288"
@@ -44,7 +43,6 @@ Testing: -fda TEST_DIR/t.qcow2
             dma = 2 (0x2)
             driveA = ""
             driveB = ""
-            check_media_rate = true
             fdtypeA = "auto"
             fdtypeB = "auto"
             fallback = "288"
@@ -84,7 +82,6 @@ Testing: -fdb TEST_DIR/t.qcow2
             dma = 2 (0x2)
             driveA = ""
             driveB = ""
-            check_media_rate = true
             fdtypeA = "auto"
             fdtypeB = "auto"
             fallback = "288"
@@ -139,7 +136,6 @@ Testing: -fda TEST_DIR/t.qcow2 -fdb TEST_DIR/t.qcow2.2
             dma = 2 (0x2)
             driveA = ""
             driveB = ""
-            check_media_rate = true
             fdtypeA = "auto"
             fdtypeB = "auto"
             fallback = "288"
@@ -195,7 +191,6 @@ Testing: -fdb
             dma = 2 (0x2)
             driveA = ""
             driveB = ""
-            check_media_rate = true
             fdtypeA = "auto"
             fdtypeB = "auto"
             fallback = "288"
@@ -236,7 +231,6 @@ Testing: -drive if=floppy,file=TEST_DIR/t.qcow2
             dma = 2 (0x2)
             driveA = ""
             driveB = ""
-            check_media_rate = true
             fdtypeA = "auto"
             fdtypeB = "auto"
             fallback = "288"
@@ -276,7 +270,6 @@ Testing: -drive if=floppy,file=TEST_DIR/t.qcow2,index=1
             dma = 2 (0x2)
             driveA = ""
             driveB = ""
-            check_media_rate = true
             fdtypeA = "auto"
             fdtypeB = "auto"
             fallback = "288"
@@ -331,7 +324,6 @@ Testing: -drive if=floppy,file=TEST_DIR/t.qcow2 -drive if=floppy,file=TEST_DIR/t
             dma = 2 (0x2)
             driveA = ""
             driveB = ""
-            check_media_rate = true
             fdtypeA = "auto"
             fdtypeB = "auto"
             fallback = "288"
@@ -392,7 +384,6 @@ Use -device floppy,unit=0,drive=... instead.
             dma = 2 (0x2)
             driveA = ""
             driveB = ""
-            check_media_rate = true
             fdtypeA = "auto"
             fdtypeB = "auto"
             fallback = "288"
@@ -434,7 +425,6 @@ Use -device floppy,unit=1,drive=... instead.
             dma = 2 (0x2)
             driveA = ""
             driveB = ""
-            check_media_rate = true
             fdtypeA = "auto"
             fdtypeB = "auto"
             fallback = "288"
@@ -478,7 +468,6 @@ Use -device floppy,unit=1,drive=... instead.
             dma = 2 (0x2)
             driveA = ""
             driveB = ""
-            check_media_rate = true
             fdtypeA = "auto"
             fdtypeB = "auto"
             fallback = "288"
@@ -537,7 +526,6 @@ Testing: -drive if=none,file=TEST_DIR/t.qcow2 -device floppy,drive=none0
             dma = 2 (0x2)
             driveA = ""
             driveB = ""
-            check_media_rate = true
             fdtypeA = "auto"
             fdtypeB = "auto"
             fallback = "288"
@@ -577,7 +565,6 @@ Testing: -drive if=none,file=TEST_DIR/t.qcow2 -device floppy,drive=none0,unit=1
             dma = 2 (0x2)
             driveA = ""
             driveB = ""
-            check_media_rate = true
             fdtypeA = "auto"
             fdtypeB = "auto"
             fallback = "288"
@@ -617,7 +604,6 @@ Testing: -drive if=none,file=TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.qco
             dma = 2 (0x2)
             driveA = ""
             driveB = ""
-            check_media_rate = true
             fdtypeA = "auto"
             fdtypeB = "auto"
             fallback = "288"
@@ -678,7 +664,6 @@ Use -device floppy,unit=1,drive=... instead.
             dma = 2 (0x2)
             driveA = ""
             driveB = ""
-            check_media_rate = true
             fdtypeA = "auto"
             fdtypeB = "auto"
             fallback = "288"
@@ -736,7 +721,6 @@ Use -device floppy,unit=0,drive=... instead.
             dma = 2 (0x2)
             driveA = ""
             driveB = ""
-            check_media_rate = true
             fdtypeA = "auto"
             fdtypeB = "auto"
             fallback = "288"
@@ -808,7 +792,6 @@ Testing: -fda TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.qcow2.2 -device fl
             dma = 2 (0x2)
             driveA = ""
             driveB = ""
-            check_media_rate = true
             fdtypeA = "auto"
             fdtypeB = "auto"
             fallback = "288"
@@ -864,7 +847,6 @@ Testing: -fda TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.qcow2.2 -device fl
             dma = 2 (0x2)
             driveA = ""
             driveB = ""
-            check_media_rate = true
             fdtypeA = "auto"
             fdtypeB = "auto"
             fallback = "288"
@@ -920,7 +902,6 @@ Testing: -fdb TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.qcow2.2 -device fl
             dma = 2 (0x2)
             driveA = ""
             driveB = ""
-            check_media_rate = true
             fdtypeA = "auto"
             fdtypeB = "auto"
             fallback = "288"
@@ -976,7 +957,6 @@ Testing: -fdb TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.qcow2.2 -device fl
             dma = 2 (0x2)
             driveA = ""
             driveB = ""
-            check_media_rate = true
             fdtypeA = "auto"
             fdtypeB = "auto"
             fallback = "288"
@@ -1041,7 +1021,6 @@ Testing: -drive if=floppy,file=TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.q
             dma = 2 (0x2)
             driveA = ""
             driveB = ""
-            check_media_rate = true
             fdtypeA = "auto"
             fdtypeB = "auto"
             fallback = "288"
@@ -1097,7 +1076,6 @@ Testing: -drive if=floppy,file=TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.q
             dma = 2 (0x2)
             driveA = ""
             driveB = ""
-            check_media_rate = true
             fdtypeA = "auto"
             fdtypeB = "auto"
             fallback = "288"
@@ -1161,7 +1139,6 @@ Use -device floppy,unit=0,drive=... instead.
             dma = 2 (0x2)
             driveA = ""
             driveB = ""
-            check_media_rate = true
             fdtypeA = "auto"
             fdtypeB = "auto"
             fallback = "288"
@@ -1219,7 +1196,6 @@ Use -device floppy,unit=0,drive=... instead.
             dma = 2 (0x2)
             driveA = ""
             driveB = ""
-            check_media_rate = true
             fdtypeA = "auto"
             fdtypeB = "auto"
             fallback = "288"
@@ -1277,7 +1253,6 @@ Use -device floppy,unit=1,drive=... instead.
             dma = 2 (0x2)
             driveA = ""
             driveB = ""
-            check_media_rate = true
             fdtypeA = "auto"
             fdtypeB = "auto"
             fallback = "288"
@@ -1335,7 +1310,6 @@ Use -device floppy,unit=1,drive=... instead.
             dma = 2 (0x2)
             driveA = ""
             driveB = ""
-            check_media_rate = true
             fdtypeA = "auto"
             fdtypeB = "auto"
             fallback = "288"
@@ -1391,7 +1365,6 @@ Testing: -drive if=none,file=TEST_DIR/t.qcow2 -global floppy.drive=none0 -device
             dma = 2 (0x2)
             driveA = ""
             driveB = ""
-            check_media_rate = true
             fdtypeA = "auto"
             fdtypeB = "auto"
             fallback = "288"
@@ -1473,7 +1446,6 @@ Testing: -device floppy
             dma = 2 (0x2)
             driveA = ""
             driveB = ""
-            check_media_rate = true
             fdtypeA = "auto"
             fdtypeB = "auto"
             fallback = "288"
@@ -1500,7 +1472,6 @@ Testing: -device floppy,drive-type=120
             dma = 2 (0x2)
             driveA = ""
             driveB = ""
-            check_media_rate = true
             fdtypeA = "auto"
             fdtypeB = "auto"
             fallback = "288"
@@ -1527,7 +1498,6 @@ Testing: -device floppy,drive-type=144
             dma = 2 (0x2)
             driveA = ""
             driveB = ""
-            check_media_rate = true
             fdtypeA = "auto"
             fdtypeB = "auto"
             fallback = "288"
@@ -1554,7 +1524,6 @@ Testing: -device floppy,drive-type=288
             dma = 2 (0x2)
             driveA = ""
             driveB = ""
-            check_media_rate = true
             fdtypeA = "auto"
             fdtypeB = "auto"
             fallback = "288"
@@ -1584,7 +1553,6 @@ Testing: -drive if=none,file=TEST_DIR/t.qcow2 -device floppy,drive=none0,drive-t
             dma = 2 (0x2)
             driveA = ""
             driveB = ""
-            check_media_rate = true
             fdtypeA = "auto"
             fdtypeB = "auto"
             fallback = "288"
@@ -1624,7 +1592,6 @@ Testing: -drive if=none,file=TEST_DIR/t.qcow2 -device floppy,drive=none0,drive-t
             dma = 2 (0x2)
             driveA = ""
             driveB = ""
-            check_media_rate = true
             fdtypeA = "auto"
             fdtypeB = "auto"
             fallback = "288"
@@ -1667,7 +1634,6 @@ Testing: -drive if=none,file=TEST_DIR/t.qcow2 -device floppy,drive=none0,logical
             dma = 2 (0x2)
             driveA = ""
             driveB = ""
-            check_media_rate = true
             fdtypeA = "auto"
             fdtypeB = "auto"
             fallback = "288"
@@ -1707,7 +1673,6 @@ Testing: -drive if=none,file=TEST_DIR/t.qcow2 -device floppy,drive=none0,physica
             dma = 2 (0x2)
             driveA = ""
             driveB = ""
-            check_media_rate = true
             fdtypeA = "auto"
             fdtypeB = "auto"
             fallback = "288"
Signature · 1 line
2.27.0
#4 lore raw

Re: [PATCH 2/4] hw/block/fdc: Remove the check_media_rate property

Quoted 15 lines · Thomas Huth

This was only required for the pc-1.0 and earlier machine types. Now that these have been removed, we can also drop the corresponding code from the FDC device.

---
  hw/block/fdc.c             | 17 ++---------------
  tests/qemu-iotests/172.out | 35 -----------------------------------
  2 files changed, 2 insertions(+), 50 deletions(-)
hw/block/fdc.c +0 -0
index 292ea87805..198940e737 100644

hw/block/fdc.c struct FDCtrl { · line 877

Quoted 4 lines
hw/block/fdc.c +0 -1
@@ -874,7 +874,6 @@ struct FDCtrl {
          FloppyDriveType type;
      } qdev_for_drives[MAX_FD];
      int reset_sensei;
-    uint32_t check_media_rate;

I am a bit of a dunce when it comes to the compatibility properties... does this mess with the migration format?

I guess it doesn't, since it's not in the VMSTATE declaration.

Hmmmm, alright.

Quoted 43 lines
hw/block/fdc.c +2 -12
      FloppyDriveType fallback; /* type=auto failure fallback */
      /* Timers state */
      uint8_t timer0;
@@ -1021,18 +1020,10 @@ static const VMStateDescription vmstate_fdrive_media_changed = {
      }
  };
 
-static bool fdrive_media_rate_needed(void *opaque)
-{
-    FDrive *drive = opaque;
-
-    return drive->fdctrl->check_media_rate;
-}
-
  static const VMStateDescription vmstate_fdrive_media_rate = {
      .name = "fdrive/media_rate",
      .version_id = 1,
      .minimum_version_id = 1,
-    .needed = fdrive_media_rate_needed,
      .fields = (VMStateField[]) {
          VMSTATE_UINT8(media_rate, FDrive),
          VMSTATE_END_OF_LIST()
@@ -1689,8 +1680,7 @@ static void fdctrl_start_transfer(FDCtrl *fdctrl, int direction)
 
      /* Check the data rate. If the programmed data rate does not match
       * the currently inserted medium, the operation has to fail. */
-    if (fdctrl->check_media_rate &&
-        (fdctrl->dsr & FD_DSR_DRATEMASK) != cur_drv->media_rate) {
+    if ((fdctrl->dsr & FD_DSR_DRATEMASK) != cur_drv->media_rate) {
          FLOPPY_DPRINTF("data rate mismatch (fdc=%d, media=%d)\n",
                         fdctrl->dsr & FD_DSR_DRATEMASK, cur_drv->media_rate);
          fdctrl_stop_transfer(fdctrl, FD_SR0_ABNTERM, FD_SR1_MA, 0x00);
@@ -2489,8 +2479,7 @@ static void fdctrl_result_timer(void *opaque)
          cur_drv->sect = (cur_drv->sect % cur_drv->last_sect) + 1;
      }
      /* READ_ID can't automatically succeed! */
-    if (fdctrl->check_media_rate &&
-        (fdctrl->dsr & FD_DSR_DRATEMASK) != cur_drv->media_rate) {
+    if ((fdctrl->dsr & FD_DSR_DRATEMASK) != cur_drv->media_rate) {
          FLOPPY_DPRINTF("read id rate mismatch (fdc=%d, media=%d)\n",
                         fdctrl->dsr & FD_DSR_DRATEMASK, cur_drv->media_rate);
          fdctrl_stop_transfer(fdctrl, FD_SR0_ABNTERM, FD_SR1_MA, 0x00);

hw/block/fdc.c static Property isa_fdc_properties[] = { · line 2899

Quoted 5 lines
hw/block/fdc.c +0 -2
@@ -2895,8 +2884,6 @@ static Property isa_fdc_properties[] = {
      DEFINE_PROP_UINT32("dma", FDCtrlISABus, dma, 2),
      DEFINE_PROP_DRIVE("driveA", FDCtrlISABus, state.qdev_for_drives[0].blk),
      DEFINE_PROP_DRIVE("driveB", FDCtrlISABus, state.qdev_for_drives[1].blk),
-    DEFINE_PROP_BIT("check_media_rate", FDCtrlISABus, state.check_media_rate,
-                    0, true),

Could you theoretically set this via QOM commands in QMP, and claim that this is a break in behavior?

Though, it's ENTIRELY undocumented, so ... it's probably fine, I think. Probably. (Please soothe my troubled mind.)

--js

#5 lore raw

Re: [PATCH 2/4] hw/block/fdc: Remove the check_media_rate property

Quoted 23 lines · John Snow
Quoted 15 lines · Thomas Huth

This was only required for the pc-1.0 and earlier machine types. Now that these have been removed, we can also drop the corresponding code from the FDC device.

---
  hw/block/fdc.c             | 17 ++--------------- tests/qemu-iotests/172.out | 35 -----------------------------------

  2 files changed, 2 insertions(+), 50 deletions(-)
hw/block/fdc.c +0 -0
index 292ea87805..198940e737 100644

hw/block/fdc.c struct FDCtrl { · line 877

Quoted 4 lines
hw/block/fdc.c +0 -1
@@ -874,7 +874,6 @@ struct FDCtrl {
           FloppyDriveType type;
       } qdev_for_drives[MAX_FD];
       int reset_sensei;
-    uint32_t check_media_rate;

I am a bit of a dunce when it comes to the compatibility properties... does this mess with the migration format?

Quoted 3 lines

I guess it doesn't, since it's not in the VMSTATE declaration.

Hmmmm, alright.

I think that should be fine, yes.

Quoted 52 lines
Quoted 43 lines

      FloppyDriveType fallback; /* type=auto failure fallback */ /* Timers state */
      uint8_t timer0;

hw/block/fdc.c +2 -12
@@ -1021,18 +1020,10 @@ static const VMStateDescription 
 vmstate_fdrive_media_changed = {
       }
   };
-static bool fdrive_media_rate_needed(void *opaque)
-{
-    FDrive *drive = opaque;
-
-    return drive->fdctrl->check_media_rate;
-}
-
   static const VMStateDescription vmstate_fdrive_media_rate = {
       .name = "fdrive/media_rate",
       .version_id = 1,
       .minimum_version_id = 1,
-    .needed = fdrive_media_rate_needed,
       .fields = (VMStateField[]) {
           VMSTATE_UINT8(media_rate, FDrive),
           VMSTATE_END_OF_LIST()
@@ -1689,8 +1680,7 @@ static void fdctrl_start_transfer(FDCtrl *fdctrl, 
 int direction)
       /* Check the data rate. If the programmed data rate does not match
        * the currently inserted medium, the operation has to fail. */
-    if (fdctrl->check_media_rate &&
-        (fdctrl->dsr & FD_DSR_DRATEMASK) != cur_drv->media_rate) {
+    if ((fdctrl->dsr & FD_DSR_DRATEMASK) != cur_drv->media_rate) {
           FLOPPY_DPRINTF("data rate mismatch (fdc=%d, media=%d)\n",
                          fdctrl->dsr & FD_DSR_DRATEMASK, cur_drv->media_rate);
           fdctrl_stop_transfer(fdctrl, FD_SR0_ABNTERM, FD_SR1_MA, 0x00);
@@ -2489,8 +2479,7 @@ static void fdctrl_result_timer(void *opaque)
           cur_drv->sect = (cur_drv->sect % cur_drv->last_sect) + 1;
       }
       /* READ_ID can't automatically succeed! */
-    if (fdctrl->check_media_rate &&
-        (fdctrl->dsr & FD_DSR_DRATEMASK) != cur_drv->media_rate) {
+    if ((fdctrl->dsr & FD_DSR_DRATEMASK) != cur_drv->media_rate) {
           FLOPPY_DPRINTF("read id rate mismatch (fdc=%d, media=%d)\n",
                          fdctrl->dsr & FD_DSR_DRATEMASK, cur_drv->media_rate);
           fdctrl_stop_transfer(fdctrl, FD_SR0_ABNTERM, FD_SR1_MA, 0x00);

hw/block/fdc.c static Property isa_fdc_properties[] = { · line 2900

Quoted 6 lines
hw/block/fdc.c +0 -2
@@ -2895,8 +2884,6 @@ static Property isa_fdc_properties[] = {
       DEFINE_PROP_UINT32("dma", FDCtrlISABus, dma, 2),
       DEFINE_PROP_DRIVE("driveA", FDCtrlISABus, state.qdev_for_drives[0].blk),
       DEFINE_PROP_DRIVE("driveB", FDCtrlISABus, state.qdev_for_drives[1].blk),
-    DEFINE_PROP_BIT("check_media_rate", FDCtrlISABus, 
 state.check_media_rate,
-                    0, true),

Could you theoretically set this via QOM commands in QMP, and claim that this is a break in behavior?

Quoted 1 line

Though, it's ENTIRELY undocumented, so ... it's probably fine, I think. Probably. (Please soothe my troubled mind.)

A user actually could mess with this property even on the command line, e.g. by using:

qemu-system-x86_64 -global isa-fdc.check_media_rate=false

... but, as you said, it's completely undocumented, the property is really just there for the internal use of machine type compatibility. We've done such clean-ups in the past already, see e.g. c6026998eef382d7ad76 or 2a4dbaf1c0db2453ab78f, so I think this should be fine. But if you disagree, I could replace this by a patch that adds this property to the list of deprecated features instead, so we could at least remove it after it has been deprecated for two releases?

Thomas

Reviewed-by Acked-by
#6 lore raw

Re: [PATCH 2/4] hw/block/fdc: Remove the check_media_rate property

Quoted 82 lines · Thomas Huth
Quoted 23 lines · John Snow
Quoted 15 lines · Thomas Huth

This was only required for the pc-1.0 and earlier machine types. Now that these have been removed, we can also drop the corresponding code from the FDC device.

---
  hw/block/fdc.c             | 17 ++--------------- tests/qemu-iotests/172.out | 35 -----------------------------------

  2 files changed, 2 insertions(+), 50 deletions(-)
hw/block/fdc.c +0 -0
index 292ea87805..198940e737 100644

hw/block/fdc.c struct FDCtrl { · line 877

Quoted 4 lines
hw/block/fdc.c +0 -1
@@ -874,7 +874,6 @@ struct FDCtrl {
           FloppyDriveType type;
       } qdev_for_drives[MAX_FD];
       int reset_sensei;
-    uint32_t check_media_rate;

I am a bit of a dunce when it comes to the compatibility properties... does this mess with the migration format?

Quoted 3 lines

I guess it doesn't, since it's not in the VMSTATE declaration.

Hmmmm, alright.

I think that should be fine, yes.

Quoted 52 lines
Quoted 43 lines

      FloppyDriveType fallback; /* type=auto failure fallback */ /* Timers state */
      uint8_t timer0;

hw/block/fdc.c +2 -12
@@ -1021,18 +1020,10 @@ static const VMStateDescription 
 vmstate_fdrive_media_changed = {
       }
   };
-static bool fdrive_media_rate_needed(void *opaque)
-{
-    FDrive *drive = opaque;
-
-    return drive->fdctrl->check_media_rate;
-}
-
   static const VMStateDescription vmstate_fdrive_media_rate = {
       .name = "fdrive/media_rate",
       .version_id = 1,
       .minimum_version_id = 1,
-    .needed = fdrive_media_rate_needed,
       .fields = (VMStateField[]) {
           VMSTATE_UINT8(media_rate, FDrive),
           VMSTATE_END_OF_LIST()
@@ -1689,8 +1680,7 @@ static void fdctrl_start_transfer(FDCtrl 
 *fdctrl, int direction)
       /* Check the data rate. If the programmed data rate does not match
        * the currently inserted medium, the operation has to fail. */
-    if (fdctrl->check_media_rate &&
-        (fdctrl->dsr & FD_DSR_DRATEMASK) != cur_drv->media_rate) {
+    if ((fdctrl->dsr & FD_DSR_DRATEMASK) != cur_drv->media_rate) {
           FLOPPY_DPRINTF("data rate mismatch (fdc=%d, media=%d)\n",
                          fdctrl->dsr & FD_DSR_DRATEMASK, cur_drv->media_rate);
           fdctrl_stop_transfer(fdctrl, FD_SR0_ABNTERM, FD_SR1_MA, 0x00);
@@ -2489,8 +2479,7 @@ static void fdctrl_result_timer(void *opaque)
           cur_drv->sect = (cur_drv->sect % cur_drv->last_sect) + 1;
       }
       /* READ_ID can't automatically succeed! */
-    if (fdctrl->check_media_rate &&
-        (fdctrl->dsr & FD_DSR_DRATEMASK) != cur_drv->media_rate) {
+    if ((fdctrl->dsr & FD_DSR_DRATEMASK) != cur_drv->media_rate) {
           FLOPPY_DPRINTF("read id rate mismatch (fdc=%d, media=%d)\n",
                          fdctrl->dsr & FD_DSR_DRATEMASK, cur_drv->media_rate);
           fdctrl_stop_transfer(fdctrl, FD_SR0_ABNTERM, FD_SR1_MA, 0x00);

hw/block/fdc.c static Property isa_fdc_properties[] = { · line 2900

Quoted 6 lines
hw/block/fdc.c +0 -2
@@ -2895,8 +2884,6 @@ static Property isa_fdc_properties[] = {
       DEFINE_PROP_UINT32("dma", FDCtrlISABus, dma, 2),
       DEFINE_PROP_DRIVE("driveA", FDCtrlISABus, state.qdev_for_drives[0].blk),
       DEFINE_PROP_DRIVE("driveB", FDCtrlISABus, state.qdev_for_drives[1].blk),
-    DEFINE_PROP_BIT("check_media_rate", FDCtrlISABus, 
 state.check_media_rate,
-                    0, true),

Could you theoretically set this via QOM commands in QMP, and claim that this is a break in behavior?

Quoted 8 lines
Quoted 1 line

Though, it's ENTIRELY undocumented, so ... it's probably fine, I think. Probably. (Please soothe my troubled mind.)

A user actually could mess with this property even on the command line, e.g. by using:

 qemu-system-x86_64 -global isa-fdc.check_media_rate=false

... but, as you said, it's completely undocumented, the property is really just there for the internal use of machine type compatibility. We've done such clean-ups in the past already, see e.g. c6026998eef382d7ad76 or 2a4dbaf1c0db2453ab78f, so I think this should be fine. But if you disagree, I could replace this by a patch that adds this property to the list of deprecated features instead, so we could at least remove it after it has been deprecated for two releases?

I don't think it's necessary, personally -- just wanted to make sure I knew the exact stakes here.

#7 lore raw

Re: [PATCH 2/4] hw/block/fdc: Remove the check_media_rate property

Quoted 89 lines · John Snow
Quoted 88 lines · Thomas Huth
Quoted 23 lines · John Snow
Quoted 15 lines · Thomas Huth

This was only required for the pc-1.0 and earlier machine types. Now that these have been removed, we can also drop the corresponding code from the FDC device.

---
  hw/block/fdc.c             | 17 ++--------------- tests/qemu-iotests/172.out | 35 -----------------------------------

  2 files changed, 2 insertions(+), 50 deletions(-)
hw/block/fdc.c +0 -0
index 292ea87805..198940e737 100644

hw/block/fdc.c struct FDCtrl { · line 877

Quoted 4 lines
hw/block/fdc.c +0 -1
@@ -874,7 +874,6 @@ struct FDCtrl {
           FloppyDriveType type;
       } qdev_for_drives[MAX_FD];
       int reset_sensei;
-    uint32_t check_media_rate;

I am a bit of a dunce when it comes to the compatibility properties... does this mess with the migration format?

Quoted 3 lines

I guess it doesn't, since it's not in the VMSTATE declaration.

Hmmmm, alright.

I think that should be fine, yes.

Quoted 52 lines
Quoted 43 lines

      FloppyDriveType fallback; /* type=auto failure fallback */ /* Timers state */
      uint8_t timer0;

hw/block/fdc.c +2 -12
@@ -1021,18 +1020,10 @@ static const VMStateDescription 
 vmstate_fdrive_media_changed = {
       }
   };
-static bool fdrive_media_rate_needed(void *opaque)
-{
-    FDrive *drive = opaque;
-
-    return drive->fdctrl->check_media_rate;
-}
-
   static const VMStateDescription vmstate_fdrive_media_rate = {
       .name = "fdrive/media_rate",
       .version_id = 1,
       .minimum_version_id = 1,
-    .needed = fdrive_media_rate_needed,
       .fields = (VMStateField[]) {
           VMSTATE_UINT8(media_rate, FDrive),
           VMSTATE_END_OF_LIST()
@@ -1689,8 +1680,7 @@ static void fdctrl_start_transfer(FDCtrl *fdctrl, 
 int direction)
       /* Check the data rate. If the programmed data rate does not match
        * the currently inserted medium, the operation has to fail. */
-    if (fdctrl->check_media_rate &&
-        (fdctrl->dsr & FD_DSR_DRATEMASK) != cur_drv->media_rate) {
+    if ((fdctrl->dsr & FD_DSR_DRATEMASK) != cur_drv->media_rate) {
           FLOPPY_DPRINTF("data rate mismatch (fdc=%d, media=%d)\n",
                          fdctrl->dsr & FD_DSR_DRATEMASK, cur_drv->media_rate);
           fdctrl_stop_transfer(fdctrl, FD_SR0_ABNTERM, FD_SR1_MA, 0x00);
@@ -2489,8 +2479,7 @@ static void fdctrl_result_timer(void *opaque)
           cur_drv->sect = (cur_drv->sect % cur_drv->last_sect) + 1;
       }
       /* READ_ID can't automatically succeed! */
-    if (fdctrl->check_media_rate &&
-        (fdctrl->dsr & FD_DSR_DRATEMASK) != cur_drv->media_rate) {
+    if ((fdctrl->dsr & FD_DSR_DRATEMASK) != cur_drv->media_rate) {
           FLOPPY_DPRINTF("read id rate mismatch (fdc=%d, media=%d)\n",
                          fdctrl->dsr & FD_DSR_DRATEMASK, cur_drv->media_rate);
           fdctrl_stop_transfer(fdctrl, FD_SR0_ABNTERM, FD_SR1_MA, 0x00);

hw/block/fdc.c static Property isa_fdc_properties[] = { · line 2900

Quoted 6 lines
hw/block/fdc.c +0 -2
@@ -2895,8 +2884,6 @@ static Property isa_fdc_properties[] = {
       DEFINE_PROP_UINT32("dma", FDCtrlISABus, dma, 2),
       DEFINE_PROP_DRIVE("driveA", FDCtrlISABus, state.qdev_for_drives[0].blk),
       DEFINE_PROP_DRIVE("driveB", FDCtrlISABus, state.qdev_for_drives[1].blk),
-    DEFINE_PROP_BIT("check_media_rate", FDCtrlISABus, 
 state.check_media_rate,
-                    0, true),

Could you theoretically set this via QOM commands in QMP, and claim that this is a break in behavior?

Quoted 1 line

Though, it's ENTIRELY undocumented, so ... it's probably fine, I think. Probably. (Please soothe my troubled mind.)

A user actually could mess with this property even on the command line, e.g. by using:

  qemu-system-x86_64 -global isa-fdc.check_media_rate=false

Quoted 7 lines
Quoted 2 lines

... but, as you said, it's completely undocumented, the property is really just there for the internal use of machine type compatibility. We've done such clean-ups in the past already, see e.g. c6026998eef382d7ad76 or 2a4dbaf1c0db2453ab78f, so I think this should be fine. But if you disagree, I could replace this by a patch that adds this property to the list of deprecated features instead, so we could at least remove it after it has been deprecated for two releases?

I don't think it's necessary, personally -- just wanted to make sure I knew the exact stakes here.

Thanks! ... since the first patch has already been merged through Michael's tree, could you then please take this patch here through your floppy / block branch, John? Or maybe it could also go via qemu-trivial?

Thomas

#8 lore raw

Re: [PATCH 2/4] hw/block/fdc: Remove the check_media_rate property

Le 08/02/2021 à 08:05, Thomas Huth a écrit :

Quoted 97 lines · John Snow
Quoted 96 lines · Thomas Huth
Quoted 94 lines · John Snow
Quoted 24 lines · Thomas Huth
Quoted 15 lines

This was only required for the pc-1.0 and earlier machine types. Now that these have been removed, we can also drop the corresponding code from the FDC device.

---
  hw/block/fdc.c             | 17 ++--------------- tests/qemu-iotests/172.out | 35 -----------------------------------

  2 files changed, 2 insertions(+), 50 deletions(-)
hw/block/fdc.c +0 -0
index 292ea87805..198940e737 100644

hw/block/fdc.c struct FDCtrl { · line 877

Quoted 4 lines
hw/block/fdc.c +0 -1
@@ -874,7 +874,6 @@ struct FDCtrl {
           FloppyDriveType type;
       } qdev_for_drives[MAX_FD];
       int reset_sensei;
-    uint32_t check_media_rate;

I am a bit of a dunce when it comes to the compatibility properties... does this mess with the migration format?

Quoted 3 lines

I guess it doesn't, since it's not in the VMSTATE declaration.

Hmmmm, alright.

I think that should be fine, yes.

Quoted 50 lines
Quoted 41 lines

      FloppyDriveType fallback; /* type=auto failure fallback */ /* Timers state */
      uint8_t timer0;

hw/block/fdc.c +2 -12
@@ -1021,18 +1020,10 @@ static const VMStateDescription vmstate_fdrive_media_changed = {
       }
   };
-static bool fdrive_media_rate_needed(void *opaque)
-{
-    FDrive *drive = opaque;
-
-    return drive->fdctrl->check_media_rate;
-}
-
   static const VMStateDescription vmstate_fdrive_media_rate = {
       .name = "fdrive/media_rate",
       .version_id = 1,
       .minimum_version_id = 1,
-    .needed = fdrive_media_rate_needed,
       .fields = (VMStateField[]) {
           VMSTATE_UINT8(media_rate, FDrive),
           VMSTATE_END_OF_LIST()
@@ -1689,8 +1680,7 @@ static void fdctrl_start_transfer(FDCtrl *fdctrl, int direction)
       /* Check the data rate. If the programmed data rate does not match
        * the currently inserted medium, the operation has to fail. */
-    if (fdctrl->check_media_rate &&
-        (fdctrl->dsr & FD_DSR_DRATEMASK) != cur_drv->media_rate) {
+    if ((fdctrl->dsr & FD_DSR_DRATEMASK) != cur_drv->media_rate) {
           FLOPPY_DPRINTF("data rate mismatch (fdc=%d, media=%d)\n",
                          fdctrl->dsr & FD_DSR_DRATEMASK, cur_drv->media_rate);
           fdctrl_stop_transfer(fdctrl, FD_SR0_ABNTERM, FD_SR1_MA, 0x00);
@@ -2489,8 +2479,7 @@ static void fdctrl_result_timer(void *opaque)
           cur_drv->sect = (cur_drv->sect % cur_drv->last_sect) + 1;
       }
       /* READ_ID can't automatically succeed! */
-    if (fdctrl->check_media_rate &&
-        (fdctrl->dsr & FD_DSR_DRATEMASK) != cur_drv->media_rate) {
+    if ((fdctrl->dsr & FD_DSR_DRATEMASK) != cur_drv->media_rate) {
           FLOPPY_DPRINTF("read id rate mismatch (fdc=%d, media=%d)\n",
                          fdctrl->dsr & FD_DSR_DRATEMASK, cur_drv->media_rate);
           fdctrl_stop_transfer(fdctrl, FD_SR0_ABNTERM, FD_SR1_MA, 0x00);

hw/block/fdc.c static Property isa_fdc_properties[] = { · line 2899

Quoted 5 lines
hw/block/fdc.c +0 -2
@@ -2895,8 +2884,6 @@ static Property isa_fdc_properties[] = {
       DEFINE_PROP_UINT32("dma", FDCtrlISABus, dma, 2),
       DEFINE_PROP_DRIVE("driveA", FDCtrlISABus, state.qdev_for_drives[0].blk),
       DEFINE_PROP_DRIVE("driveB", FDCtrlISABus, state.qdev_for_drives[1].blk),
-    DEFINE_PROP_BIT("check_media_rate", FDCtrlISABus, state.check_media_rate,
-                    0, true),

Could you theoretically set this via QOM commands in QMP, and claim that this is a break in behavior?

Quoted 2 lines

Though, it's ENTIRELY undocumented, so ... it's probably fine, I think. Probably. (Please soothe my troubled mind.)

A user actually could mess with this property even on the command line, e.g. by using:

  qemu-system-x86_64 -global isa-fdc.check_media_rate=false

... but, as you said, it's completely undocumented, the property is really just there for the internal use of machine type compatibility. We've done such clean-ups in the past already, see e.g. c6026998eef382d7ad76 or 2a4dbaf1c0db2453ab78f, so I think this should be fine. But if you disagree, I could replace this by a patch that adds this property to the list of deprecated features instead, so we could at least remove it after it has been deprecated for two releases?

Quoted 8 lines
Quoted 4 lines

I don't think it's necessary, personally -- just wanted to make sure I knew the exact stakes here.

Thanks! ... since the first patch has already been merged through Michael's tree, could you then please take this patch here through your floppy / block branch, John? Or maybe it could also go via qemu-trivial?

Applied to my trivial-patches branch.

Thanks,
Laurent

#9 lore raw

Re: [PATCH 2/4] hw/block/fdc: Remove the check_media_rate property

Quoted 103 lines · Laurent Vivier

Le 08/02/2021 à 08:05, Thomas Huth a écrit :

Quoted 102 lines · John Snow
Quoted 100 lines · Thomas Huth
Quoted 86 lines · John Snow
Quoted 24 lines · Thomas Huth
Quoted 15 lines

This was only required for the pc-1.0 and earlier machine types. Now that these have been removed, we can also drop the corresponding code from the FDC device.

---
   hw/block/fdc.c             | 17 ++---------------
   tests/qemu-iotests/172.out | 35 -----------------------------------
   2 files changed, 2 insertions(+), 50 deletions(-)
hw/block/fdc.c +0 -0
index 292ea87805..198940e737 100644

hw/block/fdc.c struct FDCtrl { · line 877

Quoted 4 lines
hw/block/fdc.c +0 -1
@@ -874,7 +874,6 @@ struct FDCtrl {
           FloppyDriveType type;
       } qdev_for_drives[MAX_FD];
       int reset_sensei;
-    uint32_t check_media_rate;

I am a bit of a dunce when it comes to the compatibility properties... does this mess with the migration format?

Quoted 3 lines

I guess it doesn't, since it's not in the VMSTATE declaration.

Hmmmm, alright.

I think that should be fine, yes.

Quoted 50 lines
Quoted 41 lines
hw/block/fdc.c +2 -12
       FloppyDriveType fallback; /* type=auto failure fallback */
       /* Timers state */
       uint8_t timer0;
@@ -1021,18 +1020,10 @@ static const VMStateDescription vmstate_fdrive_media_changed = {
       }
   };
-static bool fdrive_media_rate_needed(void *opaque)
-{
-    FDrive *drive = opaque;
-
-    return drive->fdctrl->check_media_rate;
-}
-
   static const VMStateDescription vmstate_fdrive_media_rate = {
       .name = "fdrive/media_rate",
       .version_id = 1,
       .minimum_version_id = 1,
-    .needed = fdrive_media_rate_needed,
       .fields = (VMStateField[]) {
           VMSTATE_UINT8(media_rate, FDrive),
           VMSTATE_END_OF_LIST()
@@ -1689,8 +1680,7 @@ static void fdctrl_start_transfer(FDCtrl *fdctrl, int direction)
       /* Check the data rate. If the programmed data rate does not match
        * the currently inserted medium, the operation has to fail. */
-    if (fdctrl->check_media_rate &&
-        (fdctrl->dsr & FD_DSR_DRATEMASK) != cur_drv->media_rate) {
+    if ((fdctrl->dsr & FD_DSR_DRATEMASK) != cur_drv->media_rate) {
           FLOPPY_DPRINTF("data rate mismatch (fdc=%d, media=%d)\n",
                          fdctrl->dsr & FD_DSR_DRATEMASK, cur_drv->media_rate);
           fdctrl_stop_transfer(fdctrl, FD_SR0_ABNTERM, FD_SR1_MA, 0x00);
@@ -2489,8 +2479,7 @@ static void fdctrl_result_timer(void *opaque)
           cur_drv->sect = (cur_drv->sect % cur_drv->last_sect) + 1;
       }
       /* READ_ID can't automatically succeed! */
-    if (fdctrl->check_media_rate &&
-        (fdctrl->dsr & FD_DSR_DRATEMASK) != cur_drv->media_rate) {
+    if ((fdctrl->dsr & FD_DSR_DRATEMASK) != cur_drv->media_rate) {
           FLOPPY_DPRINTF("read id rate mismatch (fdc=%d, media=%d)\n",
                          fdctrl->dsr & FD_DSR_DRATEMASK, cur_drv->media_rate);
           fdctrl_stop_transfer(fdctrl, FD_SR0_ABNTERM, FD_SR1_MA, 0x00);

hw/block/fdc.c static Property isa_fdc_properties[] = { · line 2899

Quoted 5 lines
hw/block/fdc.c +0 -2
@@ -2895,8 +2884,6 @@ static Property isa_fdc_properties[] = {
       DEFINE_PROP_UINT32("dma", FDCtrlISABus, dma, 2),
       DEFINE_PROP_DRIVE("driveA", FDCtrlISABus, state.qdev_for_drives[0].blk),
       DEFINE_PROP_DRIVE("driveB", FDCtrlISABus, state.qdev_for_drives[1].blk),
-    DEFINE_PROP_BIT("check_media_rate", FDCtrlISABus, state.check_media_rate,
-                    0, true),

Could you theoretically set this via QOM commands in QMP, and claim that this is a break in behavior?

Quoted 2 lines

Though, it's ENTIRELY undocumented, so ... it's probably fine, I think. Probably. (Please soothe my troubled mind.)

A user actually could mess with this property even on the command line, e.g. by using:

Quoted 8 lines

  qemu-system-x86_64 -global isa-fdc.check_media_rate=false

... but, as you said, it's completely undocumented, the property is really just there for the internal use of machine type compatibility. We've done such clean-ups in the past already, see e.g. c6026998eef382d7ad76 or 2a4dbaf1c0db2453ab78f, so I think this should be fine. But if you disagree, I could replace this by a patch that adds this property to the list of deprecated features instead, so we could at least remove it after it has been deprecated for two releases?

I don't think it's necessary, personally -- just wanted to make sure I knew the exact stakes here.

Quoted 9 lines
Quoted 3 lines

Thanks! ... since the first patch has already been merged through Michael's tree, could you then please take this patch here through your floppy / block branch, John? Or maybe it could also go via qemu-trivial?

Applied to my trivial-patches branch.

Thanks,
Laurent

Thank you, Laurent!

--js

#10 lore raw

PATCH 3/4 hw/virtio/virtio-balloon: Remove the "class" property

In reply to Thomas Huth

This property was only required for compatibility reasons in the pc-1.0 machine type and earlier. Now that these machine types have been removed, the property is not useful anymore.

---
 hw/virtio/virtio-balloon-pci.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)
hw/virtio/virtio-balloon-pci.c +1 -10
index a2c5cc7207..79a3ba979a 100644
@@ -34,21 +34,13 @@ struct VirtIOBalloonPCI {
     VirtIOPCIProxy parent_obj;
     VirtIOBalloon vdev;
 };
-static Property virtio_balloon_pci_properties[] = {
-    DEFINE_PROP_UINT32("class", VirtIOPCIProxy, class_code, 0),
-    DEFINE_PROP_END_OF_LIST(),
-};
 
 static void virtio_balloon_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
 {
     VirtIOBalloonPCI *dev = VIRTIO_BALLOON_PCI(vpci_dev);
     DeviceState *vdev = DEVICE(&dev->vdev);
 
-    if (vpci_dev->class_code != PCI_CLASS_OTHERS &&
-        vpci_dev->class_code != PCI_CLASS_MEMORY_RAM) { /* qemu < 1.1 */
-        vpci_dev->class_code = PCI_CLASS_OTHERS;
-    }
-
+    vpci_dev->class_code = PCI_CLASS_OTHERS;
     qdev_realize(vdev, BUS(&vpci_dev->bus), errp);
 }
 
@@ -59,7 +51,6 @@ static void virtio_balloon_pci_class_init(ObjectClass *klass, void *data)
     PCIDeviceClass *pcidev_k = PCI_DEVICE_CLASS(klass);
     k->realize = virtio_balloon_pci_realize;
     set_bit(DEVICE_CATEGORY_MISC, dc->categories);
-    device_class_set_props(dc, virtio_balloon_pci_properties);
     pcidev_k->vendor_id = PCI_VENDOR_ID_REDHAT_QUMRANET;
     pcidev_k->device_id = PCI_DEVICE_ID_VIRTIO_BALLOON;
     pcidev_k->revision = VIRTIO_PCI_ABI_VERSION;
Signature · 1 line
2.27.0
Acked-by on v1 3/4
#11 lore raw

Re: [PATCH 3/4] hw/virtio/virtio-balloon: Remove the "class" property

Quoted 38 lines · Thomas Huth

This property was only required for compatibility reasons in the pc-1.0 machine type and earlier. Now that these machine types have been removed, the property is not useful anymore.

---
  hw/virtio/virtio-balloon-pci.c | 11 +----------
  1 file changed, 1 insertion(+), 10 deletions(-)
hw/virtio/virtio-balloon-pci.c +1 -9
index a2c5cc7207..79a3ba979a 100644
@@ -34,21 +34,13 @@ struct VirtIOBalloonPCI {
      VirtIOPCIProxy parent_obj;
      VirtIOBalloon vdev;
  };
-static Property virtio_balloon_pci_properties[] = {
-    DEFINE_PROP_UINT32("class", VirtIOPCIProxy, class_code, 0),
-    DEFINE_PROP_END_OF_LIST(),
-};
 
  static void virtio_balloon_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
  {
      VirtIOBalloonPCI *dev = VIRTIO_BALLOON_PCI(vpci_dev);
      DeviceState *vdev = DEVICE(&dev->vdev);
 
-    if (vpci_dev->class_code != PCI_CLASS_OTHERS &&
-        vpci_dev->class_code != PCI_CLASS_MEMORY_RAM) { /* qemu < 1.1 */
-        vpci_dev->class_code = PCI_CLASS_OTHERS;
-    }
-
+    vpci_dev->class_code = PCI_CLASS_OTHERS;
      qdev_realize(vdev, BUS(&vpci_dev->bus), errp);
  }
 

hw/virtio/virtio-balloon-pci.c static void virtio_balloon_pci_class_init(ObjectClass *klass, void *data) · line 56

Quoted 7 lines
hw/virtio/virtio-balloon-pci.c +0 -1
@@ -59,7 +51,6 @@ static void virtio_balloon_pci_class_init(ObjectClass *klass, void *data)
      PCIDeviceClass *pcidev_k = PCI_DEVICE_CLASS(klass);
      k->realize = virtio_balloon_pci_realize;
      set_bit(DEVICE_CATEGORY_MISC, dc->categories);
-    device_class_set_props(dc, virtio_balloon_pci_properties);
      pcidev_k->vendor_id = PCI_VENDOR_ID_REDHAT_QUMRANET;
      pcidev_k->device_id = PCI_DEVICE_ID_VIRTIO_BALLOON;
      pcidev_k->revision = VIRTIO_PCI_ABI_VERSION;
Signature · 3 lines
Thanks,

David / dhildenb
#12 lore raw

PATCH 4/4 hw/usb/bus: Remove the "full-path" property

In reply to Thomas Huth

This property was only required for the pc-1.0 and earlier machine types. Since these have been removed now, we can delete the property as well.

---
 hw/usb/bus.c     | 7 +------
 include/hw/usb.h | 2 +-
 2 files changed, 2 insertions(+), 7 deletions(-)
hw/usb/bus.c +1 -6
index 064f94e9c3..df7411fea8 100644
@@ -19,8 +19,6 @@ static void usb_qdev_unrealize(DeviceState *qdev);
 static Property usb_props[] = {
     DEFINE_PROP_STRING("port", USBDevice, port_path),
     DEFINE_PROP_STRING("serial", USBDevice, serial),
-    DEFINE_PROP_BIT("full-path", USBDevice, flags,
-                    USB_DEV_FLAG_FULL_PATH, true),
     DEFINE_PROP_BIT("msos-desc", USBDevice, flags,
                     USB_DEV_FLAG_MSOS_DESC_ENABLE, true),
     DEFINE_PROP_STRING("pcap", USBDevice, pcap_filename),
@@ -596,11 +594,8 @@ static char *usb_get_dev_path(DeviceState *qdev)
 {
     USBDevice *dev = USB_DEVICE(qdev);
     DeviceState *hcd = qdev->parent_bus->parent;
-    char *id = NULL;
+    char *id = qdev_get_dev_path(hcd);
 
-    if (dev->flags & (1 << USB_DEV_FLAG_FULL_PATH)) {
-        id = qdev_get_dev_path(hcd);
-    }
     if (id) {
         char *ret = g_strdup_printf("%s/%s", id, dev->port->path);
         g_free(id);
include/hw/usb.h +1 -1
index abfbfc5284..c44b77dae0 100644
@@ -216,7 +216,7 @@ struct USBEndpoint {
 };
 
 enum USBDeviceFlags {
-    USB_DEV_FLAG_FULL_PATH,
+    USB_DEV_FLAG_FULL_PATH,             /* unused since QEMU v6.0 */
     USB_DEV_FLAG_IS_HOST,
     USB_DEV_FLAG_MSOS_DESC_ENABLE,
     USB_DEV_FLAG_MSOS_DESC_IN_USE,
Signature · 1 line
2.27.0
#13 lore raw

Re: [PATCH 4/4] hw/usb/bus: Remove the "full-path" property

Hi,

include/hw/usb.h struct USBEndpoint { · line 219

Quoted 3 lines

enum USBDeviceFlags {

include/hw/usb.h +1 -1
-    USB_DEV_FLAG_FULL_PATH,
+    USB_DEV_FLAG_FULL_PATH,             /* unused since QEMU v6.0 */

Why not just drop it? Any remaining users?

take care,
Gerd

#14 lore raw

Re: [PATCH 4/4] hw/usb/bus: Remove the "full-path" property

Quoted 7 lines · Gerd Hoffmann
   Hi,

include/hw/usb.h struct USBEndpoint { · line 219

Quoted 3 lines
  enum USBDeviceFlags {
include/hw/usb.h +1 -1
-    USB_DEV_FLAG_FULL_PATH,
+    USB_DEV_FLAG_FULL_PATH,             /* unused since QEMU v6.0 */

Why not just drop it? Any remaining users?

I didn't want to change the values of the other members of the enum ... but if you prefer, I can also a "= 1" after the next member of the enum and remove the USB_DEV_FLAG_FULL_PATH instead.

Thomas

#15 lore raw

Re: [PATCH 4/4] hw/usb/bus: Remove the "full-path" property

Quoted 10 lines · Thomas Huth
Quoted 7 lines · Gerd Hoffmann
   Hi,

include/hw/usb.h struct USBEndpoint { · line 219

Quoted 3 lines
  enum USBDeviceFlags {
include/hw/usb.h +1 -1
-    USB_DEV_FLAG_FULL_PATH,
+    USB_DEV_FLAG_FULL_PATH,             /* unused since QEMU v6.0 */

Why not just drop it? Any remaining users?

I didn't want to change the values of the other members of the enum ...

This should be purely internal to qemu hw/usb and not some kind of abi, so changing the values shouldn't break anything ...

take care,
Gerd

#16 lore raw
In reply to Thomas Huth
Quoted 7 lines · Thomas Huth

The pc-1.x machine types have been deprecated since QEMU v5.0 already, and nobody complained, so they can now be removed. While we're at it, also remove some compatibility switches and related code that are now not necessary anymore after these machine types have been removed. (We could maybe even remove more stuff like the various host_features switches in the virtio devices, but they still might be useful in certain cases, so I decided not to remove them yet)

I queued patches 1 and 3. Thanks!

Quoted 18 lines

Thomas Huth (4):
hw/i386: Remove the deprecated pc-1.x machine types hw/block/fdc: Remove the check_media_rate property hw/virtio/virtio-balloon: Remove the "class" property hw/usb/bus: Remove the "full-path" property

 docs/system/deprecated.rst       |  6 --
 docs/system/removed-features.rst |  6 ++
 hw/block/fdc.c                   | 17 +-----
 hw/i386/pc_piix.c                | 94 --------------------------------
 hw/usb/bus.c                     |  7 +--
 hw/virtio/virtio-balloon-pci.c   | 11 +---
 include/hw/usb.h                 |  2 +-
 tests/qemu-iotests/172.out       | 35 ------------
 8 files changed, 11 insertions(+), 167 deletions(-)
Signature · 1 line
2.27.0