diff --git a/blockdev.c b/blockdev.c index 09f76b782f83945571ee84ccecd90d4ca33863ca..6f2b7592ce2b1b8dd2ef9e7fcc5306ec95e6e814 100644 --- a/blockdev.c +++ b/blockdev.c @@ -1127,6 +1127,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;