[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 08/17] block: Assert no write requests under BDRV_O_I
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 08/17] block: Assert no write requests under BDRV_O_INCOMING |
Date: |
Wed, 20 Jan 2016 17:24:57 +0100 |
As long as BDRV_O_INCOMING is set, the image file is only opened so we
have a file descriptor for it. We're definitely not supposed to modify
the image, it's still owned by the migration source.
Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
---
block/io.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/block/io.c b/block/io.c
index 707c04b..2372994 100644
--- a/block/io.c
+++ b/block/io.c
@@ -1301,6 +1301,7 @@ static int coroutine_fn
bdrv_co_do_pwritev(BlockDriverState *bs,
if (bs->read_only) {
return -EPERM;
}
+ assert(!(bs->open_flags & BDRV_O_INCOMING));
ret = bdrv_check_byte_request(bs, offset, bytes);
if (ret < 0) {
@@ -2462,6 +2463,7 @@ int coroutine_fn bdrv_co_discard(BlockDriverState *bs,
int64_t sector_num,
} else if (bs->read_only) {
return -EPERM;
}
+ assert(!(bs->open_flags & BDRV_O_INCOMING));
/* Do nothing if disabled. */
if (!(bs->open_flags & BDRV_O_UNMAP)) {
--
1.8.3.1
- [Qemu-block] [PULL 00/17] Block patches, Kevin Wolf, 2016/01/20
- [Qemu-block] [PULL 02/17] block/raw-posix: avoid bogus fixup for cylinders on DASD disks, Kevin Wolf, 2016/01/20
- [Qemu-block] [PULL 03/17] qemu-img: Speed up comparing empty/zero images, Kevin Wolf, 2016/01/20
- [Qemu-block] [PULL 01/17] block: Fix .bdrv_open flags, Kevin Wolf, 2016/01/20
- [Qemu-block] [PULL 04/17] qemu-iotests: Reduce racy output in 028, Kevin Wolf, 2016/01/20
- [Qemu-block] [PULL 08/17] block: Assert no write requests under BDRV_O_INCOMING,
Kevin Wolf <=
- [Qemu-block] [PULL 07/17] qcow2: Write full header on image creation, Kevin Wolf, 2016/01/20
- [Qemu-block] [PULL 09/17] block: Fix error path in bdrv_invalidate_cache(), Kevin Wolf, 2016/01/20
- [Qemu-block] [PULL 06/17] qcow2: Write feature table only for v3 images, Kevin Wolf, 2016/01/20
- [Qemu-block] [PULL 10/17] block: Rename BDRV_O_INCOMING to BDRV_O_INACTIVE, Kevin Wolf, 2016/01/20
- [Qemu-block] [PULL 12/17] qcow2: Implement .bdrv_inactivate, Kevin Wolf, 2016/01/20
- [Qemu-block] [PULL 05/17] block: Clean up includes, Kevin Wolf, 2016/01/20
- [Qemu-block] [PULL 11/17] block: Inactivate BDS when migration completes, Kevin Wolf, 2016/01/20
- [Qemu-block] [PULL 13/17] qcow2: Fix BDRV_O_INACTIVE handling in qcow2_invalidate_cache(), Kevin Wolf, 2016/01/20
- [Qemu-block] [PULL 14/17] qcow2: Make image inaccessible after failed qcow2_invalidate_cache(), Kevin Wolf, 2016/01/20