Skip to contentSkip to conversation

clean up cpu hotplug code

PATCH New Glauber Costa 1 participant 1 message Jun 2, 2009 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 clean up cpu hotplug code

There's nothing kvm specific in get_cpu function. Remove it from kvm ifdef. Buy us a cleaner code, and may help us with any attempt of integrating this on the future.

---
 hw/acpi.c |   12 +++---------
 1 files changed, 3 insertions(+), 9 deletions(-)
hw/acpi.c +3 -9
index f4062ac..2b16437 100644
@@ -770,9 +770,7 @@ static void disable_processor(struct gpe_regs *g, int cpu)
     g->cpus_sts[cpu/8] &= ~(1 << (cpu%8));
 }
 
-#if defined(TARGET_I386) || defined(TARGET_X86_64)
-#ifdef USE_KVM
-static CPUState *qemu_kvm_cpu_env(int index)
+static CPUState *qemu_get_cpu_env(int index)
 {
     CPUState *penv;
 
@@ -786,18 +784,14 @@ static CPUState *qemu_kvm_cpu_env(int index)
 
     return NULL;
 }
-#endif
 
+#if defined(TARGET_I386) || defined(TARGET_X86_64)
 
 void qemu_system_cpu_hot_add(int cpu, int state)
 {
     CPUState *env;
 
-    if (state
-#ifdef USE_KVM
-        && (!qemu_kvm_cpu_env(cpu))
-#endif
-    ) {
+    if (state i&& (!qemu_kvm_cpu_env(cpu))) {
         env = pc_new_cpu(cpu, model, 1);
         if (!env) {
             fprintf(stderr, "cpu %d creation failed\n", cpu);
Signature · 1 line
1.6.0.6