qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/4] Drop deprecated floppy config & bogus -drive if=T
@ 2021-03-09 16:12 Markus Armbruster
  2021-03-09 16:12 ` [PATCH v3 1/4] docs/system/deprecated: Fix note on fdc drive properties Markus Armbruster
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Markus Armbruster @ 2021-03-09 16:12 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, berrange, qemu-block, libvir-list, mreitz, jsnow

v3:
* PATCH 1: New [Daniel]

v2:
* Rebased, straightforward conflict with commit f5d33dd51f
  "hw/block/fdc: Remove the check_media_rate property" resolved
* PATCH 2: Commit message fixed [Kevin]

Markus Armbruster (3):
  fdc: Drop deprecated floppy configuration
  fdc: Inline fdctrl_connect_drives() into fdctrl_realize_common()
  blockdev: Drop deprecated bogus -drive interface type

 docs/system/deprecated.rst       |  33 --
 docs/system/removed-features.rst |  33 ++
 include/sysemu/blockdev.h        |   1 -
 blockdev.c                       |  37 +-
 hw/block/fdc.c                   |  73 +---
 softmmu/vl.c                     |   8 +-
 tests/qemu-iotests/172           |  31 +-
 tests/qemu-iotests/172.out       | 562 +------------------------------
 8 files changed, 59 insertions(+), 719 deletions(-)

-- 
2.26.2



^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH v3 1/4] docs/system/deprecated: Fix note on fdc drive properties
  2021-03-09 16:12 [PATCH v3 0/4] Drop deprecated floppy config & bogus -drive if=T Markus Armbruster
@ 2021-03-09 16:12 ` Markus Armbruster
  2021-03-09 16:13   ` Daniel P. Berrangé
  2021-03-09 16:12 ` [PATCH v3 2/4] fdc: Drop deprecated floppy configuration Markus Armbruster
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 14+ messages in thread
From: Markus Armbruster @ 2021-03-09 16:12 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, berrange, qemu-block, libvir-list, mreitz, jsnow

Commit 4a27a638e7 "fdc: Deprecate configuring floppies with -global
isa-fdc" actually deprecated any use of floppy controller driver
properties, not just with -global.  Correct the deprecation note
accordingly.

Fixes: 4a27a638e718b445648de6b27c709353551d9b44
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 docs/system/deprecated.rst | 33 ++++++++++++++++++++++++++++-----
 1 file changed, 28 insertions(+), 5 deletions(-)

diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst
index cfabe69846..008d4c74ab 100644
--- a/docs/system/deprecated.rst
+++ b/docs/system/deprecated.rst
@@ -94,10 +94,11 @@ QEMU 5.1 has three options:
       to the user to load all the images they need.
  3. ``-bios <file>`` - Tells QEMU to load the specified file as the firmwrae.
 
-``Configuring floppies with ``-global``
-'''''''''''''''''''''''''''''''''''''''
+Floppy controllers' drive properties (since 5.1)
+''''''''''''''''''''''''''''''''''''''''''''''''
 
-Use ``-device floppy,...`` instead:
+Use ``-device floppy,...`` instead.  When configuring onboard floppy
+controllers
 ::
 
     -global isa-fdc.driveA=...
@@ -120,8 +121,30 @@ become
 
     -device floppy,unit=1,drive=...
 
-``-drive`` with bogus interface type
-''''''''''''''''''''''''''''''''''''
+When plugging in a floppy controller
+::
+
+    -device isa-fdc,...,driveA=...
+
+becomes
+::
+
+    -device isa-fdc,...
+    -device floppy,unit=0,drive=...
+
+and
+::
+
+    -device isa-fdc,...,driveB=...
+
+becomes
+::
+
+    -device isa-fdc,...
+    -device floppy,unit=1,drive=...
+
+``-drive`` with bogus interface type (since 5.1)
+''''''''''''''''''''''''''''''''''''''''''''''''
 
 Drives with interface types other than ``if=none`` are for onboard
 devices.  It is possible to use drives the board doesn't pick up with
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v3 2/4] fdc: Drop deprecated floppy configuration
  2021-03-09 16:12 [PATCH v3 0/4] Drop deprecated floppy config & bogus -drive if=T Markus Armbruster
  2021-03-09 16:12 ` [PATCH v3 1/4] docs/system/deprecated: Fix note on fdc drive properties Markus Armbruster
@ 2021-03-09 16:12 ` Markus Armbruster
  2021-03-09 16:14   ` Daniel P. Berrangé
  2021-03-09 16:12 ` [PATCH v3 3/4] fdc: Inline fdctrl_connect_drives() into fdctrl_realize_common() Markus Armbruster
  2021-03-09 16:12 ` [PATCH v3 4/4] blockdev: Drop deprecated bogus -drive interface type Markus Armbruster
  3 siblings, 1 reply; 14+ messages in thread
From: Markus Armbruster @ 2021-03-09 16:12 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, berrange, qemu-block, libvir-list, mreitz, jsnow

Drop the crap deprecated in commit 4a27a638e7 "fdc: Deprecate
configuring floppies with -global isa-fdc" (v5.1.0).

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 docs/system/deprecated.rst       |  49 ---
 docs/system/removed-features.rst |  49 +++
 hw/block/fdc.c                   |  54 +--
 tests/qemu-iotests/172           |  31 +-
 tests/qemu-iotests/172.out       | 562 +------------------------------
 5 files changed, 53 insertions(+), 692 deletions(-)

diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst
index 008d4c74ab..601e9647a5 100644
--- a/docs/system/deprecated.rst
+++ b/docs/system/deprecated.rst
@@ -94,55 +94,6 @@ QEMU 5.1 has three options:
       to the user to load all the images they need.
  3. ``-bios <file>`` - Tells QEMU to load the specified file as the firmwrae.
 
-Floppy controllers' drive properties (since 5.1)
-''''''''''''''''''''''''''''''''''''''''''''''''
-
-Use ``-device floppy,...`` instead.  When configuring onboard floppy
-controllers
-::
-
-    -global isa-fdc.driveA=...
-    -global sysbus-fdc.driveA=...
-    -global SUNW,fdtwo.drive=...
-
-become
-::
-
-    -device floppy,unit=0,drive=...
-
-and
-::
-
-    -global isa-fdc.driveB=...
-    -global sysbus-fdc.driveB=...
-
-become
-::
-
-    -device floppy,unit=1,drive=...
-
-When plugging in a floppy controller
-::
-
-    -device isa-fdc,...,driveA=...
-
-becomes
-::
-
-    -device isa-fdc,...
-    -device floppy,unit=0,drive=...
-
-and
-::
-
-    -device isa-fdc,...,driveB=...
-
-becomes
-::
-
-    -device isa-fdc,...
-    -device floppy,unit=1,drive=...
-
 ``-drive`` with bogus interface type (since 5.1)
 ''''''''''''''''''''''''''''''''''''''''''''''''
 
diff --git a/docs/system/removed-features.rst b/docs/system/removed-features.rst
index c8481cafbd..77e7ba1339 100644
--- a/docs/system/removed-features.rst
+++ b/docs/system/removed-features.rst
@@ -38,6 +38,55 @@ or ``-display default,show-cursor=on`` instead.
 QEMU 5.0 introduced an alternative syntax to specify the size of the translation
 block cache, ``-accel tcg,tb-size=``.
 
+Floppy controllers' drive properties (removed in 6.0)
+'''''''''''''''''''''''''''''''''''''''''''''''''''''
+
+Use ``-device floppy,...`` instead.  When configuring onboard floppy
+controllers
+::
+
+    -global isa-fdc.driveA=...
+    -global sysbus-fdc.driveA=...
+    -global SUNW,fdtwo.drive=...
+
+become
+::
+
+    -device floppy,unit=0,drive=...
+
+and
+::
+
+    -global isa-fdc.driveB=...
+    -global sysbus-fdc.driveB=...
+
+become
+::
+
+    -device floppy,unit=1,drive=...
+
+When plugging in a floppy controller
+::
+
+    -device isa-fdc,...,driveA=...
+
+becomes
+::
+
+    -device isa-fdc,...
+    -device floppy,unit=0,drive=...
+
+and
+::
+
+    -device isa-fdc,...,driveB=...
+
+becomes
+::
+
+    -device isa-fdc,...
+    -device floppy,unit=1,drive=...
+
 QEMU Machine Protocol (QMP) commands
 ------------------------------------
 
