Skip to contentSkip to conversation

Drop deprecated floppy config & bogus -drive if=T

PATCH Superseded Markus Armbruster 3 participants 13 messages Mar 4, 2021 – Mar 8, 2021

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v2 cover Drop deprecated floppy config & bogus -drive if=T

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(-)
Signature · 1 line
2.26.2
#1 lore raw

PATCH v2 1/3 fdc: Drop deprecated floppy configuration

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

---
 docs/system/deprecated.rst       |  26 --
 docs/system/removed-features.rst |  26 ++
 hw/block/fdc.c                   |  54 +--
 tests/qemu-iotests/172           |  31 +-
 tests/qemu-iotests/172.out       | 562 +------------------------------
 5 files changed, 30 insertions(+), 669 deletions(-)
docs/system/deprecated.rst +0 -26
index 2fcac7861e..6a22bc07e2 100644
@@ -94,32 +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.
 
-``Configuring floppies with ``-global``
-'''''''''''''''''''''''''''''''''''''''
-
-Use ``-device floppy,...`` instead:
-::
-
-    -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=...
-
 ``-drive`` with bogus interface type
 ''''''''''''''''''''''''''''''''''''
 
docs/system/removed-features.rst +26 -0
index c8481cafbd..b0e7350408 100644
@@ -38,6 +38,32 @@ 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=``.
 
+``Configuring floppies with ``-global`` (removed in 6.0)
+''''''''''''''''''''''''''''''''''''''''''''''''''''''''
+
+Use ``-device floppy,...`` instead:
+::
+
+    -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=...
+
 QEMU Machine Protocol (QMP) commands
 ------------------------------------
 
hw/block/fdc.c +2 -52

88 lines not on this page · raw message

tests/qemu-iotests/172 +1 -30
index 0ac942a6c5..ff269ca7b5 100755
@@ -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
tests/qemu-iotests/172.out +1 -561

748 lines not on this page · raw message

Signature · 1 line
2.26.2
#2 lore raw

Re: [PATCH v2 1/3] fdc: Drop deprecated floppy configuration

Quoted 56 lines · Markus Armbruster

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

---
 docs/system/deprecated.rst       |  26 --
 docs/system/removed-features.rst |  26 ++
 hw/block/fdc.c                   |  54 +--
 tests/qemu-iotests/172           |  31 +-
 tests/qemu-iotests/172.out       | 562 +------------------------------
 5 files changed, 30 insertions(+), 669 deletions(-)
docs/system/deprecated.rst +0 -26
index 2fcac7861e..6a22bc07e2 100644
@@ -94,32 +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.
 
-``Configuring floppies with ``-global``
-'''''''''''''''''''''''''''''''''''''''
-
-Use ``-device floppy,...`` instead:
-::
-
-    -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=...
-
 ``-drive`` with bogus interface type
 ''''''''''''''''''''''''''''''''''''
 
docs/system/removed-features.rst +0 -0
index c8481cafbd..b0e7350408 100644
@@ -38,6 +38,32 @@ 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=``.

docs/system/removed-features.rst or ``-display default,show-cursor=on`` instead. · line 49

Quoted 10 lines
docs/system/removed-features.rst +9 -0
 
+``Configuring floppies with ``-global`` (removed in 6.0)
+''''''''''''''''''''''''''''''''''''''''''''''''''''''''
+
+Use ``-device floppy,...`` instead:
+::
+
+    -global isa-fdc.driveA=...
+    -global sysbus-fdc.driveA=...
+    -global SUNW,fdtwo.drive=...

It looks like we're not actually removing the use of -global, rather we're removing the driveA= and driveB= properties entirely, which simply means there's nothing to be set via -global. The distinction is important, because IIUC, it means that libvirt's use of these properties via -device is also impacted eg

-device isa-fdc,driveA=drive-fdc0-0-0,bootindexA=1,driveB=drive-fdc0-0-1

will no longer work too ?

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

Re: [PATCH v2 1/3] fdc: Drop deprecated floppy configuration

Quoted 74 lines · Daniel P. Berrangé
Quoted 56 lines · Markus Armbruster

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

