From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34320) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VnqaF-0002nn-2B for qemu-devel@nongnu.org; Tue, 03 Dec 2013 09:04:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vnqa6-0001BQ-LP for qemu-devel@nongnu.org; Tue, 03 Dec 2013 09:04:14 -0500 Received: from mail-wg0-x233.google.com ([2a00:1450:400c:c00::233]:65271) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vnqa6-0001BK-E4 for qemu-devel@nongnu.org; Tue, 03 Dec 2013 09:04:06 -0500 Received: by mail-wg0-f51.google.com with SMTP id b13so10508246wgh.6 for ; Tue, 03 Dec 2013 06:04:05 -0800 (PST) Date: Tue, 3 Dec 2013 15:04:01 +0100 From: Stefan Hajnoczi Message-ID: <20131203140401.GE24604@stefanha-thinkpad.muc.redhat.com> References: <1385104578-19369-1-git-send-email-bharata@linux.vnet.ibm.com> <1385104578-19369-2-git-send-email-bharata@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1385104578-19369-2-git-send-email-bharata@linux.vnet.ibm.com> Subject: Re: [Qemu-devel] [RFC PATCH v0 1/3] gluster: Convert aio routines into coroutines List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Bharata B Rao Cc: kwolf@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com 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.