diff --git a/hw/block/fdc.c b/hw/block/fdc.c
index 198940e737..f978ddf647 100644
--- a/hw/block/fdc.c
+++ b/hw/block/fdc.c
@@ -870,7 +870,6 @@ struct FDCtrl {
     uint8_t num_floppies;
     FDrive drives[MAX_FD];
     struct {
-        BlockBackend *blk;
         FloppyDriveType type;
     } qdev_for_drives[MAX_FD];
     int reset_sensei;
@@ -2517,56 +2516,12 @@ static void fdctrl_connect_drives(FDCtrl *fdctrl, DeviceState *fdc_dev,
 {
     unsigned int i;
     FDrive *drive;
-    DeviceState *dev;
-    BlockBackend *blk;
-    bool ok;
-    const char *fdc_name, *drive_suffix;
 
     for (i = 0; i < MAX_FD; i++) {
         drive = &fdctrl->drives[i];
         drive->fdctrl = fdctrl;
-
-        /* If the drive is not present, we skip creating the qdev device, but
-         * still have to initialise the controller. */
-        blk = fdctrl->qdev_for_drives[i].blk;
-        if (!blk) {
-            fd_init(drive);
-            fd_revalidate(drive);
-            continue;
-        }
-
-        fdc_name = object_get_typename(OBJECT(fdc_dev));
-        drive_suffix = !strcmp(fdc_name, "SUNW,fdtwo") ? "" : i ? "B" : "A";
-        warn_report("warning: property %s.drive%s is deprecated",
-                    fdc_name, drive_suffix);
-        error_printf("Use -device floppy,unit=%d,drive=... instead.\n", i);
-
-        dev = qdev_new("floppy");
-        qdev_prop_set_uint32(dev, "unit", i);
-        qdev_prop_set_enum(dev, "drive-type", fdctrl->qdev_for_drives[i].type);
-
-        /*
-         * Hack alert: we move the backend from the floppy controller
-         * device to the floppy device.  We first need to detach the
-         * controller, or else floppy_create()'s qdev_prop_set_drive()
-         * will die when it attaches floppy device.  We also need to
-         * take another reference so that blk_detach_dev() doesn't
-         * free blk while we still need it.
-         *
-         * The hack is probably a bad idea.
-         */
-        blk_ref(blk);
-        blk_detach_dev(blk, fdc_dev);
-        fdctrl->qdev_for_drives[i].blk = NULL;
-        ok = qdev_prop_set_drive_err(dev, "drive", blk, errp);
-        blk_unref(blk);
-        if (!ok) {
-            return;
-        }
-
-        if (!qdev_realize_and_unref(dev, &fdctrl->bus.bus, errp)) {
-            return;
-        }
+        fd_init(drive);
+        fd_revalidate(drive);
     }
 }
 
@@ -2882,8 +2837,6 @@ static Property isa_fdc_properties[] = {
     DEFINE_PROP_UINT32("iobase", FDCtrlISABus, iobase, 0x3f0),
     DEFINE_PROP_UINT32("irq", FDCtrlISABus, irq, 6),
     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_SIGNED("fdtypeA", FDCtrlISABus, state.qdev_for_drives[0].type,
                         FLOPPY_DRIVE_TYPE_AUTO, qdev_prop_fdc_drive_type,
                         FloppyDriveType),
@@ -2941,8 +2894,6 @@ static const VMStateDescription vmstate_sysbus_fdc ={
 };
 
 static Property sysbus_fdc_properties[] = {
-    DEFINE_PROP_DRIVE("driveA", FDCtrlSysBus, state.qdev_for_drives[0].blk),
-    DEFINE_PROP_DRIVE("driveB", FDCtrlSysBus, state.qdev_for_drives[1].blk),
     DEFINE_PROP_SIGNED("fdtypeA", FDCtrlSysBus, state.qdev_for_drives[0].type,
                         FLOPPY_DRIVE_TYPE_AUTO, qdev_prop_fdc_drive_type,
                         FloppyDriveType),
@@ -2971,7 +2922,6 @@ static const TypeInfo sysbus_fdc_info = {
 };
 
 static Property sun4m_fdc_properties[] = {
-    DEFINE_PROP_DRIVE("drive", FDCtrlSysBus, state.qdev_for_drives[0].blk),
     DEFINE_PROP_SIGNED("fdtype", FDCtrlSysBus, state.qdev_for_drives[0].type,
                         FLOPPY_DRIVE_TYPE_AUTO, qdev_prop_fdc_drive_type,
                         FloppyDriveType),
diff --git a/tests/qemu-iotests/172 b/tests/qemu-iotests/172
index 0ac942a6c5..ff269ca7b5 100755
--- a/tests/qemu-iotests/172
+++ b/tests/qemu-iotests/172
@@ -123,15 +123,6 @@ check_floppy_qtree -drive if=floppy,file="$TEST_IMG"
 check_floppy_qtree -drive if=floppy,file="$TEST_IMG",index=1
 check_floppy_qtree -drive if=floppy,file="$TEST_IMG" -drive if=floppy,file="$TEST_IMG.2",index=1
 
-echo
-echo
-echo === Using -drive if=none and -global ===
-
-check_floppy_qtree -drive if=none,file="$TEST_IMG" -global isa-fdc.driveA=none0
-check_floppy_qtree -drive if=none,file="$TEST_IMG" -global isa-fdc.driveB=none0
-check_floppy_qtree -drive if=none,file="$TEST_IMG" -drive if=none,file="$TEST_IMG.2" \
-                   -global isa-fdc.driveA=none0 -global isa-fdc.driveB=none1
-
 echo
 echo
 echo === Using -drive if=none and -device ===
@@ -145,13 +136,6 @@ echo
 echo
 echo === Mixing -fdX and -global ===
 
-# Working
-check_floppy_qtree -fda "$TEST_IMG" -drive if=none,file="$TEST_IMG.2" -global isa-fdc.driveB=none0
-check_floppy_qtree -fdb "$TEST_IMG" -drive if=none,file="$TEST_IMG.2" -global isa-fdc.driveA=none0
-
-# Conflicting
-check_floppy_qtree -fda "$TEST_IMG" -drive if=none,file="$TEST_IMG.2" -global isa-fdc.driveA=none0
-check_floppy_qtree -fdb "$TEST_IMG" -drive if=none,file="$TEST_IMG.2" -global isa-fdc.driveB=none0
 # Conflicting, -fdX wins
 check_floppy_qtree -fda "$TEST_IMG" -drive if=none,file="$TEST_IMG.2" -global floppy.drive=none0
 
@@ -186,23 +170,10 @@ echo
 echo === Mixing -global and -device ===
 
 # Working
-check_floppy_qtree -drive if=none,file="$TEST_IMG" -drive if=none,file="$TEST_IMG.2" \
-                   -global isa-fdc.driveA=none0 -device floppy,drive=none1
-check_floppy_qtree -drive if=none,file="$TEST_IMG" -drive if=none,file="$TEST_IMG.2" \
-                   -global isa-fdc.driveA=none0 -device floppy,drive=none1,unit=1
-
-check_floppy_qtree -drive if=none,file="$TEST_IMG" -drive if=none,file="$TEST_IMG.2" \
-                   -global isa-fdc.driveB=none0 -device floppy,drive=none1
-check_floppy_qtree -drive if=none,file="$TEST_IMG" -drive if=none,file="$TEST_IMG.2" \
-                   -global isa-fdc.driveB=none0 -device floppy,drive=none1,unit=0
 check_floppy_qtree -drive if=none,file="$TEST_IMG" \
                    -global floppy.drive=none0 -device floppy,unit=0
 
 # Conflicting
-check_floppy_qtree -drive if=none,file="$TEST_IMG" -drive if=none,file="$TEST_IMG.2" \
-                   -global isa-fdc.driveA=none0 -device floppy,drive=none1,unit=0
-check_floppy_qtree -drive if=none,file="$TEST_IMG" -drive if=none,file="$TEST_IMG.2" \
-                   -global isa-fdc.driveB=none0 -device floppy,drive=none1,unit=1
 check_floppy_qtree -drive if=none,file="$TEST_IMG" -drive if=none,file="$TEST_IMG.2" \
                    -global floppy.drive=none0 -device floppy,drive=none1,unit=0
 
@@ -227,7 +198,7 @@ echo === Too many floppy drives ===
 check_floppy_qtree -drive if=floppy,file="$TEST_IMG" \
                    -drive if=none,file="$TEST_IMG.2" \
                    -drive if=none,file="$TEST_IMG.3" \
-                   -global isa-fdc.driveB=none0 \
+                   -device floppy,drive=none0 \
                    -device floppy,drive=none1
 
 echo
diff --git a/tests/qemu-iotests/172.out b/tests/qemu-iotests/172.out
index 349ae51d6c..d53f61d0de 100644
--- a/tests/qemu-iotests/172.out
+++ b/tests/qemu-iotests/172.out
@@ -12,8 +12,6 @@ Testing:
             iobase = 1008 (0x3f0)
             irq = 6 (0x6)
             dma = 2 (0x2)
-            driveA = ""
-            driveB = ""
             fdtypeA = "auto"
             fdtypeB = "auto"
             fallback = "288"
@@ -41,8 +39,6 @@ Testing: -fda TEST_DIR/t.qcow2
             iobase = 1008 (0x3f0)
             irq = 6 (0x6)
             dma = 2 (0x2)
-            driveA = ""
-            driveB = ""
             fdtypeA = "auto"
             fdtypeB = "auto"
             fallback = "288"
@@ -80,8 +76,6 @@ Testing: -fdb TEST_DIR/t.qcow2
             iobase = 1008 (0x3f0)
             irq = 6 (0x6)
             dma = 2 (0x2)
-            driveA = ""
-            driveB = ""
             fdtypeA = "auto"
             fdtypeB = "auto"
             fallback = "288"
@@ -134,8 +128,6 @@ Testing: -fda TEST_DIR/t.qcow2 -fdb TEST_DIR/t.qcow2.2
             iobase = 1008 (0x3f0)
             irq = 6 (0x6)
             dma = 2 (0x2)
-            driveA = ""
-            driveB = ""
             fdtypeA = "auto"
             fdtypeB = "auto"
             fallback = "288"
@@ -189,8 +181,6 @@ Testing: -fdb
             iobase = 1008 (0x3f0)
             irq = 6 (0x6)
             dma = 2 (0x2)
-            driveA = ""
-            driveB = ""
             fdtypeA = "auto"
             fdtypeB = "auto"
             fallback = "288"
@@ -229,8 +219,6 @@ Testing: -drive if=floppy,file=TEST_DIR/t.qcow2
             iobase = 1008 (0x3f0)
             irq = 6 (0x6)
             dma = 2 (0x2)
-            driveA = ""
-            driveB = ""
             fdtypeA = "auto"
             fdtypeB = "auto"
             fallback = "288"
@@ -268,8 +256,6 @@ Testing: -drive if=floppy,file=TEST_DIR/t.qcow2,index=1
             iobase = 1008 (0x3f0)
             irq = 6 (0x6)
             dma = 2 (0x2)
-            driveA = ""
-            driveB = ""
             fdtypeA = "auto"
             fdtypeB = "auto"
             fallback = "288"
@@ -322,8 +308,6 @@ Testing: -drive if=floppy,file=TEST_DIR/t.qcow2 -drive if=floppy,file=TEST_DIR/t
             iobase = 1008 (0x3f0)
             irq = 6 (0x6)
             dma = 2 (0x2)
-            driveA = ""
-            driveB = ""
             fdtypeA = "auto"
             fdtypeB = "auto"
             fallback = "288"
@@ -372,150 +356,6 @@ sd0: [not inserted]
 
 
 
-=== Using -drive if=none and -global ===
-
-Testing: -drive if=none,file=TEST_DIR/t.qcow2 -global isa-fdc.driveA=none0
-QEMU_PROG: warning: warning: property isa-fdc.driveA is deprecated
-Use -device floppy,unit=0,drive=... instead.
-
-          dev: isa-fdc, id ""
-            iobase = 1008 (0x3f0)
-            irq = 6 (0x6)
-            dma = 2 (0x2)
-            driveA = ""
-            driveB = ""
-            fdtypeA = "auto"
-            fdtypeB = "auto"
-            fallback = "288"
-            isa irq 6
-            bus: floppy-bus.0
-              type floppy-bus
-              dev: floppy, id ""
-                unit = 0 (0x0)
-                drive = "none0"
-                logical_block_size = 512 (512 B)
-                physical_block_size = 512 (512 B)
-                min_io_size = 0 (0 B)
-                opt_io_size = 0 (0 B)
-                discard_granularity = 4294967295 (4 GiB)
-                write-cache = "auto"
-                share-rw = false
-                drive-type = "144"
-none0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2)
-    Attached to:      /machine/unattached/device[N]
-    Removable device: not locked, tray closed
-    Cache mode:       writeback
-
-ide1-cd0: [not inserted]
-    Attached to:      /machine/unattached/device[N]
-    Removable device: not locked, tray closed
-
-sd0: [not inserted]
-    Removable device: not locked, tray closed
-(qemu) quit
-
-
-Testing: -drive if=none,file=TEST_DIR/t.qcow2 -global isa-fdc.driveB=none0
-QEMU_PROG: warning: warning: property isa-fdc.driveB is deprecated
-Use -device floppy,unit=1,drive=... instead.
-
-          dev: isa-fdc, id ""
-            iobase = 1008 (0x3f0)
-            irq = 6 (0x6)
-            dma = 2 (0x2)
-            driveA = ""
-            driveB = ""
-            fdtypeA = "auto"
-            fdtypeB = "auto"
-            fallback = "288"
-            isa irq 6
-            bus: floppy-bus.0
-              type floppy-bus
-              dev: floppy, id ""
-                unit = 1 (0x1)
-                drive = "none0"
-                logical_block_size = 512 (512 B)
-                physical_block_size = 512 (512 B)
-                min_io_size = 0 (0 B)
-                opt_io_size = 0 (0 B)
-                discard_granularity = 4294967295 (4 GiB)
-                write-cache = "auto"
-                share-rw = false
-                drive-type = "144"
-none0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2)
-    Attached to:      /machine/unattached/device[N]
-    Removable device: not locked, tray closed
-    Cache mode:       writeback
-
-ide1-cd0: [not inserted]
-    Attached to:      /machine/unattached/device[N]
-    Removable device: not locked, tray closed
-
-sd0: [not inserted]
-    Removable device: not locked, tray closed
-(qemu) quit
-
-
-Testing: -drive if=none,file=TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.qcow2.2 -global isa-fdc.driveA=none0 -global isa-fdc.driveB=none1
-QEMU_PROG: warning: warning: property isa-fdc.driveA is deprecated
-Use -device floppy,unit=0,drive=... instead.
-QEMU_PROG: warning: warning: property isa-fdc.driveB is deprecated
-Use -device floppy,unit=1,drive=... instead.
-
-          dev: isa-fdc, id ""
-            iobase = 1008 (0x3f0)
-            irq = 6 (0x6)
-            dma = 2 (0x2)
-            driveA = ""
-            driveB = ""
-            fdtypeA = "auto"
-            fdtypeB = "auto"
-            fallback = "288"
-            isa irq 6
-            bus: floppy-bus.0
-              type floppy-bus
-              dev: floppy, id ""
-                unit = 1 (0x1)
-                drive = "none1"
-                logical_block_size = 512 (512 B)
-                physical_block_size = 512 (512 B)
-                min_io_size = 0 (0 B)
-                opt_io_size = 0 (0 B)
-                discard_granularity = 4294967295 (4 GiB)
-                write-cache = "auto"
-                share-rw = false
-                drive-type = "144"
-              dev: floppy, id ""
-                unit = 0 (0x0)
-                drive = "none0"
-                logical_block_size = 512 (512 B)
-                physical_block_size = 512 (512 B)
-                min_io_size = 0 (0 B)
-                opt_io_size = 0 (0 B)
-                discard_granularity = 4294967295 (4 GiB)
-                write-cache = "auto"
-                share-rw = false
-                drive-type = "144"
-none0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2)
-    Attached to:      /machine/unattached/device[N]
-    Removable device: not locked, tray closed
-    Cache mode:       writeback
-
-none1 (NODE_NAME): TEST_DIR/t.qcow2.2 (qcow2)
-    Attached to:      /machine/unattached/device[N]
-    Removable device: not locked, tray closed
-    Cache mode:       writeback
-
-ide1-cd0: [not inserted]
-    Attached to:      /machine/unattached/device[N]
-    Removable device: not locked, tray closed
-
-sd0: [not inserted]
-    Removable device: not locked, tray closed
-(qemu) quit
-
-
-
 === Using -drive if=none and -device ===
 
 Testing: -drive if=none,file=TEST_DIR/t.qcow2 -device floppy,drive=none0
@@ -524,8 +364,6 @@ Testing: -drive if=none,file=TEST_DIR/t.qcow2 -device floppy,drive=none0
             iobase = 1008 (0x3f0)
             irq = 6 (0x6)
             dma = 2 (0x2)
-            driveA = ""
-            driveB = ""
             fdtypeA = "auto"
             fdtypeB = "auto"
             fallback = "288"
@@ -563,8 +401,6 @@ Testing: -drive if=none,file=TEST_DIR/t.qcow2 -device floppy,drive=none0,unit=1
             iobase = 1008 (0x3f0)
             irq = 6 (0x6)
             dma = 2 (0x2)
-            driveA = ""
-            driveB = ""
             fdtypeA = "auto"
             fdtypeB = "auto"
             fallback = "288"
@@ -602,8 +438,6 @@ Testing: -drive if=none,file=TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.qco
             iobase = 1008 (0x3f0)
             irq = 6 (0x6)
             dma = 2 (0x2)
-            driveA = ""
-            driveB = ""
             fdtypeA = "auto"
             fdtypeB = "auto"
             fallback = "288"
@@ -654,130 +488,6 @@ sd0: [not inserted]
 
 === Mixing -fdX and -global ===
 
-Testing: -fda TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.qcow2.2 -global isa-fdc.driveB=none0
-QEMU_PROG: warning: warning: property isa-fdc.driveB is deprecated
-Use -device floppy,unit=1,drive=... instead.
-
-          dev: isa-fdc, id ""
-            iobase = 1008 (0x3f0)
-            irq = 6 (0x6)
-            dma = 2 (0x2)
-            driveA = ""
-            driveB = ""
-            fdtypeA = "auto"
-            fdtypeB = "auto"
-            fallback = "288"
-            isa irq 6
-            bus: floppy-bus.0
-              type floppy-bus
-              dev: floppy, id ""
-                unit = 0 (0x0)
-                drive = "floppy0"
-                logical_block_size = 512 (512 B)
-                physical_block_size = 512 (512 B)
-                min_io_size = 0 (0 B)
-                opt_io_size = 0 (0 B)
-                discard_granularity = 4294967295 (4 GiB)
-                write-cache = "auto"
-                share-rw = false
-                drive-type = "144"
-              dev: floppy, id ""
-                unit = 1 (0x1)
-                drive = "none0"
-                logical_block_size = 512 (512 B)
-                physical_block_size = 512 (512 B)
-                min_io_size = 0 (0 B)
-                opt_io_size = 0 (0 B)
-                discard_granularity = 4294967295 (4 GiB)
-                write-cache = "auto"
-                share-rw = false
-                drive-type = "144"
-floppy0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2)
-    Attached to:      /machine/unattached/device[N]
-    Removable device: not locked, tray closed
-    Cache mode:       writeback
-
-none0 (NODE_NAME): TEST_DIR/t.qcow2.2 (qcow2)
-    Attached to:      /machine/unattached/device[N]
-    Removable device: not locked, tray closed
-    Cache mode:       writeback
-
-ide1-cd0: [not inserted]
-    Attached to:      /machine/unattached/device[N]
-    Removable device: not locked, tray closed
-
-sd0: [not inserted]
-    Removable device: not locked, tray closed
-(qemu) quit
-
-
-Testing: -fdb TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.qcow2.2 -global isa-fdc.driveA=none0
-QEMU_PROG: warning: warning: property isa-fdc.driveA is deprecated
-Use -device floppy,unit=0,drive=... instead.
-
-          dev: isa-fdc, id ""
-            iobase = 1008 (0x3f0)
-            irq = 6 (0x6)
-            dma = 2 (0x2)
-            driveA = ""
-            driveB = ""
-            fdtypeA = "auto"
-            fdtypeB = "auto"
-            fallback = "288"
-            isa irq 6
-            bus: floppy-bus.0
-              type floppy-bus
-              dev: floppy, id ""
-                unit = 1 (0x1)
-                drive = "floppy1"
-                logical_block_size = 512 (512 B)
-                physical_block_size = 512 (512 B)
-                min_io_size = 0 (0 B)
-                opt_io_size = 0 (0 B)
-                discard_granularity = 4294967295 (4 GiB)
-                write-cache = "auto"
-                share-rw = false
-                drive-type = "144"
-              dev: floppy, id ""
-                unit = 0 (0x0)
-                drive = "none0"
-                logical_block_size = 512 (512 B)
-                physical_block_size = 512 (512 B)
-                min_io_size = 0 (0 B)
-                opt_io_size = 0 (0 B)
-                discard_granularity = 4294967295 (4 GiB)
-                write-cache = "auto"
-                share-rw = false
-                drive-type = "144"
-floppy1 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2)
-    Attached to:      /machine/unattached/device[N]
-    Removable device: not locked, tray closed
-    Cache mode:       writeback
-
-none0 (NODE_NAME): TEST_DIR/t.qcow2.2 (qcow2)
-    Attached to:      /machine/unattached/device[N]
-    Removable device: not locked, tray closed
-    Cache mode:       writeback
-
-ide1-cd0: [not inserted]
-    Attached to:      /machine/unattached/device[N]
-    Removable device: not locked, tray closed
-
-sd0: [not inserted]
-    Removable device: not locked, tray closed
-(qemu) quit
-
-
-Testing: -fda TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.qcow2.2 -global isa-fdc.driveA=none0
-QEMU_PROG: warning: warning: property isa-fdc.driveA is deprecated
-Use -device floppy,unit=0,drive=... instead.
-QEMU_PROG: Floppy unit 0 is in use
-
-Testing: -fdb TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.qcow2.2 -global isa-fdc.driveB=none0
-QEMU_PROG: warning: warning: property isa-fdc.driveB is deprecated
-Use -device floppy,unit=1,drive=... instead.
-QEMU_PROG: Floppy unit 1 is in use
-
 Testing: -fda TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.qcow2.2 -global floppy.drive=none0
 QEMU_PROG: -global floppy.drive=... conflicts with drive=floppy0
 
