]> git.proxmox.com Git - mirror_qemu.git/commit
block: use BDRV_POLL_WHILE() in bdrv_rw_vmstate()
authorStefan Hajnoczi <stefanha@redhat.com>
Mon, 22 May 2017 13:57:02 +0000 (14:57 +0100)
committerKevin Wolf <kwolf@redhat.com>
Mon, 26 Jun 2017 12:51:13 +0000 (14:51 +0200)
commitea17c9d20d7396351be5e14317354519ff53721d
tree5d0b21d9906d6b2144ff19c45bf24787cc11a0ee
parentdc88a467ec7214c3086094033daf2aba554337b1
block: use BDRV_POLL_WHILE() in bdrv_rw_vmstate()

Calling aio_poll() directly may have been fine previously, but this is
the future, man!  The difference between an aio_poll() loop and
BDRV_POLL_WHILE() is that BDRV_POLL_WHILE() releases the AioContext
around aio_poll().

This allows the IOThread to run fd handlers or BHs to complete the
request.  Failure to release the AioContext causes deadlocks.

Using BDRV_POLL_WHILE() partially fixes a 'savevm' hang with -object
iothread.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/io.c