hw/cpu/arm11mpcore: Fix introspection problem with 'arm11mpcore_priv'
commitb2bc349822fa27c7da4e04535c5dda2cb035965b
authorThomas Huth <thuth@redhat.com>
Mon, 16 Jul 2018 12:59:29 +0000 (16 14:59 +0200)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 17 Jul 2018 12:12:49 +0000 (17 13:12 +0100)
tree4aafa32084be6d54ddcdfbbb81d099c4509191f1
parentaac409c9b09fe5df11e82fc285d4e721d857f486
hw/cpu/arm11mpcore: Fix introspection problem with 'arm11mpcore_priv'

Valgrind reports an error here:

echo "{'execute':'qmp_capabilities'} {'execute':'device-list-properties'," \
 "'arguments':{'typename':'arm11mpcore_priv'}}" \
 "{'execute': 'human-monitor-command', " \
 "'arguments': {'command-line': 'info qtree'}}" | \
 valgrind -q aarch64-softmmu/qemu-system-aarch64 -M none,accel=qtest -qmp stdio
[...]
==3145== Invalid read of size 8
==3145==    at 0x61873A: qdev_print (qdev-monitor.c:686)
==3145==    by 0x61873A: qbus_print (qdev-monitor.c:719)
[...]

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>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-id: 1531745974-17187-13-git-send-email-thuth@redhat.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/cpu/arm11mpcore.c