Skip to contentSkip to conversation

replace qemu_kvm_cpu_env

PATCH Applied Glauber Costa 2 participants 2 messages Jul 15, 2009 – Jul 20, 2009 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 replace qemu_kvm_cpu_env

We now have an upstream qemu function that does exactly that, but in a kvm-independent way. Use it.

---
 hw/acpi.c |   24 +-----------------------
 1 files changed, 1 insertions(+), 23 deletions(-)
hw/acpi.c +1 -23
index 7de9cb7..d23abd1 100644
@@ -775,33 +775,11 @@ static void disable_processor(struct gpe_regs *g, int cpu)
 }
 
 #if defined(TARGET_I386) || defined(TARGET_X86_64)
-#ifdef CONFIG_KVM
-static CPUState *qemu_kvm_cpu_env(int index)
-{
-    CPUState *penv;
-
-    penv = first_cpu;
-
-    while (penv) {
-        if (penv->cpu_index == index)
-            return penv;
-        penv = (CPUState *)penv->next_cpu;
-    }
-
-    return NULL;
-}
-#endif
-
-
 void qemu_system_cpu_hot_add(int cpu, int state)
 {
     CPUState *env;
 
-    if (state
-#ifdef CONFIG_KVM
-        && (!qemu_kvm_cpu_env(cpu))
-#endif
-    ) {
+    if (state && !qemu_get_cpu(cpu)) {
         env = pc_new_cpu(model);
         if (!env) {
             fprintf(stderr, "cpu %d creation failed\n", cpu);
Signature · 1 line
1.6.2.2
#1 lore raw
Quoted 37 lines · Glauber Costa

We now have an upstream qemu function that does exactly that, but in a kvm-independent way. Use it.

---
 hw/acpi.c |   24 +-----------------------
 1 files changed, 1 insertions(+), 23 deletions(-)
hw/acpi.c +0 -18
index 7de9cb7..d23abd1 100644
@@ -775,33 +775,11 @@ static void disable_processor(struct gpe_regs *g, int cpu)
 }
 
 #if defined(TARGET_I386) || defined(TARGET_X86_64)
-#ifdef CONFIG_KVM
-static CPUState *qemu_kvm_cpu_env(int index)
-{
-    CPUState *penv;
-
-    penv = first_cpu;
-
-    while (penv) {
-        if (penv->cpu_index == index)
-            return penv;
-        penv = (CPUState *)penv->next_cpu;
-    }
-
-    return NULL;
-}
-#endif
-
-
 void qemu_system_cpu_hot_add(int cpu, int state)
 {
     CPUState *env;

hw/acpi.c static void disable_processor(struct gpe_regs *g, int cpu) · line 785

Quoted 10 lines
hw/acpi.c +1 -5
 
-    if (state
-#ifdef CONFIG_KVM
-        && (!qemu_kvm_cpu_env(cpu))
-#endif
-    ) {
+    if (state && !qemu_get_cpu(cpu)) {
         env = pc_new_cpu(model);
         if (!env) {
             fprintf(stderr, "cpu %d creation failed\n", cpu);

Applied, thanks (did not apply the previous patchset because of the return error handling issue).