@@ -1036,6 +1036,8 @@ static void sl_nand_class_init(ObjectClass *klass, void *data)
k->init = sl_nand_init;
dc->vmsd = &vmstate_sl_nand_info;
dc->props = sl_nand_properties;
+ /* Reason: init() method uses drive_get() */
+ dc->cannot_instantiate_with_device_add_yet = true;
}
static const TypeInfo sl_nand_info = {
@@ -297,6 +297,8 @@ static void milkymist_memcard_class_init(ObjectClass *klass, void *data)
k->init = milkymist_memcard_init;
dc->reset = milkymist_memcard_reset;
dc->vmsd = &vmstate_milkymist_memcard;
+ /* Reason: init() method uses drive_get_next() */
+ dc->cannot_instantiate_with_device_add_yet = true;
}
static const TypeInfo milkymist_memcard_info = {
@@ -508,6 +508,8 @@ static void pl181_class_init(ObjectClass *klass, void *data)
sdc->init = pl181_init;
k->vmsd = &vmstate_pl181;
k->reset = pl181_reset;
+ /* Reason: init() method uses drive_get_next() */
+ k->cannot_instantiate_with_device_add_yet = true;
}
static const TypeInfo pl181_info = {
@@ -1297,12 +1297,15 @@ static void sdhci_sysbus_class_init(ObjectClass *klass, void *data)
dc->vmsd = &sdhci_vmstate;
dc->props = sdhci_properties;
dc->realize = sdhci_sysbus_realize;
+ /* Reason: instance_init() method uses drive_get_next() */
+ dc->cannot_instantiate_with_device_add_yet = true;
}
static const TypeInfo sdhci_sysbus_info = {
.name = TYPE_SYSBUS_SDHCI,
.parent = TYPE_SYS_BUS_DEVICE,
.instance_size = sizeof(SDHCIState),
+ /* FIXME SysBusDeviceClass init() instead of .instance_init */
.instance_init = sdhci_sysbus_init,
.instance_finalize = sdhci_sysbus_finalize,
.class_init = sdhci_sysbus_class_init,
A number of sysbus devices abuse drive_get_next(): sl-nand, milkymist-memcard, pl181, generic-sdhci. If you can't see what's wrong with their use of drive_get_next(), check out the FIXMEs in their init() methods and the commit that added them. We're in luck, though: only machines ppce500 and pseries-* support -device with sysbus devices, and none of the devices above is available with these machines. Set cannot_instantiate_with_device_add_yet to preserve our luck. Signed-off-by: Markus Armbruster <armbru@redhat.com> --- hw/arm/spitz.c | 2 ++ hw/sd/milkymist-memcard.c | 2 ++ hw/sd/pl181.c | 2 ++ hw/sd/sdhci.c | 3 +++ 4 files changed, 9 insertions(+)