diff options
-rw-r--r-- | blockdev.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/blockdev.c b/blockdev.c index 63e6f1eafa..4ea2725fce 100644 --- a/blockdev.c +++ b/blockdev.c @@ -1043,6 +1043,9 @@ void qmp_block_resize(const char *device, int64_t size, Error **errp) return; } + /* complete all in-flight operations before resizing the device */ + bdrv_drain_all(); + switch (bdrv_truncate(bs, size)) { case 0: break; |