@@ -790,8 +500,6 @@ Testing: -fda TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.qcow2.2 -device fl
             iobase = 1008 (0x3f0)
             irq = 6 (0x6)
             dma = 2 (0x2)
-            driveA = ""
-            driveB = ""
             fdtypeA = "auto"
             fdtypeB = "auto"
             fallback = "288"
@@ -845,8 +553,6 @@ Testing: -fda TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.qcow2.2 -device fl
             iobase = 1008 (0x3f0)
             irq = 6 (0x6)
             dma = 2 (0x2)
-            driveA = ""
-            driveB = ""
             fdtypeA = "auto"
             fdtypeB = "auto"
             fallback = "288"
@@ -900,8 +606,6 @@ Testing: -fdb TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.qcow2.2 -device fl
             iobase = 1008 (0x3f0)
             irq = 6 (0x6)
             dma = 2 (0x2)
-            driveA = ""
-            driveB = ""
             fdtypeA = "auto"
             fdtypeB = "auto"
             fallback = "288"
@@ -955,8 +659,6 @@ Testing: -fdb TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.qcow2.2 -device fl
             iobase = 1008 (0x3f0)
             irq = 6 (0x6)
             dma = 2 (0x2)
-            driveA = ""
-            driveB = ""
             fdtypeA = "auto"
             fdtypeB = "auto"
             fallback = "288"
@@ -1019,8 +721,6 @@ Testing: -drive if=floppy,file=TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.q
             iobase = 1008 (0x3f0)
             irq = 6 (0x6)
             dma = 2 (0x2)
-            driveA = ""
-            driveB = ""
             fdtypeA = "auto"
             fdtypeB = "auto"
             fallback = "288"
@@ -1074,8 +774,6 @@ Testing: -drive if=floppy,file=TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.q
             iobase = 1008 (0x3f0)
             irq = 6 (0x6)
             dma = 2 (0x2)
-            driveA = ""
-            driveB = ""
             fdtypeA = "auto"
             fdtypeB = "auto"
             fallback = "288"
@@ -1129,242 +827,12 @@ QEMU_PROG: -device floppy,drive=none0,unit=0: Floppy unit 0 is in use
 
 === Mixing -global and -device ===
 
