提交 a993cb15 编写于 作者: A Alistair Francis

virt: Fix crash when introspecting the device

Use the new object_initialize_child() and sysbus_init_child_obj() to
fix the issue.
Signed-off-by: NAlistair Francis <alistair.francis@wdc.com>
Suggested-by: NThomas Huth <thuth@redhat.com>
Reviewed-by: NMichael Clark <mjc@sifive.com>
Reviewed-by: NThomas Huth <thuth@redhat.com>
Reviewed-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
上级 4eea9d7d
......@@ -274,9 +274,8 @@ static void riscv_virt_board_init(MachineState *machine)
void *fdt;
/* Initialize SOC */
object_initialize(&s->soc, sizeof(s->soc), TYPE_RISCV_HART_ARRAY);
object_property_add_child(OBJECT(machine), "soc", OBJECT(&s->soc),
&error_abort);
object_initialize_child(OBJECT(machine), "soc", &s->soc, sizeof(s->soc),
TYPE_RISCV_HART_ARRAY, &error_abort, NULL);
object_property_set_str(OBJECT(&s->soc), VIRT_CPU, "cpu-type",
&error_abort);
object_property_set_int(OBJECT(&s->soc), smp_cpus, "num-harts",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册