From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:46018) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RPr23-0007iG-Ph for qemu-devel@nongnu.org; Mon, 14 Nov 2011 02:32:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RPr22-00075J-U8 for qemu-devel@nongnu.org; Mon, 14 Nov 2011 02:32:43 -0500 Received: from lo.gmane.org ([80.91.229.12]:52583) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RPr22-00075B-P4 for qemu-devel@nongnu.org; Mon, 14 Nov 2011 02:32:42 -0500 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1RPr20-0000m4-Q5 for qemu-devel@nongnu.org; Mon, 14 Nov 2011 08:32:40 +0100 Received: from 93-34-178-161.ip50.fastwebnet.it ([93.34.178.161]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 14 Nov 2011 08:32:40 +0100 Received: from pbonzini by 93-34-178-161.ip50.fastwebnet.it with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 14 Nov 2011 08:32:40 +0100 From: Paolo Bonzini Date: Mon, 14 Nov 2011 08:32:27 +0100 Message-ID: References: <1321030042-20446-1-git-send-email-stefanha@linux.vnet.ibm.com> <1321030042-20446-3-git-send-email-stefanha@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit In-Reply-To: Subject: Re: [Qemu-devel] [PATCH 02/10] block: add .bdrv_co_is_allocated() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On 11/14/2011 04:04 AM, Zhi Yong Wu wrote: >> > + co = qemu_coroutine_create(bdrv_is_allocated_co_entry); >> > + qemu_coroutine_enter(co,&data); > Since this main process will stop within qemu_coroutine_enter() until > bdrv_is_allocated_co_entry() is completed, three lines of condition > codes below are unnecessary, right? No, they are necessary. They are executed when bdrv_is_allocated_co_entry calls qemu_coroutine_yield. >> > + while (!data.done) { >> > + qemu_aio_wait(); >> > + } Paolo