-Testing: -drive if=none,file=TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.qcow2.2 -global isa-fdc.driveA=none0 -device floppy,drive=none1
-QEMU_PROG: warning: warning: property isa-fdc.driveA is deprecated
-Use -device floppy,unit=0,drive=... instead.
-
-          dev: isa-fdc, id ""
-            iobase = 1008 (0x3f0)
-            irq = 6 (0x6)
-            dma = 2 (0x2)
-            driveA = ""
-            driveB = ""
-            fdtypeA = "auto"
-            fdtypeB = "auto"
-            fallback = "288"
-            isa irq 6
-            bus: floppy-bus.0
-              type floppy-bus
-              dev: floppy, id ""
-                unit = 1 (0x1)
-                drive = "none1"
-                logical_block_size = 512 (512 B)
-                physical_block_size = 512 (512 B)
-                min_io_size = 0 (0 B)
-                opt_io_size = 0 (0 B)
-                discard_granularity = 4294967295 (4 GiB)
-                write-cache = "auto"
-                share-rw = false
-                drive-type = "144"
-              dev: floppy, id ""
-                unit = 0 (0x0)
-                drive = "none0"
-                logical_block_size = 512 (512 B)
-                physical_block_size = 512 (512 B)
-                min_io_size = 0 (0 B)
-                opt_io_size = 0 (0 B)
-                discard_granularity = 4294967295 (4 GiB)
-                write-cache = "auto"
-                share-rw = false
-                drive-type = "144"
-none0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2)
-    Attached to:      /machine/unattached/device[N]
-    Removable device: not locked, tray closed
-    Cache mode:       writeback
-
-none1 (NODE_NAME): TEST_DIR/t.qcow2.2 (qcow2)
-    Attached to:      /machine/peripheral-anon/device[N]
-    Removable device: not locked, tray closed
-    Cache mode:       writeback
-
-ide1-cd0: [not inserted]
-    Attached to:      /machine/unattached/device[N]
-    Removable device: not locked, tray closed
-
-sd0: [not inserted]
-    Removable device: not locked, tray closed
-(qemu) quit
-
-
-Testing: -drive if=none,file=TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.qcow2.2 -global isa-fdc.driveA=none0 -device floppy,drive=none1,unit=1
-QEMU_PROG: warning: warning: property isa-fdc.driveA is deprecated
-Use -device floppy,unit=0,drive=... instead.
-
-          dev: isa-fdc, id ""
-            iobase = 1008 (0x3f0)
-            irq = 6 (0x6)
-            dma = 2 (0x2)
-            driveA = ""
-            driveB = ""
-            fdtypeA = "auto"
-            fdtypeB = "auto"
-            fallback = "288"
-            isa irq 6
-            bus: floppy-bus.0
-              type floppy-bus
-              dev: floppy, id ""
-                unit = 1 (0x1)
-                drive = "none1"
-                logical_block_size = 512 (512 B)
-                physical_block_size = 512 (512 B)
-                min_io_size = 0 (0 B)
-                opt_io_size = 0 (0 B)
-                discard_granularity = 4294967295 (4 GiB)
-                write-cache = "auto"
-                share-rw = false
-                drive-type = "144"
-              dev: floppy, id ""
-                unit = 0 (0x0)
-                drive = "none0"
-                logical_block_size = 512 (512 B)
-                physical_block_size = 512 (512 B)
-                min_io_size = 0 (0 B)
-                opt_io_size = 0 (0 B)
-                discard_granularity = 4294967295 (4 GiB)
-                write-cache = "auto"
-                share-rw = false
-                drive-type = "144"
-none0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2)
-    Attached to:      /machine/unattached/device[N]
-    Removable device: not locked, tray closed
-    Cache mode:       writeback
-
-none1 (NODE_NAME): TEST_DIR/t.qcow2.2 (qcow2)
-    Attached to:      /machine/peripheral-anon/device[N]
-    Removable device: not locked, tray closed
-    Cache mode:       writeback
-
-ide1-cd0: [not inserted]
-    Attached to:      /machine/unattached/device[N]
-    Removable device: not locked, tray closed
-
-sd0: [not inserted]
-    Removable device: not locked, tray closed
-(qemu) quit
-
-
-Testing: -drive if=none,file=TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.qcow2.2 -global isa-fdc.driveB=none0 -device floppy,drive=none1
-QEMU_PROG: warning: warning: property isa-fdc.driveB is deprecated
-Use -device floppy,unit=1,drive=... instead.
-
-          dev: isa-fdc, id ""
-            iobase = 1008 (0x3f0)
-            irq = 6 (0x6)
-            dma = 2 (0x2)
-            driveA = ""
-            driveB = ""
-            fdtypeA = "auto"
-            fdtypeB = "auto"
-            fallback = "288"
-            isa irq 6
-            bus: floppy-bus.0
-              type floppy-bus
-              dev: floppy, id ""
-                unit = 0 (0x0)
-                drive = "none1"
-                logical_block_size = 512 (512 B)
-                physical_block_size = 512 (512 B)
-                min_io_size = 0 (0 B)
-                opt_io_size = 0 (0 B)
-                discard_granularity = 4294967295 (4 GiB)
-                write-cache = "auto"
-                share-rw = false
-                drive-type = "144"
-              dev: floppy, id ""
-                unit = 1 (0x1)
-                drive = "none0"
-                logical_block_size = 512 (512 B)
-                physical_block_size = 512 (512 B)
-                min_io_size = 0 (0 B)
-                opt_io_size = 0 (0 B)
-                discard_granularity = 4294967295 (4 GiB)
-                write-cache = "auto"
-                share-rw = false
-                drive-type = "144"
-none0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2)
-    Attached to:      /machine/unattached/device[N]
-    Removable device: not locked, tray closed
-    Cache mode:       writeback
-
-none1 (NODE_NAME): TEST_DIR/t.qcow2.2 (qcow2)
-    Attached to:      /machine/peripheral-anon/device[N]
-    Removable device: not locked, tray closed
-    Cache mode:       writeback
-
-ide1-cd0: [not inserted]
-    Attached to:      /machine/unattached/device[N]
-    Removable device: not locked, tray closed
-
-sd0: [not inserted]
-    Removable device: not locked, tray closed
-(qemu) quit
-
-
-Testing: -drive if=none,file=TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.qcow2.2 -global isa-fdc.driveB=none0 -device floppy,drive=none1,unit=0
-QEMU_PROG: warning: warning: property isa-fdc.driveB is deprecated
-Use -device floppy,unit=1,drive=... instead.
-
-          dev: isa-fdc, id ""
-            iobase = 1008 (0x3f0)
-            irq = 6 (0x6)
-            dma = 2 (0x2)
-            driveA = ""
-            driveB = ""
-            fdtypeA = "auto"
-            fdtypeB = "auto"
-            fallback = "288"
-            isa irq 6
-            bus: floppy-bus.0
-              type floppy-bus
-              dev: floppy, id ""
-                unit = 0 (0x0)
-                drive = "none1"
-                logical_block_size = 512 (512 B)
-                physical_block_size = 512 (512 B)
-                min_io_size = 0 (0 B)
-                opt_io_size = 0 (0 B)
-                discard_granularity = 4294967295 (4 GiB)
-                write-cache = "auto"
-                share-rw = false
-                drive-type = "144"
-              dev: floppy, id ""
-                unit = 1 (0x1)
-                drive = "none0"
-                logical_block_size = 512 (512 B)
-                physical_block_size = 512 (512 B)
-                min_io_size = 0 (0 B)
-                opt_io_size = 0 (0 B)
-                discard_granularity = 4294967295 (4 GiB)
-                write-cache = "auto"
-                share-rw = false
-                drive-type = "144"
-none0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2)
-    Attached to:      /machine/unattached/device[N]
-    Removable device: not locked, tray closed
-    Cache mode:       writeback
-
-none1 (NODE_NAME): TEST_DIR/t.qcow2.2 (qcow2)
-    Attached to:      /machine/peripheral-anon/device[N]
-    Removable device: not locked, tray closed
-    Cache mode:       writeback
-
-ide1-cd0: [not inserted]
-    Attached to:      /machine/unattached/device[N]
-    Removable device: not locked, tray closed
-
-sd0: [not inserted]
-    Removable device: not locked, tray closed
-(qemu) quit
-
-
 Testing: -drive if=none,file=TEST_DIR/t.qcow2 -global floppy.drive=none0 -device floppy,unit=0
 
           dev: isa-fdc, id ""
             iobase = 1008 (0x3f0)
             irq = 6 (0x6)
             dma = 2 (0x2)
-            driveA = ""
-            driveB = ""
             fdtypeA = "auto"
             fdtypeB = "auto"
             fallback = "288"
@@ -1396,16 +864,6 @@ sd0: [not inserted]
 (qemu) quit
 
 
-Testing: -drive if=none,file=TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.qcow2.2 -global isa-fdc.driveA=none0 -device floppy,drive=none1,unit=0
-QEMU_PROG: warning: warning: property isa-fdc.driveA is deprecated
-Use -device floppy,unit=0,drive=... instead.
-QEMU_PROG: -device floppy,drive=none1,unit=0: Floppy unit 0 is in use
-
-Testing: -drive if=none,file=TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.qcow2.2 -global isa-fdc.driveB=none0 -device floppy,drive=none1,unit=1
-QEMU_PROG: warning: warning: property isa-fdc.driveB is deprecated
-Use -device floppy,unit=1,drive=... instead.
-QEMU_PROG: -device floppy,drive=none1,unit=1: Floppy unit 1 is in use
-
 Testing: -drive if=none,file=TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.qcow2.2 -global floppy.drive=none0 -device floppy,drive=none1,unit=0
 QEMU_PROG: -device floppy,drive=none1,unit=0: -global floppy.drive=... conflicts with drive=none1
 
@@ -1430,9 +888,7 @@ QEMU_PROG: -device floppy,drive=floppy0: Property 'floppy.drive' can't find valu
 
 === Too many floppy drives ===
 
-Testing: -drive if=floppy,file=TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.qcow2.2 -drive if=none,file=TEST_DIR/t.qcow2.3 -global isa-fdc.driveB=none0 -device floppy,drive=none1
-QEMU_PROG: warning: warning: property isa-fdc.driveB is deprecated
-Use -device floppy,unit=1,drive=... instead.
+Testing: -drive if=floppy,file=TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.qcow2.2 -drive if=none,file=TEST_DIR/t.qcow2.3 -device floppy,drive=none0 -device floppy,drive=none1
 QEMU_PROG: -device floppy,drive=none1: Can't create floppy unit 2, bus supports only 2 units
 
 
@@ -1444,8 +900,6 @@ Testing: -device floppy
             iobase = 1008 (0x3f0)
             irq = 6 (0x6)
             dma = 2 (0x2)
-            driveA = ""
-            driveB = ""
             fdtypeA = "auto"
             fdtypeB = "auto"
             fallback = "288"
@@ -1470,8 +924,6 @@ Testing: -device floppy,drive-type=120
             iobase = 1008 (0x3f0)
             irq = 6 (0x6)
             dma = 2 (0x2)
-            driveA = ""
-            driveB = ""
             fdtypeA = "auto"
             fdtypeB = "auto"
             fallback = "288"
@@ -1496,8 +948,6 @@ Testing: -device floppy,drive-type=144
             iobase = 1008 (0x3f0)
             irq = 6 (0x6)
             dma = 2 (0x2)
-            driveA = ""
-            driveB = ""
             fdtypeA = "auto"
             fdtypeB = "auto"
             fallback = "288"
@@ -1522,8 +972,6 @@ Testing: -device floppy,drive-type=288
             iobase = 1008 (0x3f0)
             irq = 6 (0x6)
             dma = 2 (0x2)
-            driveA = ""
-            driveB = ""
             fdtypeA = "auto"
             fdtypeB = "auto"
             fallback = "288"
@@ -1551,8 +999,6 @@ Testing: -drive if=none,file=TEST_DIR/t.qcow2 -device floppy,drive=none0,drive-t
             iobase = 1008 (0x3f0)
             irq = 6 (0x6)
             dma = 2 (0x2)
-            driveA = ""
-            driveB = ""
             fdtypeA = "auto"
             fdtypeB = "auto"
             fallback = "288"
@@ -1590,8 +1036,6 @@ Testing: -drive if=none,file=TEST_DIR/t.qcow2 -device floppy,drive=none0,drive-t
             iobase = 1008 (0x3f0)
             irq = 6 (0x6)
             dma = 2 (0x2)
-            driveA = ""
-            driveB = ""
             fdtypeA = "auto"
             fdtypeB = "auto"
             fallback = "288"
@@ -1632,8 +1076,6 @@ Testing: -drive if=none,file=TEST_DIR/t.qcow2 -device floppy,drive=none0,logical
             iobase = 1008 (0x3f0)
             irq = 6 (0x6)
             dma = 2 (0x2)
