On Mon, Sep 16, 2019 at 01:24:12PM +0200, Sergio Lopez wrote:
> virtio_notify_config() needs to acquire the global mutex, which isn't
> allowed from an iothread, and may lead to a deadlock like this:
> 
>  - main thead
>   * Has acquired: qemu_global_mutex.
>   * Is trying the acquire: iothread AioContext lock via
>     AIO_WAIT_WHILE (after aio_poll).
> 
>  - iothread
>   * Has acquired: AioContext lock.
>   * Is trying to acquire: qemu_global_mutex (via
>     virtio_notify_config->prepare_mmio_access).
> 
> If virtio_blk_resize() is called from an iothread, schedule
> virtio_notify_config() to be run in the main context BH.
> 
> Signed-off-by: Sergio Lopez <s...@redhat.com>
> ---
> Changelog
> 
> v3:
>  - Unconditionally schedule the work to be done in the main context BH
>    (thanks John Snow and Kevin Wolf).
> 
> v2:
>  - Use aio_bh_schedule_oneshot instead of scheduling a coroutine
>    (thanks Kevin Wolf).
>  - Switch from RFC to v2 patch.
> ---
>  hw/block/virtio-blk.c | 17 ++++++++++++++++-
>  1 file changed, 16 insertions(+), 1 deletion(-)

Thanks, applied to my block tree:
https://github.com/stefanha/qemu/commits/block

Stefan

Attachment: signature.asc
Description: PGP signature

Reply via email to