From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:36438) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGD7q-0004VO-FL for qemu-devel@nongnu.org; Mon, 24 Sep 2012 14:11:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TGD7m-0007q3-7a for qemu-devel@nongnu.org; Mon, 24 Sep 2012 14:11:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:14173) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGD7l-0007pk-Vh for qemu-devel@nongnu.org; Mon, 24 Sep 2012 14:11:18 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q8OIBHG9014435 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 24 Sep 2012 14:11:17 -0400 From: Juan Quintela In-Reply-To: <505C638F.7050306@redhat.com> (Paolo Bonzini's message of "Fri, 21 Sep 2012 14:54:39 +0200") References: <1348217255-22441-1-git-send-email-quintela@redhat.com> <1348217255-22441-42-git-send-email-quintela@redhat.com> <505C638F.7050306@redhat.com> Date: Mon, 24 Sep 2012 20:11:15 +0200 Message-ID: <87haqnqojg.fsf@trasno.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH 41/41] cpus: create qemu_cpu_is_vcpu() Reply-To: quintela@redhat.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org Paolo Bonzini wrote: > Il 21/09/2012 10:47, Juan Quintela ha scritto: >> Old code used !io_thread to know if a thread was an vcpu or not. That >> fails when we introduce the iothread. >> >> Signed-off-by: Juan Quintela >> --- >> cpus.c | 9 +++++++-- >> 1 file changed, 7 insertions(+), 2 deletions(-) >> >> diff --git a/cpus.c b/cpus.c >> index e476a3c..1b7061a 100644 >> --- a/cpus.c >> +++ b/cpus.c >> @@ -902,6 +902,11 @@ int qemu_cpu_is_self(void *_env) >> return qemu_thread_is_self(cpu->thread); >> } >> >> +static bool qemu_cpu_is_vcpu(void) >> +{ >> + return cpu_single_env && qemu_cpu_is_self(&cpu_single_env); > > Should be "cpu_single_env && qemu_cpu_is_self(&cpu_single_env)". > > Please named the function qemu_in_vcpu_thread. Agreed to both changes. Later, Juan.