---
 docs/system/deprecated.rst       |  26 --
 docs/system/removed-features.rst |  26 ++
 hw/block/fdc.c                   |  54 +--
 tests/qemu-iotests/172           |  31 +-
 tests/qemu-iotests/172.out       | 562 +------------------------------
 5 files changed, 30 insertions(+), 669 deletions(-)
docs/system/deprecated.rst +0 -26
index 2fcac7861e..6a22bc07e2 100644
@@ -94,32 +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.
 
-``Configuring floppies with ``-global``
-'''''''''''''''''''''''''''''''''''''''
-
-Use ``-device floppy,...`` instead:
-::
-
-    -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=...
-
 ``-drive`` with bogus interface type
 ''''''''''''''''''''''''''''''''''''
 
docs/system/removed-features.rst +0 -0
index c8481cafbd..b0e7350408 100644
@@ -38,6 +38,32 @@ 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=``.

docs/system/removed-features.rst or ``-display default,show-cursor=on`` instead. · line 49

Quoted 10 lines
docs/system/removed-features.rst +9 -0
 
+``Configuring floppies with ``-global`` (removed in 6.0)
+''''''''''''''''''''''''''''''''''''''''''''''''''''''''
+
+Use ``-device floppy,...`` instead:
+::
+
+    -global isa-fdc.driveA=...
+    -global sysbus-fdc.driveA=...
+    -global SUNW,fdtwo.drive=...

It looks like we're not actually removing the use of -global, rather we're removing the driveA= and driveB= properties entirely, which simply means there's nothing to be set via -global. The distinction is important, because IIUC, it means that libvirt's use of these properties via -device is also impacted eg

Quoted 3 lines

-device isa-fdc,driveA=drive-fdc0-0-0,bootindexA=1,driveB=drive-fdc0-0-1

will no longer work too ?

Correct.

This was deprecated in commit 4a27a638e7 "fdc: Deprecate configuring floppies with -global isa-fdc" (v5.1.0). Since then, its use triggers a warning:

    $ qemu-system-x86_64 -nodefaults -M q35 -display none -drive if=none,id=drive-fdc0-0-0 -device isa-fdc,driveA=drive-fdc0-0-0,bootindexA=1
    qemu-system-x86_64: -device isa-fdc,driveA=drive-fdc0-0-0,bootindexA=1: warning: warning: property isa-fdc.driveA is deprecated
    Use -device floppy,unit=0,drive=... instead.

Note the -M q35. Needed because the default machine type has an onboard isa-fdc, which cannot be configured this way.

Sadly, the commit's update of docs/system/deprecated.rst neglects to cover this use. Looks the series overtaxed my capacity to juggle details; my apologies.

Is libvirt still using these properties?

#4 lore raw

Re: [PATCH v2 1/3] fdc: Drop deprecated floppy configuration

Quoted 90 lines · Markus Armbruster
Quoted 74 lines · Daniel P. Berrangé
Quoted 56 lines · Markus Armbruster

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

---
 docs/system/deprecated.rst       |  26 --
 docs/system/removed-features.rst |  26 ++
 hw/block/fdc.c                   |  54 +--
 tests/qemu-iotests/172           |  31 +-
 tests/qemu-iotests/172.out       | 562 +------------------------------
 5 files changed, 30 insertions(+), 669 deletions(-)
docs/system/deprecated.rst +0 -26
index 2fcac7861e..6a22bc07e2 100644
@@ -94,32 +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.
 
-``Configuring floppies with ``-global``
-'''''''''''''''''''''''''''''''''''''''
-
-Use ``-device floppy,...`` instead:
-::
-
-    -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=...
-
 ``-drive`` with bogus interface type
 ''''''''''''''''''''''''''''''''''''
 
docs/system/removed-features.rst +0 -0
index c8481cafbd..b0e7350408 100644
@@ -38,6 +38,32 @@ 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=``.

docs/system/removed-features.rst or ``-display default,show-cursor=on`` instead. · line 49

Quoted 10 lines
docs/system/removed-features.rst +9 -0
 
