mirror_qemu/hw/sd
Markus Armbruster 007d1dbf72 sd: Hide the qdev-but-not-quite thing created by sd_init()
Commit 260bc9d8aa "hw/sd/sd.c: QOMify" QOMified only the device
itself, not its users.  It kept sd_init() around for non-QOMified
users.

More than four years later, three such users remain: omap1 (machines
cheetah, sx1, sx1-v1) and omap2 (machines n800, n810) are not
QOMified, and pl181 (machines integratorcp, realview-eb,
realview-eb-mpcore, realview-pb-a8 realview-pbx-a9, versatileab,
versatilepb, vexpress-a15, vexpress-a9) is not QOMified properly.

The issue I presently have with this: an "sd-card" device should plug
into an "sd-bus" (its DeviceClass member bus_type says so), but
sd_init() leaves it unplugged.  This is normally a bug (I just fixed
some instances), and I'd like to assert proper pluggedness to prevent
regressions.  However, the qdev-but-not-quite thing returned by
sd_init() would fail the assertion.  Meh.

Make sd_init() hide it from QOM/qdev.  Visible in "info qom-tree",
here's the change for cheetah:

     /machine (cheetah-machine)
       [...]
       /unattached (container)
         [...]
         /device[5] (serial-mm)
           /serial (serial)
           /serial[0] (qemu:memory-region)
    -    /device[6] (sd-card)
    -    /device[7] (omap-gpio)
    +    /device[6] (omap-gpio)
         [rest of device[*] renumbered...]

Cc: "Philippe Mathieu-Daudé" <philmd@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20200609122339.937862-24-armbru@redhat.com>
2020-06-15 21:36:30 +02:00
..
Kconfig hw/sd/sdhci: Move PCI-related code into a separate file 2019-03-12 07:49:04 +01:00
Makefile.objs hw/arm/allwinner: add SD/MMC host controller 2020-03-12 16:27:33 +00:00
allwinner-sdhost.c hw/arm/allwinner: add SD/MMC host controller 2020-03-12 16:27:33 +00:00
aspeed_sdhci.c hw/sd: Configure number of slots exposed by the ASPEED SDHCI model 2020-01-30 16:02:02 +00:00
bcm2835_sdhost.c Include migration/vmstate.h less 2019-08-16 13:31:52 +02:00
core.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
milkymist-memcard.c Clean up inclusion of sysemu/sysemu.h 2019-08-16 13:31:53 +02:00
omap_mmc.c add device_legacy_reset function to prepare for reset api change 2020-01-30 16:02:03 +00:00
pl181.c add device_legacy_reset function to prepare for reset api change 2020-01-30 16:02:03 +00:00
pxa2xx_mmci.c sd/pxa2xx_mmci: Fix to realize "pxa2xx-mmci" device 2020-06-15 21:36:09 +02:00
sd.c sd: Hide the qdev-but-not-quite thing created by sd_init() 2020-06-15 21:36:30 +02:00
sdhci-internal.h qdev: Unrealize must not fail 2020-05-15 07:08:14 +02:00
sdhci-pci.c qdev: Unrealize must not fail 2020-05-15 07:08:14 +02:00
sdhci.c qdev: Unrealize must not fail 2020-05-15 07:08:14 +02:00
sdmmc-internal.c sdcard: Display command name when tracing CMD/ACMD 2018-03-09 17:09:44 +00:00
sdmmc-internal.h Clean up header guards that don't match their file name 2019-05-13 08:58:55 +02:00
ssi-sd.c hw/sd/ssi-sd: fix error handling in ssi_sd_realize 2020-03-17 17:30:03 +01:00
trace-events hw/arm/allwinner: add SD/MMC host controller 2020-03-12 16:27:33 +00:00