[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 02/14] block: complete all IOs before resizing a dev
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 02/14] block: complete all IOs before resizing a device |
Date: |
Fri, 22 Mar 2013 18:41:11 +0100 |
From: Peter Lieven <address@hidden>
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: Peter Lieven <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
blockdev.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/blockdev.c b/blockdev.c
index 09f76b7..6f2b759 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;
--
1.8.1.4
- [Qemu-devel] [PULL 00/14] Block patches, Kevin Wolf, 2013/03/22
- [Qemu-devel] [PATCH 01/14] Revert "block: complete all IOs before .bdrv_truncate", Kevin Wolf, 2013/03/22
- [Qemu-devel] [PATCH 02/14] block: complete all IOs before resizing a device,
Kevin Wolf <=
- [Qemu-devel] [PATCH 04/14] block: Pass bdrv_file_open() options to block drivers, Kevin Wolf, 2013/03/22
- [Qemu-devel] [PATCH 07/14] nbd: Remove unused functions, Kevin Wolf, 2013/03/22
- [Qemu-devel] [PATCH 08/14] nbd: Accept -drive options for the network connection, Kevin Wolf, 2013/03/22
- [Qemu-devel] [PATCH 05/14] qemu-socket: Make socket_optslist public, Kevin Wolf, 2013/03/22
- [Qemu-devel] [PATCH 10/14] block: Rename variable to avoid shadowing, Kevin Wolf, 2013/03/22
- [Qemu-devel] [PATCH 11/14] block: Make find_image_format safe with NULL filename, Kevin Wolf, 2013/03/22
- [Qemu-devel] [PATCH 03/14] block: Add options QDict to bdrv_file_open() prototypes, Kevin Wolf, 2013/03/22
- [Qemu-devel] [PATCH 14/14] nbd: Check against invalid option combinations, Kevin Wolf, 2013/03/22