[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH v3 1/3] block: include base when checking image
From: |
Alberto Garcia |
Subject: |
Re: [Qemu-block] [PATCH v3 1/3] block: include base when checking image chain for block allocation |
Date: |
Mon, 08 Apr 2019 17:03:44 +0200 |
User-agent: |
Notmuch/0.18.2 (http://notmuchmail.org) Emacs/24.4.1 (i586-pc-linux-gnu) |
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