From: Glauber Costa Subject: [PATCH v2 4/6] remove created from kvm_state Date: Tue, 21 Jul 2009 18:13:10 -0400 Message-ID: <1248214392-12533-5-git-send-email-glommer@redhat.com> References: <1248214392-12533-1-git-send-email-glommer@redhat.com> <1248214392-12533-2-git-send-email-glommer@redhat.com> <1248214392-12533-3-git-send-email-glommer@redhat.com> <1248214392-12533-4-git-send-email-glommer@redhat.com> Cc: avi@redhat.com To: kvm@vger.kernel.org Return-path: Received: from mx2.redhat.com ([66.187.237.31]:54768 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756362AbZGUWNP (ORCPT ); Tue, 21 Jul 2009 18:13:15 -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 n6LMDFLi023929 for ; Tue, 21 Jul 2009 18:13:15 -0400 In-Reply-To: <1248214392-12533-4-git-send-email-glommer@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Again, CPUState has it, and it means exactly that. Signed-off-by: Glauber Costa --- cpu-defs.h | 1 - qemu-kvm.c | 10 +++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/cpu-defs.h b/cpu-defs.h index fce366f..ce9f96a 100644 --- a/cpu-defs.h +++ b/cpu-defs.h @@ -142,7 +142,6 @@ struct qemu_work_item; struct KVMCPUState { pthread_t thread; int signalled; - int created; void *vcpu_ctx; struct qemu_work_item *queued_work_first, *queued_work_last; }; diff --git a/qemu-kvm.c b/qemu-kvm.c index a8298e4..cef522d 100644 --- a/qemu-kvm.c +++ b/qemu-kvm.c @@ -1727,12 +1727,12 @@ void kvm_update_interrupt_request(CPUState *env) int signal = 0; if (env) { - if (!current_env || !current_env->kvm_cpu_state.created) + if (!current_env || !current_env->created) signal = 1; /* * Testing for created here is really redundant */ - if (current_env && current_env->kvm_cpu_state.created && + if (current_env && current_env->created && env != current_env && !env->kvm_cpu_state.signalled) signal = 1; @@ -2012,7 +2012,7 @@ static void *ap_main_loop(void *_env) /* signal VCPU creation */ pthread_mutex_lock(&qemu_mutex); - current_env->kvm_cpu_state.created = 1; + current_env->created = 1; pthread_cond_signal(&qemu_vcpu_cond); /* and wait for machine initialization */ @@ -2028,13 +2028,13 @@ void kvm_init_vcpu(CPUState *env) { pthread_create(&env->kvm_cpu_state.thread, NULL, ap_main_loop, env); - while (env->kvm_cpu_state.created == 0) + while (env->created == 0) qemu_cond_wait(&qemu_vcpu_cond); } int kvm_vcpu_inited(CPUState *env) { - return env->kvm_cpu_state.created; + return env->created; } #ifdef TARGET_I386 -- 1.6.2.2