From patchwork Tue Jun 2 05:12:32 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Glauber Costa X-Patchwork-Id: 27388 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 n5256r1m030399 for ; Tue, 2 Jun 2009 05:06:54 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753944AbZFBFGs (ORCPT ); Tue, 2 Jun 2009 01:06:48 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753198AbZFBFGs (ORCPT ); Tue, 2 Jun 2009 01:06:48 -0400 Received: from mx2.redhat.com ([66.187.237.31]:50673 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752755AbZFBFGs (ORCPT ); Tue, 2 Jun 2009 01:06:48 -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 n5256odr030462 for ; Tue, 2 Jun 2009 01:06:50 -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 n5256nXV018252; Tue, 2 Jun 2009 01:06:49 -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 n5256lVB022499; Tue, 2 Jun 2009 01:06:48 -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:12:32 -0300 Message-Id: <1243919552-16364-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..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);