summaryrefslogtreecommitdiffstats
path: root/hw/cpu
diff options
context:
space:
mode:
authorThomas Huth2018-07-16 14:59:30 +0200
committerPeter Maydell2018-07-17 14:12:49 +0200
commit32db1b58caa72f2ae582560f1937b21ea9ee0646 (patch)
tree08866d04d4bf84a4c0a2016b4e1bfdfcb0fa8551 /hw/cpu
parenthw/cpu/arm11mpcore: Fix introspection problem with 'arm11mpcore_priv' (diff)
downloadqemu-32db1b58caa72f2ae582560f1937b21ea9ee0646.tar.gz
qemu-32db1b58caa72f2ae582560f1937b21ea9ee0646.tar.xz
qemu-32db1b58caa72f2ae582560f1937b21ea9ee0646.zip
hw/*/realview: Fix introspection problem with 'realview_mpcore' & 'realview_gic'
echo "{'execute':'qmp_capabilities'} {'execute':'device-list-properties'," \ "'arguments':{'typename':'realview_mpcore'}}" \ "{'execute': 'human-monitor-command', " \ "'arguments': {'command-line': 'info qtree'}}" | \ valgrind -q aarch64-softmmu/qemu-system-aarch64 -M none,accel=qtest -qmp stdio [...] ==2654== Invalid read of size 8 ==2654== at 0x61878A: qdev_print (qdev-monitor.c:686) ==2654== by 0x61878A: qbus_print (qdev-monitor.c:719) ==2654== by 0x452B38: handle_hmp_command (monitor.c:3446) ==2654== by 0x452D70: qmp_human_monitor_command (monitor.c:821) [...] Use sysbus_init_child_obj() to fix it. Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com> Message-id: 1531745974-17187-14-git-send-email-thuth@redhat.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/cpu')
-rw-r--r--hw/cpu/realview_mpcore.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/hw/cpu/realview_mpcore.c b/hw/cpu/realview_mpcore.c
index 39d4ebeb1d..9d3f8378fb 100644
--- a/hw/cpu/realview_mpcore.c
+++ b/hw/cpu/realview_mpcore.c
@@ -101,14 +101,14 @@ static void mpcore_rirq_init(Object *obj)
SysBusDevice *privbusdev;
int i;
- object_initialize(&s->priv, sizeof(s->priv), TYPE_ARM11MPCORE_PRIV);
- qdev_set_parent_bus(DEVICE(&s->priv), sysbus_get_default());
+ sysbus_init_child_obj(obj, "a11priv", &s->priv, sizeof(s->priv),
+ TYPE_ARM11MPCORE_PRIV);
privbusdev = SYS_BUS_DEVICE(&s->priv);
sysbus_init_mmio(sbd, sysbus_mmio_get_region(privbusdev, 0));
for (i = 0; i < 4; i++) {
- object_initialize(&s->gic[i], sizeof(s->gic[i]), TYPE_REALVIEW_GIC);
- qdev_set_parent_bus(DEVICE(&s->gic[i]), sysbus_get_default());
+ sysbus_init_child_obj(obj, "gic[*]", &s->gic[i], sizeof(s->gic[i]),
+ TYPE_REALVIEW_GIC);
}
}