aboutsummaryrefslogtreecommitdiff
path: root/block/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/io.c')
-rw-r--r--block/io.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/block/io.c b/block/io.c
index 86f76d0..b616bc4 100644
--- a/block/io.c
+++ b/block/io.c
@@ -2355,9 +2355,13 @@ bdrv_co_common_block_status_above(BlockDriverState *bs,
BlockDriverState *p;
int64_t eof = 0;
- assert(include_base || bs != base);
assert(!include_base || base); /* Can't include NULL base */
+ if (!include_base && bs == base) {
+ *pnum = bytes;
+ return 0;
+ }
+
ret = bdrv_co_block_status(bs, want_zero, offset, bytes, pnum, map, file);
if (ret < 0 || *pnum == 0 || ret & BDRV_BLOCK_ALLOCATED || bs == base) {
return ret;