Skip to contentSkip to conversation

virtio-blk: drop deprecated scsi=on|off property

PATCH In review Stefan Hajnoczi 6 participants 11 messages Apr 29, 2021 – May 4, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 virtio-blk: drop deprecated scsi=on|off property

The scsi=on|off property was deprecated in QEMU 5.0 and can be removed completely at this point.

Drop the scsi=on|off option. It was only available on Legacy virtio-blk devices. Linux v5.6 already dropped support for it.

Remove the hw_compat_2_4[] property assignment since scsi=on|off no longer exists. Old guests with Legacy virtio-blk devices no longer see the SCSI host features bit.

Live migrating old guests from an old QEMU with the SCSI feature bit enabled will fail with "Features 0x... unsupported. Allowed features:
0x...". We've followed the QEMU deprecation policy so users have been warned...

I have tested that libvirt still works when the property is absent. It no longer adds scsi=on|off to the command-line.

Cc Markus Armbruster <[email protected]>
Cc Christoph Hellwig <[email protected]>
Cc Peter Krempa <[email protected]>
Cc Dr. David Alan Gilbert <[email protected]>
---
 docs/specs/tpm.rst           |   2 +-
 docs/system/deprecated.rst   |  13 ---
 docs/pci_expander_bridge.txt |   2 +-
 hw/block/virtio-blk.c        | 192 +----------------------------------
 hw/core/machine.c            |   2 -
 5 files changed, 3 insertions(+), 208 deletions(-)
docs/specs/tpm.rst +1 -1
index 3be190343a..0ec017ab95 100644
@@ -328,7 +328,7 @@ In case a pSeries machine is emulated, use the following command line:
     -tpmdev emulator,id=tpm0,chardev=chrtpm \
     -device tpm-spapr,tpmdev=tpm0 \
     -device spapr-vscsi,id=scsi0,reg=0x00002000 \
-    -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x3,drive=drive-virtio-disk0,id=virtio-disk0 \
+    -device virtio-blk-pci,bus=pci.0,addr=0x3,drive=drive-virtio-disk0,id=virtio-disk0 \
     -drive file=test.img,format=raw,if=none,id=drive-virtio-disk0
 
 In case an Arm virt machine is emulated, use the following command line:
docs/system/deprecated.rst +0 -13
index 80cae86252..1abb64b669 100644
@@ -248,19 +248,6 @@ machines have been renamed ``raspi2b`` and ``raspi3b``.
 Device options
 --------------
 
