[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] block: fix bdrv_ioctl called from coroutine
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH] block: fix bdrv_ioctl called from coroutine |
Date: |
Thu, 17 Dec 2015 13:51:42 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 |
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.
Paolo
Re: [Qemu-devel] [PATCH] block: fix bdrv_ioctl called from coroutine, Kevin Wolf, 2015/12/18