aboutsummaryrefslogtreecommitdiff
path: root/block.c
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2018-03-23 12:40:41 +0100
committerKevin Wolf <kwolf@redhat.com>2018-06-18 15:03:25 +0200
commitfe4f0614ef9e361dae12012d3c400657444836cf (patch)
tree8a2fe7988f189a123c456e204bad9f1292f934de /block.c
parent4c8158e359d194394c64acd21caf5e3f3f3141c2 (diff)
block: Drain recursively with a single BDRV_POLL_WHILE()
Anything can happen inside BDRV_POLL_WHILE(), including graph changes that may interfere with its callers (e.g. child list iteration in recursive callers of bdrv_do_drained_begin). Switch to a single BDRV_POLL_WHILE() call for the whole subtree at the end of bdrv_do_drained_begin() to avoid such effects. The recursion happens now inside the loop condition. As the graph can only change between bdrv_drain_poll() calls, but not inside of it, doing the recursion here is safe. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block.c')
-rw-r--r--block.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block.c b/block.c
index 8cf9cd8855..80abd3c2ae 100644
--- a/block.c
+++ b/block.c
@@ -824,7 +824,7 @@ static void bdrv_child_cb_drained_begin(BdrvChild *child)
static bool bdrv_child_cb_drained_poll(BdrvChild *child)
{
BlockDriverState *bs = child->opaque;
- return bdrv_drain_poll(bs, NULL);
+ return bdrv_drain_poll(bs, false, NULL);
}
static void bdrv_child_cb_drained_end(BdrvChild *child)