From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41982) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VoXfu-0007X8-5d for qemu-devel@nongnu.org; Thu, 05 Dec 2013 07:05:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VoXfl-0006QQ-7a for qemu-devel@nongnu.org; Thu, 05 Dec 2013 07:04:58 -0500 Received: from e23smtp06.au.ibm.com ([202.81.31.148]:34317) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VoXfk-0006QA-5V for qemu-devel@nongnu.org; Thu, 05 Dec 2013 07:04:49 -0500 Received: from /spool/local by e23smtp06.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 5 Dec 2013 20:48:46 +1000 Received: from d23relay03.au.ibm.com (d23relay03.au.ibm.com [9.190.235.21]) by d23dlp03.au.ibm.com (Postfix) with ESMTP id 2E004357815D for ; Thu, 5 Dec 2013 21:41:31 +1100 (EST) Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97]) by d23relay03.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id rB5AfDxX11403556 for ; Thu, 5 Dec 2013 21:41:18 +1100 Received: from d23av03.au.ibm.com (localhost [127.0.0.1]) by d23av03.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id rB5AfPYn019611 for ; Thu, 5 Dec 2013 21:41:25 +1100 Date: Thu, 5 Dec 2013 16:12:43 +0530 From: Bharata B Rao Message-ID: <20131205104243.GA21197@in.ibm.com> References: <1385104578-19369-1-git-send-email-bharata@linux.vnet.ibm.com> <1385104578-19369-2-git-send-email-bharata@linux.vnet.ibm.com> <20131203140401.GE24604@stefanha-thinkpad.muc.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20131203140401.GE24604@stefanha-thinkpad.muc.redhat.com> Subject: Re: [Qemu-devel] [RFC PATCH v0 1/3] gluster: Convert aio routines into coroutines Reply-To: bharata@linux.vnet.ibm.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: kwolf@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com On Tue, Dec 03, 2013 at 03:04:01PM +0100, Stefan Hajnoczi wrote: > On Fri, Nov 22, 2013 at 12:46:16PM +0530, Bharata B Rao wrote: > > + qemu_bh_delete(acb->bh); > > + acb->bh = NULL; > > + qemu_coroutine_enter(acb->coroutine, NULL); > > + if (acb->finished) { > > + *acb->finished = true; > > + } > > Now that aio interfaces are gone ->finished and cancellation can be > removed. > > > + qemu_aio_release(acb); > > Please do this in the functions that called qemu_aio_get(). Coroutines > may yield so it's a little risky to assume the coroutine has finished > accessing acb. > > -static BlockDriverAIOCB *qemu_gluster_aio_rw(BlockDriverState *bs, > > - int64_t sector_num, QEMUIOVector *qiov, int nb_sectors, > > - BlockDriverCompletionFunc *cb, void *opaque, int write) > > +static coroutine_fn int qemu_gluster_aio_rw(BlockDriverState *bs, > > + int64_t sector_num, int nb_sectors, QEMUIOVector *qiov, int write) > > Please rename this to qemu_gluster_co_rw() since it isn't aio anymore > and doesn't return a BlockDriverAIOCB. Thanks will address these in v1. Regards, Bharata.