diff options
author | Kevin Wolf | 2018-03-23 15:57:20 +0100 |
---|---|---|
committer | Kevin Wolf | 2018-06-18 15:03:25 +0200 |
commit | dcf94a23b1add0f856db51e9ff5ba0774e096076 (patch) | |
tree | 658311bddefe5487845018e8230a03c4d5d6435b /include/block/block.h | |
parent | test-bdrv-drain: Test node deletion in subtree recursion (diff) | |
download | qemu-dcf94a23b1add0f856db51e9ff5ba0774e096076.tar.gz qemu-dcf94a23b1add0f856db51e9ff5ba0774e096076.tar.xz qemu-dcf94a23b1add0f856db51e9ff5ba0774e096076.zip |
block: Don't poll in parent drain callbacks
bdrv_do_drained_begin() is only safe if we have a single
BDRV_POLL_WHILE() after quiescing all affected nodes. We cannot allow
that parent callbacks introduce a nested polling loop that could cause
graph changes while we're traversing the graph.
Split off bdrv_do_drained_begin_quiesce(), which only quiesces a single
node without waiting for its requests to complete. These requests will
be waited for in the BDRV_POLL_WHILE() call down the call chain.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'include/block/block.h')
-rw-r--r-- | include/block/block.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/block/block.h b/include/block/block.h index 254ed2e4c9..067d24cc4a 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -591,6 +591,15 @@ bool bdrv_drain_poll(BlockDriverState *bs, bool recursive, void bdrv_drained_begin(BlockDriverState *bs); /** + * bdrv_do_drained_begin_quiesce: + * + * Quiesces a BDS like bdrv_drained_begin(), but does not wait for already + * running requests to complete. + */ +void bdrv_do_drained_begin_quiesce(BlockDriverState *bs, + BdrvChild *parent); + +/** * Like bdrv_drained_begin, but recursively begins a quiesced section for * exclusive access to all child nodes as well. */ |