+``Configuring floppies with ``-global`` (removed in 6.0)
+''''''''''''''''''''''''''''''''''''''''''''''''''''''''
+
+Use ``-device floppy,...`` instead:
+::
+
+    -global isa-fdc.driveA=...
+    -global sysbus-fdc.driveA=...
+    -global SUNW,fdtwo.drive=...

It looks like we're not actually removing the use of -global, rather we're removing the driveA= and driveB= properties entirely, which simply means there's nothing to be set via -global. The distinction is important, because IIUC, it means that libvirt's use of these properties via -device is also impacted eg

Quoted 3 lines

-device isa-fdc,driveA=drive-fdc0-0-0,bootindexA=1,driveB=drive-fdc0-0-1

will no longer work too ?

Correct.

This was deprecated in commit 4a27a638e7 "fdc: Deprecate configuring floppies with -global isa-fdc" (v5.1.0). Since then, its use triggers a warning:

    $ qemu-system-x86_64 -nodefaults -M q35 -display none -drive if=none,id=drive-fdc0-0-0 -device isa-fdc,driveA=drive-fdc0-0-0,bootindexA=1
    qemu-system-x86_64: -device isa-fdc,driveA=drive-fdc0-0-0,bootindexA=1: warning: warning: property isa-fdc.driveA is deprecated
    Use -device floppy,unit=0,drive=... instead.
Quoted 8 lines

Note the -M q35. Needed because the default machine type has an onboard isa-fdc, which cannot be configured this way.

Sadly, the commit's update of docs/system/deprecated.rst neglects to cover this use. Looks the series overtaxed my capacity to juggle details; my apologies.

Is libvirt still using these properties?

Unfortunately yes, but it seems like it ought to be fairly easy to change the syntax. Just need to figure out what the right way to detect the availability of the new syntax is. Presumably just look for existance of the 'floppy' device type ?

Can you confirm that switching from -global to the new -device floppy does /not/ have any live migration impact ?

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 :|
#5 lore raw

Re: [PATCH v2 1/3] fdc: Drop deprecated floppy configuration

Quoted 98 lines · Daniel P. Berrangé
Quoted 97 lines · Markus Armbruster
Quoted 74 lines · Daniel P. Berrangé
Quoted 56 lines · Markus Armbruster

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

---
 docs/system/deprecated.rst       |  26 --
 docs/system/removed-features.rst |  26 ++
 hw/block/fdc.c                   |  54 +--
 tests/qemu-iotests/172           |  31 +-
 tests/qemu-iotests/172.out       | 562 +------------------------------
 5 files changed, 30 insertions(+), 669 deletions(-)
docs/system/deprecated.rst +0 -26
index 2fcac7861e..6a22bc07e2 100644
@@ -94,32 +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.
 
