Skip to content

Contain drive_get() misuse

Markus Armbruster qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 11 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3hw: Mark devices misusing drive_get(), drive_get_next() FIXMEhw/arm/spitz.c hw/block/m25p80.c hw/isa/pc87312.c +4 more+8 -00 replies
2/3sdhci: Make device "sdhci-pci" unavailable with -devicehw/sd/sdhci.c+2 -02 replies
3/3sysbus: Contain drive_get_next() misusehw/arm/spitz.c hw/sd/milkymist-memcard.c hw/sd/pl181.c +1 more+9 -00 replies

Reviews trailers per patch

None of the 3 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchPaolo Bonzini
SeriesA-b
1/3
2/3
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [Qemu-devel] [PATCH for-2.3 0/3] Contain drive_get() misuse

Drives defined with if!=none are for board initialization to wire up. Board code calls drive_get() or similar to find them, and creates devices with their qdev drive properties set accordingly.

Except a few devices go on a fishing expedition for a suitable backend instead of exposing a drive property for board code to set: they call driver_get() or drive_get_next() in their realize() or init() method. Wrong.

We can't fix this in time for the release, so do the next best thing:
contain the mistakes as far as possible so they don't become ABI:

* Mark them all with suitable FIXME comments [PATCH 1]

* sdhci-pci is new, set cannot_instantiate_with_device_add_yet to make it unavailable with -device [PATCH 2]

* A few more aren't currently available with -device, set cannot_instantiate_with_device_add_yet to ensure they stay unavailable [PATCH 3]

* Left alone: m25p80-generic and its derivatives, ssi-sd, pc87312

Markus Armbruster (3):
hw: Mark devices misusing drive_get(), drive_get_next() FIXME
sdhci: Make device "sdhci-pci" unavailable with -device
sysbus: Contain drive_get_next() misuse

 hw/arm/spitz.c            | 3 +++
 hw/block/m25p80.c         | 1 +
 hw/isa/pc87312.c          | 2 ++
 hw/sd/milkymist-memcard.c | 3 +++
 hw/sd/pl181.c             | 3 +++
 hw/sd/sdhci.c             | 6 ++++++
 hw/sd/ssi-sd.c            | 1 +
 7 files changed, 19 insertions(+)
Signature · 1 line
1.9.3