]> git.proxmox.com Git - mirror_qemu.git/commit - blockjob.c
block: Really pause block jobs on drain
authorKevin Wolf <kwolf@redhat.com>
Thu, 22 Mar 2018 13:11:20 +0000 (14:11 +0100)
committerKevin Wolf <kwolf@redhat.com>
Mon, 18 Jun 2018 13:03:25 +0000 (15:03 +0200)
commit89bd030533e3592ca0a995450dcfc5d53e459e20
tree565f35b4251f99f5ea34d1d19f03a979f36c6df8
parent1cc8e54ada97f7ac479554e15ca9e426c895b158
block: Really pause block jobs on drain

We already requested that block jobs be paused in .bdrv_drained_begin,
but no guarantee was made that the job was actually inactive at the
point where bdrv_drained_begin() returned.

This introduces a new callback BdrvChildRole.bdrv_drained_poll() and
uses it to make bdrv_drain_poll() consider block jobs using the node to
be drained.

For the test case to work as expected, we have to switch from
block_job_sleep_ns() to qemu_co_sleep_ns() so that the test job is even
considered active and must be waited for when draining the node.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block.c
block/io.c
block/mirror.c
blockjob.c
include/block/block.h
include/block/block_int.h
include/block/blockjob_int.h
tests/test-bdrv-drain.c