aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--blockdev.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/blockdev.c b/blockdev.c
index 0d3773bcb8..c63f4e82c7 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -2923,10 +2923,9 @@ void qmp_block_resize(bool has_device, const char *device,
goto out;
}
- /* complete all in-flight operations before resizing the device */
- bdrv_drain_all();
-
+ bdrv_drained_begin(bs);
ret = blk_truncate(blk, size, errp);
+ bdrv_drained_end(bs);
out:
blk_unref(blk);