From patchwork Fri Oct 9 18:03:11 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Glauber Costa X-Patchwork-Id: 52775 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 n99I6uNt012234 for ; Fri, 9 Oct 2009 18:06:56 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761241AbZJISDy (ORCPT ); Fri, 9 Oct 2009 14:03:54 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1761240AbZJISDy (ORCPT ); Fri, 9 Oct 2009 14:03:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:61514 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761231AbZJISDw (ORCPT ); Fri, 9 Oct 2009 14:03:52 -0400 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n99I3R52011137 for ; Fri, 9 Oct 2009 14:03:27 -0400 Received: from localhost.localdomain (vpn-12-36.rdu.redhat.com [10.11.12.36]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n99I3JJB017374; Fri, 9 Oct 2009 14:03:26 -0400 From: Glauber Costa To: kvm@vger.kernel.org Cc: avi@redhat.com Subject: [PATCH 03/10] remove unneded opaque. Date: Fri, 9 Oct 2009 15:03:11 -0300 Message-Id: <1255111398-15251-4-git-send-email-glommer@redhat.com> In-Reply-To: <1255111398-15251-3-git-send-email-glommer@redhat.com> References: <1255111398-15251-1-git-send-email-glommer@redhat.com> <1255111398-15251-2-git-send-email-glommer@redhat.com> <1255111398-15251-3-git-send-email-glommer@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.16 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org diff --git a/qemu-kvm-ia64.c b/qemu-kvm-ia64.c index d26c2a9..a11fde8 100644 --- a/qemu-kvm-ia64.c +++ b/qemu-kvm-ia64.c @@ -30,7 +30,7 @@ int kvm_arch_init_vcpu(CPUState *cenv) return 0; } -int kvm_arch_halt(void *opaque, kvm_vcpu_context_t vcpu) +int kvm_arch_halt(kvm_vcpu_context_t vcpu) { CPUState *env = cpu_single_env; env->hflags |= HF_HALTED_MASK; diff --git a/qemu-kvm-x86.c b/qemu-kvm-x86.c index e8ec59d..7546fcb 100644 --- a/qemu-kvm-x86.c +++ b/qemu-kvm-x86.c @@ -1357,7 +1357,7 @@ int kvm_arch_init_vcpu(CPUState *cenv) return 0; } -int kvm_arch_halt(void *opaque, kvm_vcpu_context_t vcpu) +int kvm_arch_halt(kvm_vcpu_context_t vcpu) { CPUState *env = cpu_single_env; diff --git a/qemu-kvm.c b/qemu-kvm.c index 4ad6856..b92a68e 100644 --- a/qemu-kvm.c +++ b/qemu-kvm.c @@ -97,11 +97,10 @@ int kvm_abi = EXPECTED_KVM_API_VERSION; int kvm_page_size; #ifdef KVM_CAP_SET_GUEST_DEBUG -static int kvm_debug(void *opaque, void *data, +static int kvm_debug(CPUState *env, struct kvm_debug_exit_arch *arch_info) { int handle = kvm_arch_debug(arch_info); - CPUState *env = data; if (handle) { kvm_debug_cpu_requested = env; @@ -816,9 +815,8 @@ int handle_debug(kvm_vcpu_context_t vcpu, void *env) { #ifdef KVM_CAP_SET_GUEST_DEBUG struct kvm_run *run = vcpu->run; - kvm_context_t kvm = vcpu->kvm; - return kvm_debug(kvm->opaque, env, &run->debug.arch); + return kvm_debug(env, &run->debug.arch); #else return 0; #endif @@ -895,11 +893,6 @@ int handle_io_window(kvm_context_t kvm) return 1; } -int handle_halt(kvm_vcpu_context_t vcpu) -{ - return kvm_arch_halt(vcpu->kvm->opaque, vcpu); -} - int handle_shutdown(kvm_context_t kvm, CPUState *env) { /* stop the current vcpu from going back to guest mode */ @@ -1019,7 +1012,7 @@ int kvm_run(kvm_vcpu_context_t vcpu, void *env) r = handle_mmio(vcpu); break; case KVM_EXIT_HLT: - r = handle_halt(vcpu); + r = kvm_arch_halt(vcpu); break; case KVM_EXIT_IRQ_WINDOW_OPEN: break; diff --git a/qemu-kvm.h b/qemu-kvm.h index e957e96..e51dd2c 100644 --- a/qemu-kvm.h +++ b/qemu-kvm.h @@ -1109,7 +1109,7 @@ struct ioperm_data { }; void qemu_kvm_cpu_stop(CPUState *env); -int kvm_arch_halt(void *opaque, kvm_vcpu_context_t vcpu); +int kvm_arch_halt(kvm_vcpu_context_t vcpu); int handle_tpr_access(void *opaque, kvm_vcpu_context_t vcpu, uint64_t rip, int is_write); int kvm_has_sync_mmu(void);