提交 92b7a08d 编写于 作者: P Peter Lieven 提交者: Kevin Wolf

block: complete all IOs before resizing a device

this patch ensures that all pending IOs are completed
before a device is resized. this is especially important
if a device is shrinked as it the bdrv_check_request()
result is invalidated.
Signed-off-by: NPeter Lieven <pl@kamp.de>
Signed-off-by: NKevin Wolf <kwolf@redhat.com>
上级 5c916681
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册