qemu-e2k/include/block
Kevin Wolf 4be6a6d118 block: Poll after drain on attaching a node
Commit dcf94a23b1 ('block: Don't poll in parent drain callbacks')
removed polling in bdrv_child_cb_drained_begin() on the grounds that the
original bdrv_drain() already will poll and BdrvChildRole.drained_begin
calls must not cause graph changes (and therefore must not call
aio_poll() or the recursion through the graph will break.

This reasoning is correct for calls through bdrv_do_drained_begin().
However, BdrvChildRole.drained_begin is also called when a node that is
already in a drained section (i.e. bdrv_do_drained_begin() has already
returned and therefore can't poll any more) is attached to a new parent.
In this case, we must explicitly poll to have all requests completed
before the drained new child can be attached to the parent.

In bdrv_replace_child_noperm(), we know that we're not inside the
recursion of bdrv_do_drained_begin() because graph changes are not
allowed there, and bdrv_replace_child_noperm() is a graph change. The
call of BdrvChildRole.drained_begin() must therefore be followed by a
BDRV_POLL_WHILE() that waits for the completion of requests.

Reported-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2018-07-10 10:36:15 +02:00
..
accounting.h block/accounting: introduce latency histogram 2018-03-19 14:58:37 -05:00
aio-wait.h block: Allow AIO_WAIT_WHILE with NULL ctx 2018-06-18 15:03:25 +02:00
aio.h linux-aio: properly bubble up errors from initialization 2018-06-27 13:06:34 +01:00
block_backup.h backup: Switch block_backup.h to byte-based 2017-07-10 13:18:06 +02:00
block_int.h block: Poll after drain on attaching a node 2018-07-10 10:36:15 +02:00
block.h block: Poll after drain on attaching a node 2018-07-10 10:36:15 +02:00
blockjob_int.h block: Really pause block jobs on drain 2018-06-18 15:03:25 +02:00
blockjob.h blockjob: Remove BlockJob.driver 2018-05-23 14:30:51 +02:00
dirty-bitmap.h block/dirty-bitmap: add bdrv_enable_dirty_bitmap_locked 2018-07-04 02:12:49 -04:00
nbd.h nbd/client: Add x-dirty-bitmap to query bitmap from server 2018-07-02 15:27:38 -05:00
nvme.h block: Move NVMe constants to a separate header 2018-02-08 09:22:03 +08:00
qapi.h Drop superfluous includes of qapi-types.h and test-qapi-types.h 2018-02-09 05:05:11 +01:00
qdict.h block: Factor out qobject_input_visitor_new_flat_confused() 2018-06-15 14:49:44 +02:00
raw-aio.h file-posix: Make .bdrv_co_truncate asynchronous 2018-06-29 14:20:56 +02:00
snapshot.h Move include qemu/option.h from qemu-common.h to actual users 2018-02-09 13:52:16 +01:00
thread-pool.h
throttle-groups.h block: add throttle block filter driver 2017-09-06 10:12:02 +02:00
write-threshold.h