diff options
author | Kevin Wolf | 2018-09-20 17:39:13 +0200 |
---|---|---|
committer | Kevin Wolf | 2018-09-25 15:50:15 +0200 |
commit | d8b3afd597d54e496809b05ac39ac29a5799664f (patch) | |
tree | 358214b68c3d62d3943b80c22d744d0e32764475 /include/qemu/job.h | |
parent | block: Use a single global AioWait (diff) | |
download | qemu-d8b3afd597d54e496809b05ac39ac29a5799664f.tar.gz qemu-d8b3afd597d54e496809b05ac39ac29a5799664f.tar.xz qemu-d8b3afd597d54e496809b05ac39ac29a5799664f.zip |
test-bdrv-drain: Test draining job source child and parent
For the block job drain test, don't only test draining the source and
the target node, but create a backing chain for the source
(source_backing <- source <- source_overlay) and test draining each of
the nodes in it.
When using iothreads, the source node (and therefore the job) is in a
different AioContext than the drain, which happens from the main
thread. This way, the main thread waits in AIO_WAIT_WHILE() for the
iothread to make process and aio_wait_kick() is required to notify it.
The test validates that calling bdrv_wakeup() for a child or a parent
node will actually notify AIO_WAIT_WHILE() instead of letting it hang.
Increase the sleep time a bit (to 1 ms) because the test case is racy
and with the shorter sleep, it didn't reproduce the bug it is supposed
to test for me under 'rr record -n'.
This was because bdrv_drain_invoke_entry() (in the main thread) was only
called after the job had already reached the pause point, so we got a
bdrv_dec_in_flight() from the main thread and the additional
aio_wait_kick() when the job becomes idle (that we really wanted to test
here) wasn't even necessary any more to make progress.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'include/qemu/job.h')
0 files changed, 0 insertions, 0 deletions