-``Configuring floppies with ``-global``
-'''''''''''''''''''''''''''''''''''''''
-
-Use ``-device floppy,...`` instead:
-::
-
-    -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=...
-
 ``-drive`` with bogus interface type
 ''''''''''''''''''''''''''''''''''''
 
docs/system/removed-features.rst +0 -0
index c8481cafbd..b0e7350408 100644
@@ -38,6 +38,32 @@ 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=``.

docs/system/removed-features.rst or ``-display default,show-cursor=on`` instead. · line 49

Quoted 10 lines
docs/system/removed-features.rst +9 -0
 
+``Configuring floppies with ``-global`` (removed in 6.0)
+''''''''''''''''''''''''''''''''''''''''''''''''''''''''
+
+Use ``-device floppy,...`` instead:
+::
+
+    -global isa-fdc.driveA=...
+    -global sysbus-fdc.driveA=...
+    -global SUNW,fdtwo.drive=...

It looks like we're not actually removing the use of -global, rather we're removing the driveA= and driveB= properties entirely, which simply means there's nothing to be set via -global. The distinction is important, because IIUC, it means that libvirt's use of these properties via -device is also impacted eg

Quoted 3 lines

-device isa-fdc,driveA=drive-fdc0-0-0,bootindexA=1,driveB=drive-fdc0-0-1

will no longer work too ?

Correct.

This was deprecated in commit 4a27a638e7 "fdc: Deprecate configuring floppies with -global isa-fdc" (v5.1.0). Since then, its use triggers a warning:

    $ qemu-system-x86_64 -nodefaults -M q35 -display none -drive if=none,id=drive-fdc0-0-0 -device isa-fdc,driveA=drive-fdc0-0-0,bootindexA=1
    qemu-system-x86_64: -device isa-fdc,driveA=drive-fdc0-0-0,bootindexA=1: warning: warning: property isa-fdc.driveA is deprecated
    Use -device floppy,unit=0,drive=... instead.

Note the -M q35. Needed because the default machine type has an onboard isa-fdc, which cannot be configured this way.

Sadly, the commit's update of docs/system/deprecated.rst neglects to cover this use. Looks the series overtaxed my capacity to juggle details; my apologies.

Quoted 6 lines
Quoted 1 line

Is libvirt still using these properties?

Unfortunately yes, but it seems like it ought to be fairly easy to change the syntax. Just need to figure out what the right way to detect the availability of the new syntax is. Presumably just look for existance of the 'floppy' device type ?

Yes. The device type was added in merge commit fd209e4a7, v2.8.0.

Quoted 2 lines

Can you confirm that switching from -global to the new -device floppy does /not/ have any live migration impact ?

Yes, it must not affect migration.

When Kevin split the floppy device type off the floppy controller, he had to add some moderately ugly hackery to keep the old qdev properties working. Think propagate property values to floppy from controller, which otherwise ignores them.

The way you get the values into the floppy device cannot affect the migration data. Only different values can.

This patch removes a deprecated way.

#6 lore raw

Re: [PATCH v2 1/3] fdc: Drop deprecated floppy configuration

Quoted 17 lines · Markus Armbruster
Quoted 15 lines · Daniel P. Berrangé
Quoted 14 lines · Markus Armbruster
Quoted 12 lines · Daniel P. Berrangé
Quoted 11 lines · Markus Armbruster

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

---
 docs/system/deprecated.rst       |  26 --
 docs/system/removed-features.rst |  26 ++
 hw/block/fdc.c                   |  54 +--
 tests/qemu-iotests/172           |  31 +-
 tests/qemu-iotests/172.out       | 562 +------------------------------
 5 files changed, 30 insertions(+), 669 deletions(-)

[...]

Quoted 37 lines
Quoted 18 lines
Quoted 18 lines

Correct.

This was deprecated in commit 4a27a638e7 "fdc: Deprecate configuring floppies with -global isa-fdc" (v5.1.0). Since then, its use triggers a warning:

    $ qemu-system-x86_64 -nodefaults -M q35 -display none -drive if=none,id=drive-fdc0-0-0 -device isa-fdc,driveA=drive-fdc0-0-0,bootindexA=1
    qemu-system-x86_64: -device isa-fdc,driveA=drive-fdc0-0-0,bootindexA=1: warning: warning: property isa-fdc.driveA is deprecated
    Use -device floppy,unit=0,drive=... instead.

Note the -M q35. Needed because the default machine type has an onboard isa-fdc, which cannot be configured this way.

Sadly, the commit's update of docs/system/deprecated.rst neglects to cover this use. Looks the series overtaxed my capacity to juggle details; my apologies.

Quoted 6 lines
Quoted 1 line

Is libvirt still using these properties?

Unfortunately yes, but it seems like it ought to be fairly easy to change the syntax. Just need to figure out what the right way to detect the availability of the new syntax is. Presumably just look for existance of the 'floppy' device type ?

Yes. The device type was added in merge commit fd209e4a7, v2.8.0.

Quoted 2 lines

Can you confirm that switching from -global to the new -device floppy does /not/ have any live migration impact ?

Yes, it must not affect migration.

When Kevin split the floppy device type off the floppy controller, he had to add some moderately ugly hackery to keep the old qdev properties working. Think propagate property values to floppy from controller, which otherwise ignores them.

Quoted 4 lines

The way you get the values into the floppy device cannot affect the migration data. Only different values can.

This patch removes a deprecated way.

Note that when QEMU_CAPS_BLOCKDEV is asserted we format floppies as:

-blockdev '{"driver":"file","filename":"/tmp/firmware.img",\
"node-name":"libvirt-2-storage","auto-read-only":true,"discard":"unmap"}' \
-blockdev '{"node-name":"libvirt-2-format","read-only":false,"driver":"raw",\
"file":"libvirt-2-storage"}' \
-device floppy,unit=0,drive=libvirt-2-format,id=fdc0-0-0 \
-blockdev '{"driver":"file","filename":"/tmp/data.img",\
"node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \
-blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"qcow2",\
"file":"libvirt-1-storage"}' \
-device floppy,unit=1,drive=libvirt-1-format,id=fdc0-0-1 \

as visible in the test file:

tests/qemuxml2argvdata/disk-floppy-q35-2_11.x86_64-latest.args

So libvirt should be in the clear. isa-fdc with driveA/driveB is formatted only when the blockdev capability isn't present.

#7 lore raw

Re: [PATCH v2 1/3] fdc: Drop deprecated floppy configuration

Quoted 76 lines · Peter Krempa
Quoted 17 lines · Markus Armbruster
Quoted 15 lines · Daniel P. Berrangé
Quoted 14 lines · Markus Armbruster
Quoted 12 lines · Daniel P. Berrangé
Quoted 11 lines · Markus Armbruster

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

---
 docs/system/deprecated.rst       |  26 --
 docs/system/removed-features.rst |  26 ++
 hw/block/fdc.c                   |  54 +--
 tests/qemu-iotests/172           |  31 +-
 tests/qemu-iotests/172.out       | 562 +------------------------------
 5 files changed, 30 insertions(+), 669 deletions(-)

[...]

Quoted 37 lines
Quoted 18 lines
Quoted 18 lines

Correct.

This was deprecated in commit 4a27a638e7 "fdc: Deprecate configuring floppies with -global isa-fdc" (v5.1.0). Since then, its use triggers a warning:

    $ qemu-system-x86_64 -nodefaults -M q35 -display none -drive if=none,id=drive-fdc0-0-0 -device isa-fdc,driveA=drive-fdc0-0-0,bootindexA=1
    qemu-system-x86_64: -device isa-fdc,driveA=drive-fdc0-0-0,bootindexA=1: warning: warning: property isa-fdc.driveA is deprecated
    Use -device floppy,unit=0,drive=... instead.

Note the -M q35. Needed because the default machine type has an onboard isa-fdc, which cannot be configured this way.

Sadly, the commit's update of docs/system/deprecated.rst neglects to cover this use. Looks the series overtaxed my capacity to juggle details; my apologies.

Quoted 6 lines
Quoted 1 line

Is libvirt still using these properties?

Unfortunately yes, but it seems like it ought to be fairly easy to change the syntax. Just need to figure out what the right way to detect the availability of the new syntax is. Presumably just look for existance of the 'floppy' device type ?

Yes. The device type was added in merge commit fd209e4a7, v2.8.0.

Quoted 2 lines

Can you confirm that switching from -global to the new -device floppy does /not/ have any live migration impact ?

Yes, it must not affect migration.

When Kevin split the floppy device type off the floppy controller, he had to add some moderately ugly hackery to keep the old qdev properties working. Think propagate property values to floppy from controller, which otherwise ignores them.

Quoted 4 lines

The way you get the values into the floppy device cannot affect the migration data. Only different values can.

This patch removes a deprecated way.

Note that when QEMU_CAPS_BLOCKDEV is asserted we format floppies as:

-blockdev '{"driver":"file","filename":"/tmp/firmware.img",\
"node-name":"libvirt-2-storage","auto-read-only":true,"discard":"unmap"}' \
-blockdev '{"node-name":"libvirt-2-format","read-only":false,"driver":"raw",\
"file":"libvirt-2-storage"}' \

(quoted diff) +0 -2
-device floppy,unit=0,drive=libvirt-2-format,id=fdc0-0-0 \
-blockdev '{"driver":"file","filename":"/tmp/data.img",\

"node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \
-blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"qcow2",\
"file":"libvirt-1-storage"}' \
-device floppy,unit=1,drive=libvirt-1-format,id=fdc0-0-1 \

Quoted 6 lines

as visible in the test file:

tests/qemuxml2argvdata/disk-floppy-q35-2_11.x86_64-latest.args

So libvirt should be in the clear. isa-fdc with driveA/driveB is formatted only when the blockdev capability isn't present.

Ahh, excellant, I missed that detailed and worried that we still had work todo.

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 :|
#8 lore raw

Re: [PATCH v2 1/3] fdc: Drop deprecated floppy configuration

In reply to Peter Krempa
Quoted 76 lines · Peter Krempa
Quoted 17 lines · Markus Armbruster
Quoted 15 lines · Daniel P. Berrangé
Quoted 14 lines · Markus Armbruster
Quoted 12 lines · Daniel P. Berrangé
Quoted 11 lines · Markus Armbruster

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

---
 docs/system/deprecated.rst       |  26 --
 docs/system/removed-features.rst |  26 ++
 hw/block/fdc.c                   |  54 +--
 tests/qemu-iotests/172           |  31 +-
 tests/qemu-iotests/172.out       | 562 +------------------------------
 5 files changed, 30 insertions(+), 669 deletions(-)

[...]

Quoted 37 lines
Quoted 18 lines
Quoted 18 lines

Correct.

This was deprecated in commit 4a27a638e7 "fdc: Deprecate configuring floppies with -global isa-fdc" (v5.1.0). Since then, its use triggers a warning:

    $ qemu-system-x86_64 -nodefaults -M q35 -display none -drive if=none,id=drive-fdc0-0-0 -device isa-fdc,driveA=drive-fdc0-0-0,bootindexA=1
    qemu-system-x86_64: -device isa-fdc,driveA=drive-fdc0-0-0,bootindexA=1: warning: warning: property isa-fdc.driveA is deprecated
    Use -device floppy,unit=0,drive=... instead.

Note the -M q35. Needed because the default machine type has an onboard isa-fdc, which cannot be configured this way.

Sadly, the commit's update of docs/system/deprecated.rst neglects to cover this use. Looks the series overtaxed my capacity to juggle details; my apologies.

Quoted 6 lines
Quoted 1 line

Is libvirt still using these properties?

Unfortunately yes, but it seems like it ought to be fairly easy to change the syntax. Just need to figure out what the right way to detect the availability of the new syntax is. Presumably just look for existance of the 'floppy' device type ?

Yes. The device type was added in merge commit fd209e4a7, v2.8.0.

Quoted 2 lines

Can you confirm that switching from -global to the new -device floppy does /not/ have any live migration impact ?

Yes, it must not affect migration.

When Kevin split the floppy device type off the floppy controller, he had to add some moderately ugly hackery to keep the old qdev properties working. Think propagate property values to floppy from controller, which otherwise ignores them.

Quoted 4 lines

The way you get the values into the floppy device cannot affect the migration data. Only different values can.

This patch removes a deprecated way.

Note that when QEMU_CAPS_BLOCKDEV is asserted we format floppies as:

-blockdev '{"driver":"file","filename":"/tmp/firmware.img",\
"node-name":"libvirt-2-storage","auto-read-only":true,"discard":"unmap"}' \
-blockdev '{"node-name":"libvirt-2-format","read-only":false,"driver":"raw",\
"file":"libvirt-2-storage"}' \

(quoted diff) +0 -2
-device floppy,unit=0,drive=libvirt-2-format,id=fdc0-0-0 \
-blockdev '{"driver":"file","filename":"/tmp/data.img",\

"node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \
-blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"qcow2",\
"file":"libvirt-1-storage"}' \
-device floppy,unit=1,drive=libvirt-1-format,id=fdc0-0-1 \

Quoted 6 lines

as visible in the test file:

tests/qemuxml2argvdata/disk-floppy-q35-2_11.x86_64-latest.args

So libvirt should be in the clear. isa-fdc with driveA/driveB is formatted only when the blockdev capability isn't present.

Even better: in the clear for some time already, which means a wider range of libvirt versions keeps working with the latest QEMU. Nice, because keeping the coupling reasonably lose makes upgrading easier.

Thanks!

#9 lore raw

Re: [PATCH v2 1/3] fdc: Drop deprecated floppy configuration

In reply to Markus Armbruster
Quoted 7 lines · Markus Armbruster
Quoted 5 lines · Daniel P. Berrangé
Quoted 4 lines · Markus Armbruster

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

[...]

Quoted 3 lines

Sadly, the commit's update of docs/system/deprecated.rst neglects to cover this use. Looks the series overtaxed my capacity to juggle details; my apologies.

[...]

I'm talking about commit 4a27a638e7 here.

The deprecated.rst text only covers setting floppy controller properties with -global. It neglects to cover setting them with -device. For onboard controllers, -global is the only way to set them.

I append a fixup.

We can put it before this patch. This patch then moves the fixed up text to removed-features.rst.

Or we squash it into this patch, i.e. this patch deletes the flawed text from deprecated.rst and adds the fixed up text to removed-features.rst.

Got a preference?

docs/system/deprecated.rst +29 -3
index 2fcac7861e..393ede47f1 100644
@@ -97,7 +97,11 @@ QEMU 5.1 has three options:
 ``Configuring floppies with ``-global``
 '''''''''''''''''''''''''''''''''''''''
 
