From patchwork Tue Jun 2 05:42:22 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Glauber Costa X-Patchwork-Id: 27390 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n525ahVq002333 for ; Tue, 2 Jun 2009 05:36:43 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757340AbZFBFgj (ORCPT ); Tue, 2 Jun 2009 01:36:39 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756691AbZFBFgi (ORCPT ); Tue, 2 Jun 2009 01:36:38 -0400 Received: from mx2.redhat.com ([66.187.237.31]:53405 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756143AbZFBFgi (ORCPT ); Tue, 2 Jun 2009 01:36:38 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n525aex4003931 for ; Tue, 2 Jun 2009 01:36:40 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n525adNN023461; Tue, 2 Jun 2009 01:36:39 -0400 Received: from localhost.localdomain (vpn-10-22.bos.redhat.com [10.16.10.22]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n525acbV026167; Tue, 2 Jun 2009 01:36:38 -0400 From: Glauber Costa To: kvm@vger.kernel.org Cc: avi@redhat.com Subject: [PATCH] clean up cpu hotplug code Date: Tue, 2 Jun 2009 02:42:22 -0300 Message-Id: <1243921342-17704-1-git-send-email-glommer@redhat.com> X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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 --- hw/acpi.c | 12 +++--------- 1 files changed, 3 insertions(+), 9 deletions(-) diff --git a/hw/acpi.c b/hw/acpi.c index f4062ac..7f23e4e 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 && (!qemu_get_cpu_env(cpu))) { env = pc_new_cpu(cpu, model, 1); if (!env) { fprintf(stderr, "cpu %d creation failed\n", cpu);