All of lore.kernel.org
 help / color / mirror / Atom feed
From: Glauber Costa <glommer@redhat.com>
To: kvm@vger.kernel.org
Cc: avi@redhat.com
Subject: [PATCH] clean up cpu hotplug code
Date: Tue,  2 Jun 2009 02:12:32 -0300	[thread overview]
Message-ID: <1243919552-16364-1-git-send-email-glommer@redhat.com> (raw)

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.

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

diff --git a/hw/acpi.c b/hw/acpi.c
index f4062ac..2b16437 100644
--- a/hw/acpi.c
+++ b/hw/acpi.c
@@ -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);
-- 
1.6.0.6


             reply	other threads:[~2009-06-02  5:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-02  5:12 Glauber Costa [this message]
2009-06-02  5:42 [PATCH] clean up cpu hotplug code Glauber Costa
2009-06-02 12:01 ` Avi Kivity

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1243919552-16364-1-git-send-email-glommer@redhat.com \
    --to=glommer@redhat.com \
    --cc=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.