-Use ``-device floppy,...`` instead:
+Floppy controllers' drive properties (since 5.1)
+''''''''''''''''''''''''''''''''''''''''''''''''
+
+Use ``-device floppy,...`` instead.  When configuring onboard floppy
+controllers
 ::
 
     -global isa-fdc.driveA=...
@@ -120,8 +124,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
#10 lore raw

Re: [PATCH v2 1/3] fdc: Drop deprecated floppy configuration

Quoted 23 lines · Markus Armbruster
Quoted 7 lines · Markus Armbruster
Quoted 5 lines · Daniel P. Berrangé
Quoted 4 lines · Markus Armbruster

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

[...]

Quoted 3 lines

Sadly, the commit's update of docs/system/deprecated.rst neglects to cover this use. Looks the series overtaxed my capacity to juggle details; my apologies.

[...]

I'm talking about commit 4a27a638e7 here.

The deprecated.rst text only covers setting floppy controller properties with -global. It neglects to cover setting them with -device. For onboard controllers, -global is the only way to set them.

I append a fixup.

Quoted 7 lines

We can put it before this patch. This patch then moves the fixed up text to removed-features.rst.

Or we squash it into this patch, i.e. this patch deletes the flawed text from deprecated.rst and adds the fixed up text to removed-features.rst.