-Emulated device options
-'''''''''''''''''''''''
-
-``-device virtio-blk,scsi=on|off`` (since 5.0.0)
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-The virtio-blk SCSI passthrough feature is a legacy VIRTIO feature.  VIRTIO 1.0
-and later do not support it because the virtio-scsi device was introduced for
-full SCSI support.  Use virtio-scsi instead when SCSI passthrough is required.
-
-Note this also applies to ``-device virtio-blk-pci,scsi=on|off``, which is an
-alias.
-
 Block device options
 ''''''''''''''''''''
 
docs/pci_expander_bridge.txt +1 -1
index 36750273bb..540191f5e0 100644
@@ -25,7 +25,7 @@ A detailed command line would be:
 -object memory-backend-ram,size=1024M,policy=bind,host-nodes=1,id=ram-node1 -numa node,nodeid=1,cpus=1,memdev=ram-node1
 -device pxb,id=bridge1,bus=pci.0,numa_node=1,bus_nr=4 -netdev user,id=nd -device e1000,bus=bridge1,addr=0x4,netdev=nd
 -device pxb,id=bridge2,bus=pci.0,numa_node=0,bus_nr=8 -device e1000,bus=bridge2,addr=0x3
--device pxb,id=bridge3,bus=pci.0,bus_nr=40 -drive if=none,id=drive0,file=[img] -device virtio-blk-pci,drive=drive0,scsi=off,bus=bridge3,addr=1
+-device pxb,id=bridge3,bus=pci.0,bus_nr=40 -drive if=none,id=drive0,file=[img] -device virtio-blk-pci,drive=drive0,bus=bridge3,addr=1
 
 Here you have:
  - 2 NUMA nodes for the guest, 0 and 1. (both mapped to the same NUMA node in host, but you can and should put it in different host NUMA nodes)
hw/block/virtio-blk.c +1 -191

229 lines not on this page · raw message

hw/core/machine.c +0 -2
index 40def78183..286f18ec6d 100644
@@ -194,8 +194,6 @@ GlobalProperty hw_compat_2_5[] = {
 const size_t hw_compat_2_5_len = G_N_ELEMENTS(hw_compat_2_5);
 
 GlobalProperty hw_compat_2_4[] = {
-    /* Optional because the 'scsi' property is Linux-only */
-    { "virtio-blk-device", "scsi", "true", .optional = true },
     { "e1000", "extra_mac_registers", "off" },
     { "virtio-pci", "x-disable-pcie", "on" },
     { "virtio-pci", "migrate-extra", "off" },
Signature · 1 line
2.30.2
#1 lore raw
Quoted 9 lines · Stefan Hajnoczi

The scsi=on|off property was deprecated in QEMU 5.0 and can be removed completely at this point.

Drop the scsi=on|off option. It was only available on Legacy virtio-blk devices. Linux v5.6 already dropped support for it.

Remove the hw_compat_2_4[] property assignment since scsi=on|off no longer exists. Old guests with Legacy virtio-blk devices no longer see the SCSI host features bit.

Does this mean that qemu rejects it if it's explicitly enabled on the commandline?

Quoted 7 lines

Live migrating old guests from an old QEMU with the SCSI feature bit enabled will fail with "Features 0x... unsupported. Allowed features:
0x...". We've followed the QEMU deprecation policy so users have been warned...

I have tested that libvirt still works when the property is absent. It no longer adds scsi=on|off to the command-line.

Yup, we deliberately don't format it unless the user requested it since:

https://gitlab.com/libvirt/libvirt/-/commit/ec69f0190be731d12faeac08dbf63325836509a9

Depending on your answer above I might need to dig through the code again to see whether we do the correct thing if it's no longer available.

Quoted 13 lines
Cc Markus Armbruster <[email protected]>
Cc Christoph Hellwig <[email protected]>
Cc Peter Krempa <[email protected]>
Cc Dr. David Alan Gilbert <[email protected]>
---
 docs/specs/tpm.rst           |   2 +-
 docs/system/deprecated.rst   |  13 ---
 docs/pci_expander_bridge.txt |   2 +-
 hw/block/virtio-blk.c        | 192 +----------------------------------
 hw/core/machine.c            |   2 -
 5 files changed, 3 insertions(+), 208 deletions(-)
#2 lore raw
Quoted 7 lines · Peter Krempa
Quoted 6 lines · Stefan Hajnoczi

The scsi=on|off property was deprecated in QEMU 5.0 and can be removed completely at this point.

Drop the scsi=on|off option. It was only available on Legacy virtio-blk devices. Linux v5.6 already dropped support for it.

Quoted 6 lines
Quoted 3 lines

Remove the hw_compat_2_4[] property assignment since scsi=on|off no longer exists. Old guests with Legacy virtio-blk devices no longer see the SCSI host features bit.

Does this mean that qemu rejects it if it's explicitly enabled on the commandline?

Yes.

Stefan

#3 lore raw
In reply to Stefan Hajnoczi
Quoted 10 lines · Stefan Hajnoczi

The scsi=on|off property was deprecated in QEMU 5.0 and can be removed completely at this point.

Drop the scsi=on|off option. It was only available on Legacy virtio-blk devices. Linux v5.6 already dropped support for it.

Remove the hw_compat_2_4[] property assignment since scsi=on|off no longer exists. Old guests with Legacy virtio-blk devices no longer see the SCSI host features bit.

This means pc-2.4 will now break guest ABI if using virtio-blk devices, correct?

This looks like a sign we should have deprecated pc-2.4 a long time ago.

Quoted 5 lines

Live migrating old guests from an old QEMU with the SCSI feature bit enabled will fail with "Features 0x... unsupported. Allowed features:
0x...". We've followed the QEMU deprecation policy so users have been warned...

Were they really warned, though? People running "-machine pc-i440fx-2.4" might be completely unaware that it was silently enabling a deprecated feature.

Can we have this documented in a more explicit way? Maybe just a comment at hw_compat_2_4 would be enough, to warn people doing backports and rebases downstream.

Can we make QEMU refuse to start if using pc-2.4 + virtio-blk together, just to be sure?

An alternative would be keeping the property (and the hw_compat_2_4 entry) just to keep pc-2.4 working (until pc-2.4 is deprecated and removed), but refusing to realize the device if the feature is enabled.

Quoted 9 lines

I have tested that libvirt still works when the property is absent. It no longer adds scsi=on|off to the command-line.

Cc Markus Armbruster <[email protected]>
Cc Christoph Hellwig <[email protected]>
Cc Peter Krempa <[email protected]>
Cc Dr. David Alan Gilbert <[email protected]>

---

[...]

Quoted 13 lines
hw/core/machine.c +0 -2
index 40def78183..286f18ec6d 100644
@@ -194,8 +194,6 @@ GlobalProperty hw_compat_2_5[] = {
 const size_t hw_compat_2_5_len = G_N_ELEMENTS(hw_compat_2_5);
 
 GlobalProperty hw_compat_2_4[] = {
-    /* Optional because the 'scsi' property is Linux-only */
-    { "virtio-blk-device", "scsi", "true", .optional = true },
     { "e1000", "extra_mac_registers", "off" },
     { "virtio-pci", "x-disable-pcie", "on" },
     { "virtio-pci", "migrate-extra", "off" },
Signature · 1 line
Eduardo
#4 lore raw
Quoted 12 lines · Eduardo Habkost
Quoted 10 lines · Stefan Hajnoczi

The scsi=on|off property was deprecated in QEMU 5.0 and can be removed completely at this point.

Drop the scsi=on|off option. It was only available on Legacy virtio-blk devices. Linux v5.6 already dropped support for it.

Remove the hw_compat_2_4[] property assignment since scsi=on|off no longer exists. Old guests with Legacy virtio-blk devices no longer see the SCSI host features bit.

Quoted 5 lines

This means pc-2.4 will now break guest ABI if using virtio-blk devices, correct?

This looks like a sign we should have deprecated pc-2.4 a long time ago.

The last batch of PC machine type retiring was pc-1.0 to pc-1.3:
deprecated in 5.0 (commit 30d2a17b4, Dec 2019), dropped in 6.0 (commit f862ddbb1, just weeks ago). pc-1.3 was a bit over seven years old when we released 5.0. pc-2.4 will be six years old by the time we release 6.1. Fair game?

Quoted 9 lines
Quoted 5 lines

Live migrating old guests from an old QEMU with the SCSI feature bit enabled will fail with "Features 0x... unsupported. Allowed features:
0x...". We've followed the QEMU deprecation policy so users have been warned...

Were they really warned, though? People running "-machine pc-i440fx-2.4" might be completely unaware that it was silently enabling a deprecated feature.

We've gotten better at documenting deprecations, but we're still bad at warning on use of deprecated features.

[...]

#5 lore raw
Quoted 17 lines · Markus Armbruster
Quoted 15 lines · Eduardo Habkost
Quoted 10 lines · Stefan Hajnoczi

The scsi=on|off property was deprecated in QEMU 5.0 and can be removed completely at this point.

Drop the scsi=on|off option. It was only available on Legacy virtio-blk devices. Linux v5.6 already dropped support for it.

Remove the hw_compat_2_4[] property assignment since scsi=on|off no longer exists. Old guests with Legacy virtio-blk devices no longer see the SCSI host features bit.

This means pc-2.4 will now break guest ABI if using virtio-blk devices, correct?

Quoted 8 lines
Quoted 2 lines

This looks like a sign we should have deprecated pc-2.4 a long time ago.

The last batch of PC machine type retiring was pc-1.0 to pc-1.3:
deprecated in 5.0 (commit 30d2a17b4, Dec 2019), dropped in 6.0 (commit f862ddbb1, just weeks ago). pc-1.3 was a bit over seven years old when we released 5.0. pc-2.4 will be six years old by the time we release 6.1. Fair game?

As a data-point, libvirt will be dropping support for <qemu-2.10 (release, not the machine type) in the upcomming release. I'm not sure whether that justifies more deprecation though.

#6 lore raw
Quoted 27 lines · * Peter Krempa ([email protected]) wrote:
Quoted 17 lines · Markus Armbruster
Quoted 15 lines · Eduardo Habkost
Quoted 10 lines · Stefan Hajnoczi

The scsi=on|off property was deprecated in QEMU 5.0 and can be removed completely at this point.

Drop the scsi=on|off option. It was only available on Legacy virtio-blk devices. Linux v5.6 already dropped support for it.

Remove the hw_compat_2_4[] property assignment since scsi=on|off no longer exists. Old guests with Legacy virtio-blk devices no longer see the SCSI host features bit.

This means pc-2.4 will now break guest ABI if using virtio-blk devices, correct?

Quoted 8 lines
Quoted 2 lines

This looks like a sign we should have deprecated pc-2.4 a long time ago.

The last batch of PC machine type retiring was pc-1.0 to pc-1.3:
deprecated in 5.0 (commit 30d2a17b4, Dec 2019), dropped in 6.0 (commit f862ddbb1, just weeks ago). pc-1.3 was a bit over seven years old when we released 5.0. pc-2.4 will be six years old by the time we release 6.1. Fair game?

Quoted 3 lines

As a data-point, libvirt will be dropping support for <qemu-2.10 (release, not the machine type) in the upcomming release. I'm not sure whether that justifies more deprecation though.

What qemu features will you then be relying on?

Dave

Signature · 1 line
Dr. David Alan Gilbert / [email protected] / Manchester, UK
#7 lore raw
In reply to Eduardo Habkost
Quoted 7 lines · Eduardo Habkost
Quoted 6 lines · Stefan Hajnoczi

The scsi=on|off property was deprecated in QEMU 5.0 and can be removed completely at this point.

Drop the scsi=on|off option. It was only available on Legacy virtio-blk devices. Linux v5.6 already dropped support for it.

Quoted 7 lines
Quoted 4 lines

Remove the hw_compat_2_4[] property assignment since scsi=on|off no longer exists. Old guests with Legacy virtio-blk devices no longer see the SCSI host features bit.

This means pc-2.4 will now break guest ABI if using virtio-blk devices, correct?

Yes.

However, this feature was only enabled on Linux hosts, so cross-host OS migration was always broken and no one noticed. Maybe that configuration is too niche and QEMU never supported cross-host OS migration, but it still means that the "pc-2.4" ABI was never solid to begin with :).

Quoted 15 lines
Quoted 6 lines

Live migrating old guests from an old QEMU with the SCSI feature bit enabled will fail with "Features 0x... unsupported. Allowed features:
0x...". We've followed the QEMU deprecation policy so users have been warned...

Were they really warned, though? People running "-machine pc-i440fx-2.4" might be completely unaware that it was silently enabling a deprecated feature.

Can we have this documented in a more explicit way? Maybe just a comment at hw_compat_2_4 would be enough, to warn people doing backports and rebases downstream.

Quoted 7 lines

Can we make QEMU refuse to start if using pc-2.4 + virtio-blk together, just to be sure?

An alternative would be keeping the property (and the hw_compat_2_4 entry) just to keep pc-2.4 working (until pc-2.4 is deprecated and removed), but refusing to realize the device if the feature is enabled.

Yes, the least invasive approach is to leave the property in place but refuse to realize the virtio-blk device when scsi=on. The cost is more cruft, including a useless scsi=off command-line option that will continue to show up in libvirt-generated QEMU command-lines.

The cautious approach makes sense to me and I'll send a new revision.

Stefan

#8 lore raw
In reply to Eduardo Habkost
Quoted 11 lines · Eduardo Habkost
Quoted 5 lines · Stefan Hajnoczi

Live migrating old guests from an old QEMU with the SCSI feature bit enabled will fail with "Features 0x... unsupported. Allowed features:
0x...". We've followed the QEMU deprecation policy so users have been warned...

Were they really warned, though? People running "-machine pc-i440fx-2.4" might be completely unaware that it was silently enabling a deprecated feature.

Quoted 6 lines

Can we have this documented in a more explicit way? Maybe just a comment at hw_compat_2_4 would be enough, to warn people doing backports and rebases downstream.

Can we make QEMU refuse to start if using pc-2.4 + virtio-blk together, just to be sure?

On second thought, do we really want to break pc-2.4 user's QEMU command-lines if they have a virtio-blk device?

BTW Peter mentioned libvirt avoids the unnecessary scsi=off:
https://gitlab.com/libvirt/libvirt/-/commit/ec69f0190be731d12faeac08dbf63325836509a9

Stefan

#9 lore raw
Quoted 16 lines · Stefan Hajnoczi
Quoted 15 lines · Eduardo Habkost
Quoted 5 lines · Stefan Hajnoczi

Live migrating old guests from an old QEMU with the SCSI feature bit enabled will fail with "Features 0x... unsupported. Allowed features:
0x...". We've followed the QEMU deprecation policy so users have been warned...

Were they really warned, though? People running "-machine pc-i440fx-2.4" might be completely unaware that it was silently enabling a deprecated feature.

Can we have this documented in a more explicit way? Maybe just a comment at hw_compat_2_4 would be enough, to warn people doing backports and rebases downstream.

Quoted 5 lines
Quoted 2 lines

Can we make QEMU refuse to start if using pc-2.4 + virtio-blk together, just to be sure?

On second thought, do we really want to break pc-2.4 user's QEMU command-lines if they have a virtio-blk device?

It depends which command line you are talking about.

I believe we _must_ break the following:
"-machine pc-i440fx-2.4 -device virtio-blk", and "-machine pc-i440fx-2.4 -device virtio-blk,scsi=on". Your patch breaks only the latter.

Your patch also breaks the following:
"-machine pc-i440fx-2.4 -device virtio-blk,scsi=off", which I don't think we should break.

Quoted 5 lines

BTW Peter mentioned libvirt avoids the unnecessary scsi=off:
https://gitlab.com/libvirt/libvirt/-/commit/ec69f0190be731d12faeac08dbf63325836509a9

Stefan

Signature · 1 line
Eduardo
Reviewed-by on v1 1/1
#10 lore raw
In reply to Stefan Hajnoczi
Quoted 23 lines · Stefan Hajnoczi

The scsi=on|off property was deprecated in QEMU 5.0 and can be removed completely at this point.

Drop the scsi=on|off option. It was only available on Legacy virtio-blk devices. Linux v5.6 already dropped support for it.

Remove the hw_compat_2_4[] property assignment since scsi=on|off no longer exists. Old guests with Legacy virtio-blk devices no longer see the SCSI host features bit.

Live migrating old guests from an old QEMU with the SCSI feature bit enabled will fail with "Features 0x... unsupported. Allowed features:
0x...". We've followed the QEMU deprecation policy so users have been warned...

I have tested that libvirt still works when the property is absent. It no longer adds scsi=on|off to the command-line.

Cc Markus Armbruster <[email protected]>
Cc Christoph Hellwig <[email protected]>
Cc Peter Krempa <[email protected]>
Cc Dr. David Alan Gilbert <[email protected]>
Quoted 7 lines
---
 docs/specs/tpm.rst           |   2 +-
 docs/system/deprecated.rst   |  13 ---
 docs/pci_expander_bridge.txt |   2 +-
 hw/block/virtio-blk.c        | 192 +----------------------------------
 hw/core/machine.c            |   2 -
 5 files changed, 3 insertions(+), 208 deletions(-)

Michal