hw/isa/isa-superio: Fix IDE controller realization
PATCH v2 1/1 hw/isa/isa-superio: Fix IDE controller realization
When realizing a Super I/O with IDE controller [*], we get:
qom/object.c:1684: object_property_try_add_child: Assertion `!child->parent' failed. Aborted (core dumped)
This is because the device is already realized when we try to add the QOM property to the parent. Fix by realizing *after* adding the QOM relationship.
[*] Set ISASuperIOClass::ide.count = N with N not zero
(no such thing currently exists; the bug is latent)
---
v2: Reword bug is latent (Markus)
--- hw/isa/isa-superio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/isa/isa-superio.c +1 -1
@@ -158,8 +158,8 @@ static void isa_superio_realize(DeviceState *dev, Error **errp)if (k->ide.get_irq) {qdev_prop_set_uint32 (d,"irq" , k->ide.get_irq (sio,0 )); } -isa_realize_and_unref (isa, bus, &error_fatal);object_property_add_child (OBJECT (sio),"isa-ide" ,OBJECT (isa)); +isa_realize_and_unref (isa, bus, &error_fatal); sio->ide = isa; trace_superio_create_ide(0, k->ide.get_iobase ?
Signature · 1 line
2.21.3
Quoted 27 lines · Philippe Mathieu-Daudé
When realizing a Super I/O with IDE controller [*], we get:
qom/object.c:1684:object_property_try_add_child: Assertion `!child->parent' failed. Aborted (core dumped)This is because the device is already realized when we try to add the QOM property to the parent. Fix by realizing *after* adding the QOM relationship.
[*] Set
ISASuperIOClass::ide.count= N with N not zero
(no such thing currently exists; the bug is latent)Fixes e508430619 ("hw/isa/superio: Make the components QOM children")Reviewed-by Markus Armbruster <[email protected]>Signed-off-by Philippe Mathieu-Daudé <[email protected]>---
v2: Reword bug is latent (Markus)--- hw/isa/isa-superio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)hw/isa/isa-superio.c +0
-0
hw/isa/isa-superio.c static void isa_superio_realize(DeviceState *dev, Error **errp) · line 165
Quoted 9 lines
hw/isa/isa-superio.c +1
-1@@ -158,8 +158,8 @@ static void isa_superio_realize(DeviceState *dev, Error **errp)if (k->ide.get_irq) {qdev_prop_set_uint32 (d,"irq" , k->ide.get_irq (sio,0 )); } -isa_realize_and_unref (isa, bus, &error_fatal);object_property_add_child (OBJECT (sio),"isa-ide" ,OBJECT (isa)); +isa_realize_and_unref (isa, bus, &error_fatal); sio->ide = isa; trace_superio_create_ide(0, k->ide.get_iobase ?
Laurent Vivier
AppliedLe 21/07/2020 à 14:45, Philippe Mathieu-Daudé a écrit :
Quoted 27 lines
When realizing a Super I/O with IDE controller [*], we get:
qom/object.c:1684:object_property_try_add_child: Assertion `!child->parent' failed. Aborted (core dumped)This is because the device is already realized when we try to add the QOM property to the parent. Fix by realizing *after* adding the QOM relationship.
[*] Set
ISASuperIOClass::ide.count= N with N not zero
(no such thing currently exists; the bug is latent)Fixes e508430619 ("hw/isa/superio: Make the components QOM children")Reviewed-by Markus Armbruster <[email protected]>Signed-off-by Philippe Mathieu-Daudé <[email protected]>---
v2: Reword bug is latent (Markus)--- hw/isa/isa-superio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)hw/isa/isa-superio.c +0
-0
hw/isa/isa-superio.c static void isa_superio_realize(DeviceState *dev, Error **errp) · line 165
Quoted 9 lines
hw/isa/isa-superio.c +1
-1@@ -158,8 +158,8 @@ static void isa_superio_realize(DeviceState *dev, Error **errp)if (k->ide.get_irq) {qdev_prop_set_uint32 (d,"irq" , k->ide.get_irq (sio,0 )); } -isa_realize_and_unref (isa, bus, &error_fatal);object_property_add_child (OBJECT (sio),"isa-ide" ,OBJECT (isa)); +isa_realize_and_unref (isa, bus, &error_fatal); sio->ide = isa; trace_superio_create_ide(0, k->ide.get_iobase ?
Applied to my trivial-patches branch.
Thanks,
Laurent