Got a preference?

I'm fine with either option. It isn't unusual to tweak the text when moving it to the removed-features.rst file, as we'll be talking about the past rather than future.

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 :|
#11 lore raw

PATCH v2 2/3 fdc: Inline fdctrl_connect_drives() into fdctrl_realize_common()

In reply to Markus Armbruster

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.

---
 hw/block/fdc.c | 23 ++++++++---------------
 1 file changed, 8 insertions(+), 15 deletions(-)
hw/block/fdc.c +8 -15
index f978ddf647..32701c2bc5 100644
@@ -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[] = {
Signature · 1 line
2.26.2
#12 lore raw

PATCH v2 3/3 blockdev: Drop deprecated bogus -drive interface type

In reply to Markus Armbruster

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

---
 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(-)
docs/system/deprecated.rst +0 -7
index 6a22bc07e2..01c58f8e88 100644
@@ -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
-''''''''''''''''''''''''''''''''''''
-
-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)
 ''''''''''''''''''''''''''''''''''''''
 
docs/system/removed-features.rst +7 -0
index b0e7350408..a2b3a8a1ca 100644
@@ -64,6 +64,13 @@ become
 
     -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
 ------------------------------------
 
include/sysemu/blockdev.h +0 -1
index 3b5fcda08d..32c2d6023c 100644
@@ -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;
 };
 
blockdev.c +15 -22
index cd438e60e3..2e01889cff 100644
@@ -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);
         }
     }
 
softmmu/vl.c +1 -7
index b219ce1f35..8097a7b5fb 100644
@@ -2461,13 +2461,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();
 
Signature · 1 line
2.26.2