aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--block/io.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/block/io.c b/block/io.c
index 707c04ba48..23729942bc 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)) {