In order to reuse bdrv_common_block_status_above in
bdrv_is_allocated_above, let's support include_base parameter.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
---
block/coroutines.h | 2 ++
block/io.c | 21 ++++++++++++++-------
2 files changed, 16 insertions(+), 7 deletions(-)
+++ b/block/io.c
@@ -2343,6 +2343,7 @@ early_out:
int coroutine_fn
bdrv_co_common_block_status_above(BlockDriverState *bs,
BlockDriverState *base,
+ bool include_base,
bool want_zero,
int64_t offset,
int64_t bytes,
@@ -2354,10 +2355,11 @@ bdrv_co_common_block_status_above(BlockDriverState *bs,
BlockDriverState *p;
int64_t eof = 0;
- assert(bs != base);
+ assert(include_base || bs != base);
+ assert(!include_base || base); /* Can't include NULL base */