-            driveA = ""
-            driveB = ""
             fdtypeA = "auto"
             fdtypeB = "auto"
             fallback = "288"
@@ -1671,8 +1113,6 @@ Testing: -drive if=none,file=TEST_DIR/t.qcow2 -device floppy,drive=none0,physica
             iobase = 1008 (0x3f0)
             irq = 6 (0x6)
             dma = 2 (0x2)
-            driveA = ""
-            driveB = ""
             fdtypeA = "auto"
             fdtypeB = "auto"
             fallback = "288"
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v3 3/4] fdc: Inline fdctrl_connect_drives() into fdctrl_realize_common()
  2021-03-09 16:12 [PATCH v3 0/4] Drop deprecated floppy config & bogus -drive if=T Markus Armbruster
  2021-03-09 16:12 ` [PATCH v3 1/4] docs/system/deprecated: Fix note on fdc drive properties Markus Armbruster
  2021-03-09 16:12 ` [PATCH v3 2/4] fdc: Drop deprecated floppy configuration Markus Armbruster
@ 2021-03-09 16:12 ` Markus Armbruster
  2021-03-09 16:15   ` Daniel P. Berrangé
  2021-03-09 18:25   ` Richard Henderson
  2021-03-09 16:12 ` [PATCH v3 4/4] blockdev: Drop deprecated bogus -drive interface type Markus Armbruster
  3 siblings, 2 replies; 14+ messages in thread
From: Markus Armbruster @ 2021-03-09 16:12 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, berrange, qemu-block, libvir-list, mreitz, jsnow

The previous commit rendered the name fdctrl_connect_drives() somewhat
misleading.  Get rid of it by inlining the (now pretty simple)
function into its only caller.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 hw/block/fdc.c | 23 ++++++++---------------
 1 file changed, 8 insertions(+), 15 deletions(-)

diff --git a/hw/block/fdc.c b/hw/block/fdc.c
index f978ddf647..32701c2bc5 100644
--- a/hw/block/fdc.c
+++ b/hw/block/fdc.c
@@ -2511,20 +2511,6 @@ void isa_fdc_init_drives(ISADevice *fdc, DriveInfo **fds)
     fdctrl_init_drives(&ISA_FDC(fdc)->state.bus, fds);
 }
 
