From patchwork Wed Jul 15 17:22:12 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Glauber Costa X-Patchwork-Id: 35730 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 n6FHMHc1016193 for ; Wed, 15 Jul 2009 17:22:17 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755697AbZGORWP (ORCPT ); Wed, 15 Jul 2009 13:22:15 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755694AbZGORWP (ORCPT ); Wed, 15 Jul 2009 13:22:15 -0400 Received: from mx2.redhat.com ([66.187.237.31]:53106 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755640AbZGORWO (ORCPT ); Wed, 15 Jul 2009 13:22:14 -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 n6FHME8T018973 for ; Wed, 15 Jul 2009 13:22:14 -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 n6FHMDPu003913; Wed, 15 Jul 2009 13:22:13 -0400 Received: from localhost.localdomain (virtlab1.virt.bos.redhat.com [10.16.72.21]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n6FHMCPp025071; Wed, 15 Jul 2009 13:22:13 -0400 From: Glauber Costa To: kvm@vger.kernel.org Cc: avi@redhat.com Subject: [PATCH] replace qemu_kvm_cpu_env Date: Wed, 15 Jul 2009 13:22:12 -0400 Message-Id: <1247678532-7504-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 We now have an upstream qemu function that does exactly that, but in a kvm-independent way. Use it. Signed-off-by: Glauber Costa --- 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);