[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 17/22] block: complete all IOs before .bdrv_truncate
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 17/22] block: complete all IOs before .bdrv_truncate |
Date: |
Fri, 22 Feb 2013 22:23:46 +0100 |
From: Peter Lieven <address@hidden>
bdrv_truncate() invalidates the bdrv_check_request() result for
in-flight requests, so there should better be none.
Cc: address@hidden
Signed-off-by: Peter Lieven <address@hidden>
Reported-by: Kevin Wolf <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/block.c b/block.c
index a4d7125..f184b37 100644
--- a/block.c
+++ b/block.c
@@ -2427,6 +2427,10 @@ int bdrv_truncate(BlockDriverState *bs, int64_t offset)
return -EACCES;
if (bdrv_in_use(bs))
return -EBUSY;
+
+ /* There better not be any in-flight IOs when we truncate the device. */
+ bdrv_drain_all();
+
ret = drv->bdrv_truncate(bs, offset);
if (ret == 0) {
ret = refresh_total_sectors(bs, offset >> BDRV_SECTOR_BITS);
--
1.8.1.2
- [Qemu-devel] [PATCH 07/22] qcow2: support compressed clusters in BlockFragInfo, (continued)
- [Qemu-devel] [PATCH 07/22] qcow2: support compressed clusters in BlockFragInfo, Kevin Wolf, 2013/02/22
- [Qemu-devel] [PATCH 09/22] block: refuse negative iops and bps values, Kevin Wolf, 2013/02/22
- [Qemu-devel] [PATCH 08/22] block: use Error in do_check_io_limits(), Kevin Wolf, 2013/02/22
- [Qemu-devel] [PATCH 06/22] qemu-img: add compressed clusters to BlockFragInfo, Kevin Wolf, 2013/02/22
- [Qemu-devel] [PATCH 05/22] qemu-img: fix missing space in qemu-img check output, Kevin Wolf, 2013/02/22
- [Qemu-devel] [PATCH 12/22] qemu-img: Add compare subcommand, Kevin Wolf, 2013/02/22
- [Qemu-devel] [PATCH 11/22] qemu-img: Add "Quiet mode" option, Kevin Wolf, 2013/02/22
- [Qemu-devel] [PATCH 15/22] coroutine: move pooling to common code, Kevin Wolf, 2013/02/22
- [Qemu-devel] [PATCH 13/22] qemu-iotests: Add qemu-img compare test, Kevin Wolf, 2013/02/22
- [Qemu-devel] [PATCH 16/22] coroutine: trim down nesting level in perf_nesting test, Kevin Wolf, 2013/02/22
- [Qemu-devel] [PATCH 17/22] block: complete all IOs before .bdrv_truncate,
Kevin Wolf <=
- [Qemu-devel] [PATCH 19/22] blockdev: add discard suboption to -drive, Kevin Wolf, 2013/02/22
- [Qemu-devel] [PATCH 18/22] block: implement BDRV_O_UNMAP, Kevin Wolf, 2013/02/22
- [Qemu-devel] [PATCH 21/22] blockdev: enable discard by default, Kevin Wolf, 2013/02/22
- [Qemu-devel] [PATCH 14/22] qemu-iotests: Test qcow2 image creation options, Kevin Wolf, 2013/02/22
- [Qemu-devel] [PATCH 20/22] qemu-nbd: add --discard option, Kevin Wolf, 2013/02/22
- [Qemu-devel] [PATCH 22/22] pc: add compatibility machine types for 1.4, Kevin Wolf, 2013/02/22