public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] replace qemu_kvm_cpu_env
@ 2009-07-15 17:22 Glauber Costa
  2009-07-20 15:21 ` Marcelo Tosatti
  0 siblings, 1 reply; 2+ messages in thread
From: Glauber Costa @ 2009-07-15 17:22 UTC (permalink / raw)
  To: kvm; +Cc: avi

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

Signed-off-by: Glauber Costa <glommer@redhat.com>
---
 hw/acpi.c |   24 +-----------------------
 1 files changed, 1 insertions(+), 23 deletions(-)

diff --git a/hw/acpi.c b/hw/acpi.c
index 7de9cb7..d23abd1 100644
--- a/hw/acpi.c
+++ b/hw/acpi.c
@@ -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);
-- 
1.6.2.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] replace qemu_kvm_cpu_env
  2009-07-15 17:22 [PATCH] replace qemu_kvm_cpu_env Glauber Costa
@ 2009-07-20 15:21 ` Marcelo Tosatti
  0 siblings, 0 replies; 2+ messages in thread
From: Marcelo Tosatti @ 2009-07-20 15:21 UTC (permalink / raw)
  To: Glauber Costa; +Cc: kvm, avi

On Wed, Jul 15, 2009 at 01:22:12PM -0400, Glauber Costa wrote:
> We now have an upstream qemu function that does exactly that,
> but in a kvm-independent way. Use it.
> 
> Signed-off-by: Glauber Costa <glommer@redhat.com>
> ---
>  hw/acpi.c |   24 +-----------------------
>  1 files changed, 1 insertions(+), 23 deletions(-)
> 
> diff --git a/hw/acpi.c b/hw/acpi.c
> index 7de9cb7..d23abd1 100644
> --- a/hw/acpi.c
> +++ b/hw/acpi.c
> @@ -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);

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-07-20 15:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-15 17:22 [PATCH] replace qemu_kvm_cpu_env Glauber Costa
2009-07-20 15:21 ` Marcelo Tosatti

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox