On Thu, 12/17 13:51, Paolo Bonzini wrote: > > > On 17/12/2015 13:33, Fam Zheng wrote: > > > In the coroutine case, the yield is hidden in the drivers, and it may or > > > may not happen. For example, qcow2_co_flush_to_os starts with > > > > > > qemu_co_mutex_lock(&s->lock); > > > > > > which can yield. > > > > bdrv_ioctl, on the contrary, is emulated with .bdrv_aio_ioctl, so it always > > yields (unless -ENOTSUP), that's why I think aio_poll() is necessary in both > > branches. > > But why should it yield, if called in coroutine context? bdrv_flush > doesn't yield if emulated with .bdrv_aio_flush *and* called in coroutine > context. bdrv_ioctl should do the same, I think. >
Looking at bdrv_flush again I see what you mean. Thanks for explaining! Reviewed-by: Fam Zheng <f...@redhat.com>