From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:54505) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R4ajI-0000lx-NW for qemu-devel@nongnu.org; Fri, 16 Sep 2011 11:53:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R4ajC-0000ZE-Fp for qemu-devel@nongnu.org; Fri, 16 Sep 2011 11:53:28 -0400 Received: from verein.lst.de ([213.95.11.211]:38412 helo=newverein.lst.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R4ajC-0000YT-8h for qemu-devel@nongnu.org; Fri, 16 Sep 2011 11:53:22 -0400 Date: Fri, 16 Sep 2011 17:53:20 +0200 From: Christoph Hellwig Message-ID: <20110916155320.GA28201@lst.de> References: <1315628610-28222-1-git-send-email-ronniesahlberg@gmail.com> <1315628610-28222-2-git-send-email-ronniesahlberg@gmail.com> <20110912091408.GA3465@stefanha-thinkpad.localdomain> <20110914143608.GB12218@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH] This patch adds a new block driver : iSCSI List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: kwolf@redhat.com, Stefan Hajnoczi , qemu-devel@nongnu.org, fujita.tomonori@lab.ntt.co.jp, Ronnie Sahlberg , Christoph Hellwig On Wed, Sep 14, 2011 at 04:50:25PM +0100, Stefan Hajnoczi wrote: > I think in this case it will not make the code nicer. Since the > external iSCSI library is based on callbacks it would be necessary to > write the coroutines<->callbacks adapter functions. So for example, > the READ10 command would need a function that can be called in > coroutine context and yields while libiscsi does the I/O. When the > callback is invoked it will re-enter the coroutine. > > The area where coroutines are useful in the block layer is for image > formats. We already have common coroutines<->callback adapter > functions in block.c so it's possible to write sequential code for > image formats. They only need access to block layer functions which > have already been adapted. But as soon as you interact with a > callback-based API from the coroutine, then you need to write an > adapter yourself. So you plan on keeping the aio interface around forever? Qemu with two different I/O pathes was already more than painful enough, I don't think keeping three, and two of them beeing fairly complex is a good idea.