From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH] qemu-kvm: Fix test for I/O thread Date: Sat, 19 Jul 2008 10:17:18 +0300 Message-ID: <488194FE.5010404@qumranet.com> References: <48804FE7.4090507@siemens.com> <48819143.1010702@qumranet.com> <488192BC.7000807@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm-devel To: Jan Kiszka Return-path: Received: from il.qumranet.com ([212.179.150.194]:49499 "EHLO il.qumranet.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751334AbYGSHRT (ORCPT ); Sat, 19 Jul 2008 03:17:19 -0400 In-Reply-To: <488192BC.7000807@web.de> Sender: kvm-owner@vger.kernel.org List-ID: Jan Kiszka wrote: > Avi Kivity wrote: > >> Jan Kiszka wrote: >> >>> Looks to me like this was rather intended. But given that >>> 4e8b8a6d92c5ece048e65be3a3980d24f065b32b claims to actually fix a bug in >>> its original broken form, please have a careful look. >>> >>> Signed-off-by: Jan Kiszka >>> >>> diff --git a/qemu/qemu-kvm.c b/qemu/qemu-kvm.c >>> index 431e26d..c36f60f 100644 >>> --- a/qemu/qemu-kvm.c >>> +++ b/qemu/qemu-kvm.c >>> @@ -89,7 +89,7 @@ static void qemu_cond_wait(pthread_cond_t *cond) >>> pthread_cond_timedwait(cond, &qemu_mutex, &ts); >>> /* If we're the I/O thread, some other thread may be waiting for aio >>> * completion */ >>> - if (!vcpu_info) >>> + if (!env) >>> qemu_aio_poll(); >>> cpu_single_env = env; >>> } >>> >>> >> Aren't the two lines equivalent? vcpu_info is a thread-local-storage >> variable, and is unset for the iothread. >> >> > > Then you probably wanted to type 'vcpu', don't you? :) > > Doh. > However, I would stick with what the function already uses, ie. 'env'. > env might be null even in a non-aio-thread (during initialization, perhaps?). I changed it to be vcpu since that's a stronger indicator. -- I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain.