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.


Reply via email to