On Mon, Dec 10, 2012 at 7:11 AM, Stefan Hajnoczi <stefa...@gmail.com> wrote: > Quick pointers to get started on Kevin's suggestion: > > bdrv_aio_readv(), bdrv_aio_writev(), bdrv_aio_flush(), and > bdrv_aio_discard() provide the block device operations that emulated > storage controllers use.
There seems to be an issue with the bdrv_aio_[readv/writev] routines. I added some additional tracing in the block and coroutine code, and well, long story short, the coroutine "bdrv_co_io_em" needs to call "qemu_coroutine_yield" before his aio callback "bdrv_co_io_em_complete" invokes "qemu_coroutine_enter". It does not always win this race in my experiments, and qemu aborts with a recursive re-entry error. I don't know this coroutine code well enough to propose a fix -- I'd say maybe use locks but I think that defeats the purpose of using coroutines if I understand them correctly?