On Fri 05 Apr 2019 06:56:17 PM CEST, Andrey Shinkevich wrote:
> +int bdrv_is_allocated_above(BlockDriverState *top,
> + BlockDriverState *base,
> + int64_t offset, int64_t bytes, int64_t *pnum)
> +{
> + return bdrv_do_is_allocated_above(top, base, false, offset, bytes, pnum);
> +}
> +
> +int bdrv_is_allocated_above_inclusive(BlockDriverState *top,
> + BlockDriverState *base,
> + int64_t offset, int64_t bytes,
> + int64_t *pnum)
> +{
> + return bdrv_do_is_allocated_above(top, base, true, offset, bytes, pnum);
> +}
Instead of having these two, isn't it simpler to add an 'include_base'
parameter to the original function?
Another alternative (I haven't checked this one so it could be more
cumbersome): change the semantics of the function to always include the
base and modify the callers.
Berto