-static void fdctrl_connect_drives(FDCtrl *fdctrl, DeviceState *fdc_dev,
-                                  Error **errp)
-{
-    unsigned int i;
-    FDrive *drive;
-
-    for (i = 0; i < MAX_FD; i++) {
-        drive = &fdctrl->drives[i];
-        drive->fdctrl = fdctrl;
-        fd_init(drive);
-        fd_revalidate(drive);
-    }
-}
-
 void fdctrl_init_sysbus(qemu_irq irq, int dma_chann,
                         hwaddr mmio_base, DriveInfo **fds)
 {
@@ -2565,6 +2551,7 @@ static void fdctrl_realize_common(DeviceState *dev, FDCtrl *fdctrl,
                                   Error **errp)
 {
     int i, j;
+    FDrive *drive;
     static int command_tables_inited = 0;
 
     if (fdctrl->fallback == FLOPPY_DRIVE_TYPE_AUTO) {
@@ -2604,7 +2591,13 @@ static void fdctrl_realize_common(DeviceState *dev, FDCtrl *fdctrl,
     }
 
     floppy_bus_create(fdctrl, &fdctrl->bus, dev);
-    fdctrl_connect_drives(fdctrl, dev, errp);
+
+    for (i = 0; i < MAX_FD; i++) {
+        drive = &fdctrl->drives[i];
+        drive->fdctrl = fdctrl;
+        fd_init(drive);
+        fd_revalidate(drive);
+    }
 }
 
 static const MemoryRegionPortio fdc_portio_list[] = {
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v3 4/4] blockdev: Drop deprecated bogus -drive interface type
  2021-03-09 16:12 [PATCH v3 0/4] Drop deprecated floppy config & bogus -drive if=T Markus Armbruster
                   ` (2 preceding siblings ...)
  2021-03-09 16:12 ` [PATCH v3 3/4] fdc: Inline fdctrl_connect_drives() into fdctrl_realize_common() Markus Armbruster
@ 2021-03-09 16:12 ` Markus Armbruster
  2021-03-09 16:18   ` Daniel P. Berrangé
  2021-03-11  5:00   ` John Snow
  3 siblings, 2 replies; 14+ messages in thread
From: Markus Armbruster @ 2021-03-09 16:12 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, berrange, qemu-block, libvir-list, mreitz, jsnow

Drop the crap deprecated in commit a1b40bda08 "blockdev: Deprecate
-drive with bogus interface type" (v5.1.0).

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 docs/system/deprecated.rst       |  7 ------
 docs/system/removed-features.rst |  7 ++++++
 include/sysemu/blockdev.h        |  1 -
 blockdev.c                       | 37 +++++++++++++-------------------
 softmmu/vl.c                     |  8 +------
 5 files changed, 23 insertions(+), 37 deletions(-)

diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst
index 601e9647a5..664ed60e9f 100644
--- a/docs/system/deprecated.rst
+++ b/docs/system/deprecated.rst
@@ -94,13 +94,6 @@ QEMU 5.1 has three options:
       to the user to load all the images they need.
  3. ``-bios <file>`` - Tells QEMU to load the specified file as the firmwrae.
 
-``-drive`` with bogus interface type (since 5.1)
-''''''''''''''''''''''''''''''''''''''''''''''''
-
-Drives with interface types other than ``if=none`` are for onboard
-devices.  It is possible to use drives the board doesn't pick up with
--device.  This usage is now deprecated.  Use ``if=none`` instead.
-
 Short-form boolean options (since 6.0)
 ''''''''''''''''''''''''''''''''''''''
 
diff --git a/docs/system/removed-features.rst b/docs/system/removed-features.rst
index 77e7ba1339..e6d2fbe798 100644
--- a/docs/system/removed-features.rst
+++ b/docs/system/removed-features.rst
@@ -87,6 +87,13 @@ becomes
     -device isa-fdc,...
     -device floppy,unit=1,drive=...
 
+``-drive`` with bogus interface type (removed in 6.0)
+'''''''''''''''''''''''''''''''''''''''''''''''''''''
+
+Drives with interface types other than ``if=none`` are for onboard
+devices.  Drives the board doesn't pick up can no longer be used with
+-device.  Use ``if=none`` instead.
+
 QEMU Machine Protocol (QMP) commands
 ------------------------------------
 
diff --git a/include/sysemu/blockdev.h b/include/sysemu/blockdev.h
index 3b5fcda08d..32c2d6023c 100644
--- a/include/sysemu/blockdev.h
+++ b/include/sysemu/blockdev.h
@@ -35,7 +35,6 @@ struct DriveInfo {
     bool is_default;            /* Added by default_drive() ?  */
     int media_cd;
     QemuOpts *opts;
-    bool claimed_by_board;
     QTAILQ_ENTRY(DriveInfo) next;
 };
 
diff --git a/blockdev.c b/blockdev.c
index cd438e60e3..2e01889cff 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -240,19 +240,10 @@ DriveInfo *drive_get(BlockInterfaceType type, int bus, int unit)
     return NULL;
 }
 
-void drive_mark_claimed_by_board(void)
-{
-    BlockBackend *blk;
-    DriveInfo *dinfo;
-
-    for (blk = blk_next(NULL); blk; blk = blk_next(blk)) {
-        dinfo = blk_legacy_dinfo(blk);
-        if (dinfo && blk_get_attached_dev(blk)) {
-            dinfo->claimed_by_board = true;
-        }
-    }
-}
-
+/*
+ * Check board claimed all -drive that are meant to be claimed.
+ * Fatal error if any remain unclaimed.
+ */
 void drive_check_orphaned(void)
 {
     BlockBackend *blk;
@@ -262,7 +253,17 @@ void drive_check_orphaned(void)
 
     for (blk = blk_next(NULL); blk; blk = blk_next(blk)) {
         dinfo = blk_legacy_dinfo(blk);
-        if (dinfo->is_default || dinfo->type == IF_NONE) {
+        /*
+         * Ignore default drives, because we create certain default
+         * drives unconditionally, then leave them unclaimed.  Not the
+         * users fault.
+         * Ignore IF_VIRTIO, because it gets desugared into -device,
+         * so we can leave failing to -device.
+         * Ignore IF_NONE, because leaving unclaimed IF_NONE remains
+         * available for device_add is a feature.
+         */
+        if (dinfo->is_default || dinfo->type == IF_VIRTIO
+            || dinfo->type == IF_NONE) {
             continue;
         }
         if (!blk_get_attached_dev(blk)) {
@@ -273,14 +274,6 @@ void drive_check_orphaned(void)
                          if_name[dinfo->type], dinfo->bus, dinfo->unit);
             loc_pop(&loc);
             orphans = true;
-            continue;
-        }
-        if (!dinfo->claimed_by_board && dinfo->type != IF_VIRTIO) {
-            loc_push_none(&loc);
-            qemu_opts_loc_restore(dinfo->opts);
-            warn_report("bogus if=%s is deprecated, use if=none",
-                        if_name[dinfo->type]);
-            loc_pop(&loc);
         }
     }
 
diff --git a/softmmu/vl.c b/softmmu/vl.c
index ff488ea3e7..7453611152 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -2460,13 +2460,7 @@ static void qemu_init_board(void)
     /* From here on we enter MACHINE_PHASE_INITIALIZED.  */
     machine_run_board_init(current_machine);
 
-    /*
-     * TODO To drop support for deprecated bogus if=..., move
-     * drive_check_orphaned() here, replacing this call.  Also drop
-     * its deprecation warning, along with DriveInfo member
-     * @claimed_by_board.
-     */
-    drive_mark_claimed_by_board();
+    drive_check_orphaned();
 
     realtime_init();
 
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH v3 1/4] docs/system/deprecated: Fix note on fdc drive properties
  2021-03-09 16:12 ` [PATCH v3 1/4] docs/system/deprecated: Fix note on fdc drive properties Markus Armbruster
@ 2021-03-09 16:13   ` Daniel P. Berrangé
  0 siblings, 0 replies; 14+ messages in thread
From: Daniel P. Berrangé @ 2021-03-09 16:13 UTC (permalink / raw)
  To: Markus Armbruster
  Cc: kwolf, qemu-block, libvir-list, qemu-devel, mreitz, jsnow

On Tue, Mar 09, 2021 at 05:12:10PM +0100, Markus Armbruster wrote:
> Commit 4a27a638e7 "fdc: Deprecate configuring floppies with -global
> isa-fdc" actually deprecated any use of floppy controller driver
> properties, not just with -global.  Correct the deprecation note
> accordingly.
> 
> Fixes: 4a27a638e718b445648de6b27c709353551d9b44
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>  docs/system/deprecated.rst | 33 ++++++++++++++++++++++++++++-----
>  1 file changed, 28 insertions(+), 5 deletions(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


Regards,
Daniel
-- 
|: 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 :|



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v3 2/4] fdc: Drop deprecated floppy configuration
  2021-03-09 16:12 ` [PATCH v3 2/4] fdc: Drop deprecated floppy configuration Markus Armbruster
@ 2021-03-09 16:14   ` Daniel P. Berrangé
  0 siblings, 0 replies; 14+ messages in thread
From: Daniel P. Berrangé @ 2021-03-09 16:14 UTC (permalink / raw)
  To: Markus Armbruster
  Cc: kwolf, qemu-block, libvir-list, qemu-devel, mreitz, jsnow

On Tue, Mar 09, 2021 at 05:12:11PM +0100, Markus Armbruster wrote:
> Drop the crap deprecated in commit 4a27a638e7 "fdc: Deprecate
> configuring floppies with -global isa-fdc" (v5.1.0).
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>  docs/system/deprecated.rst       |  49 ---
>  docs/system/removed-features.rst |  49 +++
>  hw/block/fdc.c                   |  54 +--
>  tests/qemu-iotests/172           |  31 +-
>  tests/qemu-iotests/172.out       | 562 +------------------------------
>  5 files changed, 53 insertions(+), 692 deletions(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


Regards,
Daniel
-- 
|: 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 :|



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v3 3/4] fdc: Inline fdctrl_connect_drives() into fdctrl_realize_common()
  2021-03-09 16:12 ` [PATCH v3 3/4] fdc: Inline fdctrl_connect_drives() into fdctrl_realize_common() Markus Armbruster
@ 2021-03-09 16:15   ` Daniel P. Berrangé
  2021-03-09 18:25   ` Richard Henderson
  1 sibling, 0 replies; 14+ messages in thread
From: Daniel P. Berrangé @ 2021-03-09 16:15 UTC (permalink / raw)
  To: Markus Armbruster
  Cc: kwolf, qemu-block, libvir-list, qemu-devel, mreitz, jsnow

On Tue, Mar 09, 2021 at 05:12:12PM +0100, Markus Armbruster wrote:
> The previous commit rendered the name fdctrl_connect_drives() somewhat
> misleading.  Get rid of it by inlining the (now pretty simple)
> function into its only caller.
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>  hw/block/fdc.c | 23 ++++++++---------------
>  1 file changed, 8 insertions(+), 15 deletions(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


Regards,
Daniel
-- 
|: 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 :|



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v3 4/4] blockdev: Drop deprecated bogus -drive interface type
  2021-03-09 16:12 ` [PATCH v3 4/4] blockdev: Drop deprecated bogus -drive interface type Markus Armbruster
@ 2021-03-09 16:18   ` Daniel P. Berrangé
  2021-03-10  8:10     ` Markus Armbruster
  2021-03-11  5:00   ` John Snow
  1 sibling, 1 reply; 14+ messages in thread
From: Daniel P. Berrangé @ 2021-03-09 16:18 UTC (permalink / raw)
  To: Markus Armbruster
  Cc: kwolf, qemu-block, libvir-list, qemu-devel, mreitz, jsnow

On Tue, Mar 09, 2021 at 05:12:13PM +0100, Markus Armbruster wrote:
> Drop the crap deprecated in commit a1b40bda08 "blockdev: Deprecate
> -drive with bogus interface type" (v5.1.0).
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>  docs/system/deprecated.rst       |  7 ------
>  docs/system/removed-features.rst |  7 ++++++
>  include/sysemu/blockdev.h        |  1 -
>  blockdev.c                       | 37 +++++++++++++-------------------
>  softmmu/vl.c                     |  8 +------
>  5 files changed, 23 insertions(+), 37 deletions(-)
> 
> diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst
> index 601e9647a5..664ed60e9f 100644
> --- a/docs/system/deprecated.rst
> +++ b/docs/system/deprecated.rst
> @@ -94,13 +94,6 @@ QEMU 5.1 has three options:
>        to the user to load all the images they need.
>   3. ``-bios <file>`` - Tells QEMU to load the specified file as the firmwrae.
>  
> -``-drive`` with bogus interface type (since 5.1)
> -''''''''''''''''''''''''''''''''''''''''''''''''
> -
> -Drives with interface types other than ``if=none`` are for onboard
> -devices.  It is possible to use drives the board doesn't pick up with
> --device.  This usage is now deprecated.  Use ``if=none`` instead.
> -
>  Short-form boolean options (since 6.0)
>  ''''''''''''''''''''''''''''''''''''''
>  
> diff --git a/docs/system/removed-features.rst b/docs/system/removed-features.rst
> index 77e7ba1339..e6d2fbe798 100644
> --- a/docs/system/removed-features.rst
> +++ b/docs/system/removed-features.rst
> @@ -87,6 +87,13 @@ becomes
>      -device isa-fdc,...
>      -device floppy,unit=1,drive=...
>  
> +``-drive`` with bogus interface type (removed in 6.0)
> +'''''''''''''''''''''''''''''''''''''''''''''''''''''
> +
> +Drives with interface types other than ``if=none`` are for onboard
> +devices.  Drives the board doesn't pick up can no longer be used with
> +-device.  Use ``if=none`` instead.
> +
>  QEMU Machine Protocol (QMP) commands
>  ------------------------------------
>  
> diff --git a/include/sysemu/blockdev.h b/include/sysemu/blockdev.h
> index 3b5fcda08d..32c2d6023c 100644
> --- a/include/sysemu/blockdev.h
> +++ b/include/sysemu/blockdev.h
> @@ -35,7 +35,6 @@ struct DriveInfo {
>      bool is_default;            /* Added by default_drive() ?  */
>      int media_cd;
>      QemuOpts *opts;
> -    bool claimed_by_board;
>      QTAILQ_ENTRY(DriveInfo) next;
>  };
>  
> diff --git a/blockdev.c b/blockdev.c
> index cd438e60e3..2e01889cff 100644
> --- a/blockdev.c
> +++ b/blockdev.c
> @@ -240,19 +240,10 @@ DriveInfo *drive_get(BlockInterfaceType type, int bus, int unit)
>      return NULL;
>  }
>  
> -void drive_mark_claimed_by_board(void)
> -{
> -    BlockBackend *blk;
> -    DriveInfo *dinfo;
> -
> -    for (blk = blk_next(NULL); blk; blk = blk_next(blk)) {
> -        dinfo = blk_legacy_dinfo(blk);
> -        if (dinfo && blk_get_attached_dev(blk)) {
> -            dinfo->claimed_by_board = true;
> -        }
> -    }
> -}
> -
> +/*
> + * Check board claimed all -drive that are meant to be claimed.
> + * Fatal error if any remain unclaimed.
> + */
>  void drive_check_orphaned(void)
>  {
>      BlockBackend *blk;
> @@ -262,7 +253,17 @@ void drive_check_orphaned(void)
>  
>      for (blk = blk_next(NULL); blk; blk = blk_next(blk)) {
>          dinfo = blk_legacy_dinfo(blk);
> -        if (dinfo->is_default || dinfo->type == IF_NONE) {
> +        /*
> +         * Ignore default drives, because we create certain default
> +         * drives unconditionally, then leave them unclaimed.  Not the
> +         * users fault.
> +         * Ignore IF_VIRTIO, because it gets desugared into -device,
> +         * so we can leave failing to -device.
> +         * Ignore IF_NONE, because leaving unclaimed IF_NONE remains
> +         * available for device_add is a feature.
> +         */
> +        if (dinfo->is_default || dinfo->type == IF_VIRTIO
> +            || dinfo->type == IF_NONE) {
>              continue;
>          }
>          if (!blk_get_attached_dev(blk)) {
> @@ -273,14 +274,6 @@ void drive_check_orphaned(void)
>                           if_name[dinfo->type], dinfo->bus, dinfo->unit);
>              loc_pop(&loc);
>              orphans = true;
> -            continue;
> -        }
> -        if (!dinfo->claimed_by_board && dinfo->type != IF_VIRTIO) {
> -            loc_push_none(&loc);
> -            qemu_opts_loc_restore(dinfo->opts);
> -            warn_report("bogus if=%s is deprecated, use if=none",
> -                        if_name[dinfo->type]);
> -            loc_pop(&loc);
>          }
>      }
>  
> diff --git a/softmmu/vl.c b/softmmu/vl.c
> index ff488ea3e7..7453611152 100644
> --- a/softmmu/vl.c
> +++ b/softmmu/vl.c
> @@ -2460,13 +2460,7 @@ static void qemu_init_board(void)
>      /* From here on we enter MACHINE_PHASE_INITIALIZED.  */
>      machine_run_board_init(current_machine);
>  
> -    /*
> -     * TODO To drop support for deprecated bogus if=..., move
> -     * drive_check_orphaned() here, replacing this call.  Also drop
> -     * its deprecation warning, along with DriveInfo member
> -     * @claimed_by_board.
> -     */
> -    drive_mark_claimed_by_board();
> +    drive_check_orphaned();

This method is already called by qemu_machine_creation_done(), which is
invoked shortly after this qemu_init_board() is run.

So either this added instance, or the later call to drive_check_orphaned
feels redundant

Regards,
Daniel
-- 
|: 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 :|



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v3 3/4] fdc: Inline fdctrl_connect_drives() into fdctrl_realize_common()
  2021-03-09 16:12 ` [PATCH v3 3/4] fdc: Inline fdctrl_connect_drives() into fdctrl_realize_common() Markus Armbruster
  2021-03-09 16:15   ` Daniel P. Berrangé
@ 2021-03-09 18:25   ` Richard Henderson
  2021-03-10  8:13     ` Markus Armbruster
  1 sibling, 1 reply; 14+ messages in thread
From: Richard Henderson @ 2021-03-09 18:25 UTC (permalink / raw)
  To: Markus Armbruster, qemu-devel
  Cc: kwolf, berrange, qemu-block, libvir-list, mreitz, jsnow

On 3/9/21 8:12 AM, Markus Armbruster wrote:
> @@ -2565,6 +2551,7 @@ static void fdctrl_realize_common(DeviceState *dev, FDCtrl *fdctrl,
>                                     Error **errp)
>   {
>       int i, j;
> +    FDrive *drive;
>       static int command_tables_inited = 0;
>   
>       if (fdctrl->fallback == FLOPPY_DRIVE_TYPE_AUTO) {
> @@ -2604,7 +2591,13 @@ static void fdctrl_realize_common(DeviceState *dev, FDCtrl *fdctrl,
>       }
>   
>       floppy_bus_create(fdctrl, &fdctrl->bus, dev);
> -    fdctrl_connect_drives(fdctrl, dev, errp);
> +
> +    for (i = 0; i < MAX_FD; i++) {
> +        drive = &fdctrl->drives[i];

FWIW, the declaration could be local to this loop.

r~


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v3 4/4] blockdev: Drop deprecated bogus -drive interface type
  2021-03-09 16:18   ` Daniel P. Berrangé
@ 2021-03-10  8:10     ` Markus Armbruster
  0 siblings, 0 replies; 14+ messages in thread
From: Markus Armbruster @ 2021-03-10  8:10 UTC (permalink / raw)
  To: Daniel P. Berrangé
  Cc: kwolf, qemu-block, libvir-list, qemu-devel, mreitz, jsnow

Daniel P. Berrangé <berrange@redhat.com> writes:

> On Tue, Mar 09, 2021 at 05:12:13PM +0100, Markus Armbruster wrote:
>> Drop the crap deprecated in commit a1b40bda08 "blockdev: Deprecate
>> -drive with bogus interface type" (v5.1.0).
>> 
>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>> ---
>>  docs/system/deprecated.rst       |  7 ------
>>  docs/system/removed-features.rst |  7 ++++++
>>  include/sysemu/blockdev.h        |  1 -
>>  blockdev.c                       | 37 +++++++++++++-------------------
>>  softmmu/vl.c                     |  8 +------
>>  5 files changed, 23 insertions(+), 37 deletions(-)
>> 
>> diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst
>> index 601e9647a5..664ed60e9f 100644
>> --- a/docs/system/deprecated.rst
>> +++ b/docs/system/deprecated.rst
>> @@ -94,13 +94,6 @@ QEMU 5.1 has three options:
>>        to the user to load all the images they need.
>>   3. ``-bios <file>`` - Tells QEMU to load the specified file as the firmwrae.
>>  
>> -``-drive`` with bogus interface type (since 5.1)
>> -''''''''''''''''''''''''''''''''''''''''''''''''
>> -
>> -Drives with interface types other than ``if=none`` are for onboard
>> -devices.  It is possible to use drives the board doesn't pick up with
>> --device.  This usage is now deprecated.  Use ``if=none`` instead.
>> -
>>  Short-form boolean options (since 6.0)
>>  ''''''''''''''''''''''''''''''''''''''
>>  
>> diff --git a/docs/system/removed-features.rst b/docs/system/removed-features.rst
>> index 77e7ba1339..e6d2fbe798 100644
>> --- a/docs/system/removed-features.rst
>> +++ b/docs/system/removed-features.rst
>> @@ -87,6 +87,13 @@ becomes
>>      -device isa-fdc,...
>>      -device floppy,unit=1,drive=...
>>  
>> +``-drive`` with bogus interface type (removed in 6.0)
>> +'''''''''''''''''''''''''''''''''''''''''''''''''''''
>> +
>> +Drives with interface types other than ``if=none`` are for onboard
>> +devices.  Drives the board doesn't pick up can no longer be used with
>> +-device.  Use ``if=none`` instead.
>> +
>>  QEMU Machine Protocol (QMP) commands
>>  ------------------------------------
>>  
>> diff --git a/include/sysemu/blockdev.h b/include/sysemu/blockdev.h
>> index 3b5fcda08d..32c2d6023c 100644
>> --- a/include/sysemu/blockdev.h
>> +++ b/include/sysemu/blockdev.h
>> @@ -35,7 +35,6 @@ struct DriveInfo {
>>      bool is_default;            /* Added by default_drive() ?  */
>>      int media_cd;
>>      QemuOpts *opts;
>> -    bool claimed_by_board;
>>      QTAILQ_ENTRY(DriveInfo) next;
>>  };
>>  
>> diff --git a/blockdev.c b/blockdev.c
>> index cd438e60e3..2e01889cff 100644
>> --- a/blockdev.c
>> +++ b/blockdev.c
>> @@ -240,19 +240,10 @@ DriveInfo *drive_get(BlockInterfaceType type, int bus, int unit)
>>      return NULL;
>>  }
>>  
>> -void drive_mark_claimed_by_board(void)
>> -{
>> -    BlockBackend *blk;
>> -    DriveInfo *dinfo;
>> -
>> -    for (blk = blk_next(NULL); blk; blk = blk_next(blk)) {
>> -        dinfo = blk_legacy_dinfo(blk);
>> -        if (dinfo && blk_get_attached_dev(blk)) {
>> -            dinfo->claimed_by_board = true;
>> -        }
>> -    }
>> -}
>> -
>> +/*
>> + * Check board claimed all -drive that are meant to be claimed.
>> + * Fatal error if any remain unclaimed.
>> + */
>>  void drive_check_orphaned(void)
>>  {
>>      BlockBackend *blk;
>> @@ -262,7 +253,17 @@ void drive_check_orphaned(void)
>>  
>>      for (blk = blk_next(NULL); blk; blk = blk_next(blk)) {
>>          dinfo = blk_legacy_dinfo(blk);
>> -        if (dinfo->is_default || dinfo->type == IF_NONE) {
>> +        /*
>> +         * Ignore default drives, because we create certain default
>> +         * drives unconditionally, then leave them unclaimed.  Not the
>> +         * users fault.
>> +         * Ignore IF_VIRTIO, because it gets desugared into -device,
>> +         * so we can leave failing to -device.
>> +         * Ignore IF_NONE, because leaving unclaimed IF_NONE remains
>> +         * available for device_add is a feature.
>> +         */
>> +        if (dinfo->is_default || dinfo->type == IF_VIRTIO
>> +            || dinfo->type == IF_NONE) {
>>              continue;
>>          }
>>          if (!blk_get_attached_dev(blk)) {
>> @@ -273,14 +274,6 @@ void drive_check_orphaned(void)
>>                           if_name[dinfo->type], dinfo->bus, dinfo->unit);
>>              loc_pop(&loc);
>>              orphans = true;
>> -            continue;
>> -        }
>> -        if (!dinfo->claimed_by_board && dinfo->type != IF_VIRTIO) {
>> -            loc_push_none(&loc);
>> -            qemu_opts_loc_restore(dinfo->opts);
>> -            warn_report("bogus if=%s is deprecated, use if=none",
>> -                        if_name[dinfo->type]);
>> -            loc_pop(&loc);
>>          }
>>      }
>>  
>> diff --git a/softmmu/vl.c b/softmmu/vl.c
>> index ff488ea3e7..7453611152 100644
>> --- a/softmmu/vl.c
>> +++ b/softmmu/vl.c
>> @@ -2460,13 +2460,7 @@ static void qemu_init_board(void)
>>      /* From here on we enter MACHINE_PHASE_INITIALIZED.  */
>>      machine_run_board_init(current_machine);
>>  
>> -    /*
>> -     * TODO To drop support for deprecated bogus if=..., move
>> -     * drive_check_orphaned() here, replacing this call.  Also drop
>> -     * its deprecation warning, along with DriveInfo member
>> -     * @claimed_by_board.
>> -     */
>> -    drive_mark_claimed_by_board();
>> +    drive_check_orphaned();
>
> This method is already called by qemu_machine_creation_done(), which is
> invoked shortly after this qemu_init_board() is run.
>
> So either this added instance, or the later call to drive_check_orphaned
> feels redundant

You're right.

I'll drop the one in qemu_machine_creation_done().  Rationale:

* Before the patch, we reject -drive if=T when T != none and nothing
  claimed it.  We warn unless the board claimed it.  "Nothing claimed
  it" is known only after qemu_create_cli_devices().

* After the patch, we reject -drive if=T when T != none and the board
  didn't claim it.  This is known earlier, after
  machine_run_board_init().



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v3 3/4] fdc: Inline fdctrl_connect_drives() into fdctrl_realize_common()
  2021-03-09 18:25   ` Richard Henderson
@ 2021-03-10  8:13     ` Markus Armbruster
  0 siblings, 0 replies; 14+ messages in thread
From: Markus Armbruster @ 2021-03-10  8:13 UTC (permalink / raw)
  To: Richard Henderson
  Cc: kwolf, berrange, qemu-block, libvir-list, qemu-devel, mreitz, jsnow

Richard Henderson <richard.henderson@linaro.org> writes:

> On 3/9/21 8:12 AM, Markus Armbruster wrote:
>> @@ -2565,6 +2551,7 @@ static void fdctrl_realize_common(DeviceState *dev, FDCtrl *fdctrl,
>>                                     Error **errp)
>>   {
>>       int i, j;
>> +    FDrive *drive;
>>       static int command_tables_inited = 0;
>>         if (fdctrl->fallback == FLOPPY_DRIVE_TYPE_AUTO) {
>> @@ -2604,7 +2591,13 @@ static void fdctrl_realize_common(DeviceState *dev, FDCtrl *fdctrl,
>>       }
>>         floppy_bus_create(fdctrl, &fdctrl->bus, dev);
>> -    fdctrl_connect_drives(fdctrl, dev, errp);
>> +
>> +    for (i = 0; i < MAX_FD; i++) {
>> +        drive = &fdctrl->drives[i];
>
> FWIW, the declaration could be local to this loop.

Old-school habits.  John, got a preference?



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v3 4/4] blockdev: Drop deprecated bogus -drive interface type
  2021-03-09 16:12 ` [PATCH v3 4/4] blockdev: Drop deprecated bogus -drive interface type Markus Armbruster
  2021-03-09 16:18   ` Daniel P. Berrangé
@ 2021-03-11  5:00   ` John Snow
  2021-03-11  6:29     ` Markus Armbruster
  1 sibling, 1 reply; 14+ messages in thread
From: John Snow @ 2021-03-11  5:00 UTC (permalink / raw)
  To: Markus Armbruster, qemu-devel
  Cc: kwolf, libvir-list, berrange, qemu-block, mreitz

On 3/9/21 11:12 AM, Markus Armbruster wrote:
> Drop the crap deprecated in commit a1b40bda08 "blockdev: Deprecate
> -drive with bogus interface type" (v5.1.0).
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>   docs/system/deprecated.rst       |  7 ------
>   docs/system/removed-features.rst |  7 ++++++
>   include/sysemu/blockdev.h        |  1 -
>   blockdev.c                       | 37 +++++++++++++-------------------
>   softmmu/vl.c                     |  8 +------
>   5 files changed, 23 insertions(+), 37 deletions(-)
> 
> diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst
> index 601e9647a5..664ed60e9f 100644
> --- a/docs/system/deprecated.rst
> +++ b/docs/system/deprecated.rst
> @@ -94,13 +94,6 @@ QEMU 5.1 has three options:
>         to the user to load all the images they need.
>    3. ``-bios <file>`` - Tells QEMU to load the specified file as the firmwrae.
>   
> -``-drive`` with bogus interface type (since 5.1)
> -''''''''''''''''''''''''''''''''''''''''''''''''
> -
> -Drives with interface types other than ``if=none`` are for onboard
> -devices.  It is possible to use drives the board doesn't pick up with
> --device.  This usage is now deprecated.  Use ``if=none`` instead.
> -
>   Short-form boolean options (since 6.0)
>   ''''''''''''''''''''''''''''''''''''''
>   
> diff --git a/docs/system/removed-features.rst b/docs/system/removed-features.rst
> index 77e7ba1339..e6d2fbe798 100644
> --- a/docs/system/removed-features.rst
> +++ b/docs/system/removed-features.rst
> @@ -87,6 +87,13 @@ becomes
>       -device isa-fdc,...
>       -device floppy,unit=1,drive=...
>   
> +``-drive`` with bogus interface type (removed in 6.0)
> +'''''''''''''''''''''''''''''''''''''''''''''''''''''
> +
> +Drives with interface types other than ``if=none`` are for onboard
> +devices.  Drives the board doesn't pick up can no longer be used with
> +-device.  Use ``if=none`` instead.
> +
>   QEMU Machine Protocol (QMP) commands
>   ------------------------------------
>   
> diff --git a/include/sysemu/blockdev.h b/include/sysemu/blockdev.h
> index 3b5fcda08d..32c2d6023c 100644
> --- a/include/sysemu/blockdev.h
> +++ b/include/sysemu/blockdev.h
> @@ -35,7 +35,6 @@ struct DriveInfo {
>       bool is_default;            /* Added by default_drive() ?  */
>       int media_cd;
>       QemuOpts *opts;
> -    bool claimed_by_board;
>       QTAILQ_ENTRY(DriveInfo) next;
>   };
>   
> diff --git a/blockdev.c b/blockdev.c
> index cd438e60e3..2e01889cff 100644
> --- a/blockdev.c
> +++ b/blockdev.c
> @@ -240,19 +240,10 @@ DriveInfo *drive_get(BlockInterfaceType type, int bus, int unit)
>       return NULL;
>   }
>   
> -void drive_mark_claimed_by_board(void)
> -{
> -    BlockBackend *blk;
> -    DriveInfo *dinfo;
> -
> -    for (blk = blk_next(NULL); blk; blk = blk_next(blk)) {
> -        dinfo = blk_legacy_dinfo(blk);
> -        if (dinfo && blk_get_attached_dev(blk)) {
> -            dinfo->claimed_by_board = true;
> -        }
> -    }
> -}
> -
> +/*
> + * Check board claimed all -drive that are meant to be claimed.
> + * Fatal error if any remain unclaimed.
> + */
>   void drive_check_orphaned(void)
>   {
>       BlockBackend *blk;
> @@ -262,7 +253,17 @@ void drive_check_orphaned(void)
>   
>       for (blk = blk_next(NULL); blk; blk = blk_next(blk)) {
>           dinfo = blk_legacy_dinfo(blk);
> -        if (dinfo->is_default || dinfo->type == IF_NONE) {
> +        /*
> +         * Ignore default drives, because we create certain default
> +         * drives unconditionally, then leave them unclaimed.  Not the
> +         * users fault.

"user's" ?

> +         * Ignore IF_VIRTIO, because it gets desugared into -device,
> +         * so we can leave failing to -device.
> +         * Ignore IF_NONE, because leaving unclaimed IF_NONE remains
> +         * available for device_add is a feature.

Do you mean "as a feature" ?

> +         */
> +        if (dinfo->is_default || dinfo->type == IF_VIRTIO
> +            || dinfo->type == IF_NONE) {
>               continue;
>           }
>           if (!blk_get_attached_dev(blk)) {
> @@ -273,14 +274,6 @@ void drive_check_orphaned(void)
>                            if_name[dinfo->type], dinfo->bus, dinfo->unit);
>               loc_pop(&loc);
>               orphans = true;
> -            continue;
> -        }
> -        if (!dinfo->claimed_by_board && dinfo->type != IF_VIRTIO) {
> -            loc_push_none(&loc);
> -            qemu_opts_loc_restore(dinfo->opts);
> -            warn_report("bogus if=%s is deprecated, use if=none",
> -                        if_name[dinfo->type]);
> -            loc_pop(&loc);
>           }
>       }
>   
> diff --git a/softmmu/vl.c b/softmmu/vl.c
> index ff488ea3e7..7453611152 100644
> --- a/softmmu/vl.c
> +++ b/softmmu/vl.c
> @@ -2460,13 +2460,7 @@ static void qemu_init_board(void)
>       /* From here on we enter MACHINE_PHASE_INITIALIZED.  */
>       machine_run_board_init(current_machine);
>   
> -    /*
> -     * TODO To drop support for deprecated bogus if=..., move
> -     * drive_check_orphaned() here, replacing this call.  Also drop
> -     * its deprecation warning, along with DriveInfo member
> -     * @claimed_by_board.
> -     */
> -    drive_mark_claimed_by_board();
> +    drive_check_orphaned();
>   
>       realtime_init();
>   
> 

Rest looks okay as far as I am concerned, pending your response to Dan's 
remark.

(Sorry for being AWOL here. Thank you for taking the time to clean it up 
as you have; it feels like closing a book on some of the first reviews I 
ever got @ RH when I put the first orphan check in aeons ago! I think 
only the whitespace is left by now, haha.)

--js



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v3 4/4] blockdev: Drop deprecated bogus -drive interface type
  2021-03-11  5:00   ` John Snow
@ 2021-03-11  6:29     ` Markus Armbruster
  0 siblings, 0 replies; 14+ messages in thread
From: Markus Armbruster @ 2021-03-11  6:29 UTC (permalink / raw)
  To: John Snow; +Cc: kwolf, berrange, qemu-block, libvir-list, qemu-devel, mreitz

John Snow <jsnow@redhat.com> writes:

> On 3/9/21 11:12 AM, Markus Armbruster wrote:
>> Drop the crap deprecated in commit a1b40bda08 "blockdev: Deprecate
>> -drive with bogus interface type" (v5.1.0).
>> 
>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>> ---
>>   docs/system/deprecated.rst       |  7 ------
>>   docs/system/removed-features.rst |  7 ++++++
>>   include/sysemu/blockdev.h        |  1 -
>>   blockdev.c                       | 37 +++++++++++++-------------------
>>   softmmu/vl.c                     |  8 +------
>>   5 files changed, 23 insertions(+), 37 deletions(-)
>> 
>> diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst
>> index 601e9647a5..664ed60e9f 100644
>> --- a/docs/system/deprecated.rst
>> +++ b/docs/system/deprecated.rst
>> @@ -94,13 +94,6 @@ QEMU 5.1 has three options:
>>         to the user to load all the images they need.
>>    3. ``-bios <file>`` - Tells QEMU to load the specified file as the firmwrae.
>>   
>> -``-drive`` with bogus interface type (since 5.1)
>> -''''''''''''''''''''''''''''''''''''''''''''''''
>> -
>> -Drives with interface types other than ``if=none`` are for onboard
>> -devices.  It is possible to use drives the board doesn't pick up with
>> --device.  This usage is now deprecated.  Use ``if=none`` instead.
>> -
>>   Short-form boolean options (since 6.0)
>>   ''''''''''''''''''''''''''''''''''''''
>>   
>> diff --git a/docs/system/removed-features.rst b/docs/system/removed-features.rst
>> index 77e7ba1339..e6d2fbe798 100644
>> --- a/docs/system/removed-features.rst
>> +++ b/docs/system/removed-features.rst
>> @@ -87,6 +87,13 @@ becomes
>>       -device isa-fdc,...
>>       -device floppy,unit=1,drive=...
>>   
>> +``-drive`` with bogus interface type (removed in 6.0)
>> +'''''''''''''''''''''''''''''''''''''''''''''''''''''
>> +
>> +Drives with interface types other than ``if=none`` are for onboard
>> +devices.  Drives the board doesn't pick up can no longer be used with
>> +-device.  Use ``if=none`` instead.
>> +
>>   QEMU Machine Protocol (QMP) commands
>>   ------------------------------------
>>   
>> diff --git a/include/sysemu/blockdev.h b/include/sysemu/blockdev.h
>> index 3b5fcda08d..32c2d6023c 100644
>> --- a/include/sysemu/blockdev.h
>> +++ b/include/sysemu/blockdev.h
>> @@ -35,7 +35,6 @@ struct DriveInfo {
>>       bool is_default;            /* Added by default_drive() ?  */
>>       int media_cd;
>>       QemuOpts *opts;
>> -    bool claimed_by_board;
>>       QTAILQ_ENTRY(DriveInfo) next;
>>   };
>>   
>> diff --git a/blockdev.c b/blockdev.c
>> index cd438e60e3..2e01889cff 100644
>> --- a/blockdev.c
>> +++ b/blockdev.c
>> @@ -240,19 +240,10 @@ DriveInfo *drive_get(BlockInterfaceType type, int bus, int unit)
>>       return NULL;
>>   }
>>   
>> -void drive_mark_claimed_by_board(void)
>> -{
>> -    BlockBackend *blk;
>> -    DriveInfo *dinfo;
>> -
>> -    for (blk = blk_next(NULL); blk; blk = blk_next(blk)) {
>> -        dinfo = blk_legacy_dinfo(blk);
>> -        if (dinfo && blk_get_attached_dev(blk)) {
>> -            dinfo->claimed_by_board = true;
>> -        }
>> -    }
>> -}
>> -
>> +/*
>> + * Check board claimed all -drive that are meant to be claimed.
>> + * Fatal error if any remain unclaimed.
>> + */
>>   void drive_check_orphaned(void)
>>   {
>>       BlockBackend *blk;
>> @@ -262,7 +253,17 @@ void drive_check_orphaned(void)
>>   
>>       for (blk = blk_next(NULL); blk; blk = blk_next(blk)) {
>>           dinfo = blk_legacy_dinfo(blk);
>> -        if (dinfo->is_default || dinfo->type == IF_NONE) {
>> +        /*
>> +         * Ignore default drives, because we create certain default
>> +         * drives unconditionally, then leave them unclaimed.  Not the
>> +         * users fault.
>
> "user's" ?

Yes.

>> +         * Ignore IF_VIRTIO, because it gets desugared into -device,
>> +         * so we can leave failing to -device.
>> +         * Ignore IF_NONE, because leaving unclaimed IF_NONE remains
>> +         * available for device_add is a feature.
>
> Do you mean "as a feature" ?

I mean "because leaving unclaimed IF_NONE available for device_add is a
feature."

I'm embarrassingly prone to accidents when rewriting my own prose.

>> +         */
>> +        if (dinfo->is_default || dinfo->type == IF_VIRTIO
>> +            || dinfo->type == IF_NONE) {
>>               continue;
>>           }
>>           if (!blk_get_attached_dev(blk)) {
>> @@ -273,14 +274,6 @@ void drive_check_orphaned(void)
>>                            if_name[dinfo->type], dinfo->bus, dinfo->unit);
>>               loc_pop(&loc);
>>               orphans = true;
>> -            continue;
>> -        }
>> -        if (!dinfo->claimed_by_board && dinfo->type != IF_VIRTIO) {
>> -            loc_push_none(&loc);
>> -            qemu_opts_loc_restore(dinfo->opts);
>> -            warn_report("bogus if=%s is deprecated, use if=none",
>> -                        if_name[dinfo->type]);
>> -            loc_pop(&loc);
>>           }
>>       }
>>   
>> diff --git a/softmmu/vl.c b/softmmu/vl.c
>> index ff488ea3e7..7453611152 100644
>> --- a/softmmu/vl.c
>> +++ b/softmmu/vl.c
>> @@ -2460,13 +2460,7 @@ static void qemu_init_board(void)
>>       /* From here on we enter MACHINE_PHASE_INITIALIZED.  */
>>       machine_run_board_init(current_machine);
>>   
>> -    /*
>> -     * TODO To drop support for deprecated bogus if=..., move
>> -     * drive_check_orphaned() here, replacing this call.  Also drop
>> -     * its deprecation warning, along with DriveInfo member
>> -     * @claimed_by_board.
>> -     */
>> -    drive_mark_claimed_by_board();
>> +    drive_check_orphaned();
>>   
>>       realtime_init();
>>   
>> 
>
> Rest looks okay as far as I am concerned, pending your response to Dan's 
> remark.
>
> (Sorry for being AWOL here. Thank you for taking the time to clean it up 
> as you have; it feels like closing a book on some of the first reviews I 
> ever got @ RH when I put the first orphan check in aeons ago! I think 
> only the whitespace is left by now, haha.)

It has served us well :)

Thank you, v4 coming!



^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2021-03-11  6:31 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-09 16:12 [PATCH v3 0/4] Drop deprecated floppy config & bogus -drive if=T Markus Armbruster
2021-03-09 16:12 ` [PATCH v3 1/4] docs/system/deprecated: Fix note on fdc drive properties Markus Armbruster
2021-03-09 16:13   ` Daniel P. Berrangé
2021-03-09 16:12 ` [PATCH v3 2/4] fdc: Drop deprecated floppy configuration Markus Armbruster
2021-03-09 16:14   ` Daniel P. Berrangé
2021-03-09 16:12 ` [PATCH v3 3/4] fdc: Inline fdctrl_connect_drives() into fdctrl_realize_common() Markus Armbruster
2021-03-09 16:15   ` Daniel P. Berrangé
2021-03-09 18:25   ` Richard Henderson
2021-03-10  8:13     ` Markus Armbruster
2021-03-09 16:12 ` [PATCH v3 4/4] blockdev: Drop deprecated bogus -drive interface type Markus Armbruster
2021-03-09 16:18   ` Daniel P. Berrangé
2021-03-10  8:10     ` Markus Armbruster
2021-03-11  5:00   ` John Snow
2021-03-11  6:29     ` Markus Armbruster

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).