[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL v2 for 3.0 1/5] sifive_e: Fix crash when introspectin
From: |
Alistair Francis |
Subject: |
[Qemu-devel] [PULL v2 for 3.0 1/5] sifive_e: Fix crash when introspecting the device |
Date: |
Thu, 19 Jul 2018 09:07:17 -0700 |
Use the new object_initialize_child() and sysbus_init_child_obj() to
fix the issue.
Signed-off-by: Alistair Francis <address@hidden>
Suggested-by: Thomas Huth <address@hidden>
Reviewed-by: Michael Clark <address@hidden>
Reviewed-by: Thomas Huth <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Tested-by: Philippe Mathieu-Daudé <address@hidden>
---
hw/riscv/sifive_e.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/hw/riscv/sifive_e.c b/hw/riscv/sifive_e.c
index 8a8dbe1c00..4577d72037 100644
--- a/hw/riscv/sifive_e.c
+++ b/hw/riscv/sifive_e.c
@@ -105,9 +105,9 @@ static void riscv_sifive_e_init(MachineState *machine)
int i;
/* Initialize SoC */
- object_initialize(&s->soc, sizeof(s->soc), TYPE_RISCV_E_SOC);
- 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_E_SOC,
+ &error_abort, NULL);
object_property_set_bool(OBJECT(&s->soc), true, "realized",
&error_abort);
@@ -139,9 +139,9 @@ static void riscv_sifive_e_soc_init(Object *obj)
{
SiFiveESoCState *s = RISCV_E_SOC(obj);
- object_initialize(&s->cpus, sizeof(s->cpus), TYPE_RISCV_HART_ARRAY);
- object_property_add_child(obj, "cpus", OBJECT(&s->cpus),
- &error_abort);
+ object_initialize_child(obj, "cpus", &s->cpus,
+ sizeof(s->cpus), TYPE_RISCV_HART_ARRAY,
+ &error_abort, NULL);
object_property_set_str(OBJECT(&s->cpus), SIFIVE_E_CPU, "cpu-type",
&error_abort);
object_property_set_int(OBJECT(&s->cpus), smp_cpus, "num-harts",
--
2.17.1
- [Qemu-devel] [PULL v2 for 3.0 0/5] riscv-pull queue, Alistair Francis, 2018/07/19
- [Qemu-devel] [PULL v2 for 3.0 1/5] sifive_e: Fix crash when introspecting the device,
Alistair Francis <=
- [Qemu-devel] [PULL v2 for 3.0 3/5] virt: Fix crash when introspecting the device, Alistair Francis, 2018/07/19
- [Qemu-devel] [PULL v2 for 3.0 5/5] spike: Fix crash when introspecting the device, Alistair Francis, 2018/07/19
- [Qemu-devel] [PULL v2 for 3.0 4/5] riscv_hart: Fix crash when introspecting the device, Alistair Francis, 2018/07/19
- [Qemu-devel] [PULL v2 for 3.0 2/5] sifive_u: Fix crash when introspecting the device, Alistair Francis, 2018/07/19
- Re: [Qemu-devel] [PULL v2 for 3.0 0/5] riscv-pull queue, Peter Maydell, 2018/07/19