From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59372) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vt1i4-00027S-Cg for qemu-devel@nongnu.org; Tue, 17 Dec 2013 15:57:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vt1i2-0003Au-C9 for qemu-devel@nongnu.org; Tue, 17 Dec 2013 15:57:44 -0500 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:43649) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vt1i2-00038y-4p for qemu-devel@nongnu.org; Tue, 17 Dec 2013 15:57:42 -0500 From: Peter Maydell Date: Tue, 17 Dec 2013 20:28:30 +0000 Message-Id: <1387312160-12318-13-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1387312160-12318-1-git-send-email-peter.maydell@linaro.org> References: <1387312160-12318-1-git-send-email-peter.maydell@linaro.org> Subject: [Qemu-devel] [PULL 12/62] arm/highbank: Use object_new() rather than cpu_arm_init() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Blue Swirl , qemu-devel@nongnu.org, Aurelien Jarno From: Peter Crosthwaite 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(-) diff --git a/hw/arm/highbank.c b/hw/arm/highbank.c index fe98ef1..1d19d8f 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); } -- 1.8.5