From f282f29626b6ce65641fb5f8cb631aaade0e51c5 Mon Sep 17 00:00:00 2001 From: Peter Crosthwaite Date: Tue, 17 Dec 2013 19:42:28 +0000 Subject: arm/highbank: Use object_new() rather than cpu_arm_init() To allow the machine model to set device properties before CPU realization. Signed-off-by: Peter Crosthwaite Reviewed-by: Peter Maydell Message-id: 8c671e500390c8be0cc363e887e32867d1d1b0d2.1387160489.git.peter.crosthwaite@xilinx.com Signed-off-by: Peter Maydell --- hw/arm/highbank.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'hw/arm') diff --git a/hw/arm/highbank.c b/hw/arm/highbank.c index fe98ef10cb..1d19d8f25e 100644 --- a/hw/arm/highbank.c +++ b/hw/arm/highbank.c @@ -26,6 +26,7 @@ #include "hw/boards.h" #include "sysemu/blockdev.h" #include "exec/address-spaces.h" +#include "qemu/error-report.h" #define SMP_BOOT_ADDR 0x100 #define SMP_BOOT_REG 0x40 @@ -229,10 +230,15 @@ static void calxeda_init(QEMUMachineInitArgs *args, enum cxmachines machine) } for (n = 0; n < smp_cpus; n++) { + ObjectClass *oc = cpu_class_by_name(TYPE_ARM_CPU, cpu_model); ARMCPU *cpu; - cpu = cpu_arm_init(cpu_model); - if (cpu == NULL) { - fprintf(stderr, "Unable to find CPU definition\n"); + Error *err = NULL; + + cpu = ARM_CPU(object_new(object_class_get_name(oc))); + + object_property_set_bool(OBJECT(cpu), true, "realized", &err); + if (err) { + error_report("%s", error_get_pretty(err)); exit(1); } -- cgit v1.2.1