qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH arm-devs v1 3/6] arm/highbank: Use object_new() rath


From: Peter Crosthwaite
Subject: [Qemu-devel] [PATCH arm-devs v1 3/6] arm/highbank: Use object_new() rather than cpu_arm_init()
Date: Wed, 27 Nov 2013 01:02:15 -0800

To allow the machine model to set device properties before CPU
realization.

Signed-off-by: Peter Crosthwaite <address@hidden>
---

 hw/arm/highbank.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/hw/arm/highbank.c b/hw/arm/highbank.c
index fe98ef1..70831ba 100644
--- a/hw/arm/highbank.c
+++ b/hw/arm/highbank.c
@@ -228,11 +228,18 @@ static void calxeda_init(QEMUMachineInitArgs *args, enum 
cxmachines machine)
         }
     }
 
+    cpu_model = g_strdup_printf("%s-" TYPE_ARM_CPU, cpu_model);
+
     for (n = 0; n < smp_cpus; n++) {
         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(cpu_model));
+        g_free((void *)cpu_model);
+
+        object_property_set_bool(OBJECT(cpu), true, "realized", &err);
+        if (err) {
+            fprintf(stderr, "%s\n", error_get_pretty(err));
             exit(1);
         }
 
-- 
1.8.4.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]