qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH 18/27] pc: isolate the code that create CPUs


From: Eduardo Habkost
Subject: [Qemu-devel] [PATCH 18/27] pc: isolate the code that create CPUs
Date: Wed, 24 Oct 2012 15:49:52 -0200

The code will get more complex, so put it outside the for loop, into a
separate function.

Signed-off-by: Eduardo Habkost <address@hidden>
---
 hw/pc.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/hw/pc.c b/hw/pc.c
index 0e01003..85eab04 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -859,6 +859,14 @@ void pc_acpi_smi_interrupt(void *opaque, int irq, int 
level)
     }
 }
 
+static void pc_cpu_init(PCInitArgs *args, int cpu_index)
+{
+    if (!cpu_x86_init(args->qemu_args->cpu_model)) {
+        fprintf(stderr, "Unable to find x86 CPU definition\n");
+        exit(1);
+    }
+}
+
 void pc_cpus_init(PCInitArgs *args)
 {
     int i;
@@ -869,10 +877,7 @@ void pc_cpus_init(PCInitArgs *args)
     }
 
     for (i = 0; i < smp_cpus; i++) {
-        if (!cpu_x86_init(args->qemu_args->cpu_model)) {
-            fprintf(stderr, "Unable to find x86 CPU definition\n");
-            exit(1);
-        }
+        pc_cpu_init(args, i);
     }
 }
 
-- 
1.7.11.7




reply via email to

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