Am 08.08.2016 um 17:05 hat Vladimir Sementsov-Ogievskiy geschrieben:
> The funcion loads dirty bitmap from file, using underlying driver
> function.
>
> Signed-off-by: Vladimir Sementsov-Ogievskiy <[email protected]>
> ---
> block/dirty-bitmap.c | 16 ++++++++++++++++
> include/block/dirty-bitmap.h | 2 ++
> 2 files changed, 18 insertions(+)
>
> diff --git a/block/dirty-bitmap.c b/block/dirty-bitmap.c
> index 6df7fe1..1d0ea25 100644
> --- a/block/dirty-bitmap.c
> +++ b/block/dirty-bitmap.c
> @@ -597,3 +597,19 @@ void
> bdrv_finalize_persistent_dirty_bitmaps(BlockDriverState *bs)
> }
> }
> }
> +
> +BdrvDirtyBitmap *bdrv_load_dirty_bitmap(BlockDriverState *bs, const char
> *name,
> + Error **errp)
> +{
> + BlockDriver *drv = bs->drv;
> + if (!drv) {
> + return NULL;
> + }
> + if (drv->bdrv_dirty_bitmap_load) {
> + return drv->bdrv_dirty_bitmap_load(bs, name, errp);
Why the inconsistency between load_dirty and dirty_load? The bdrv_*
wrappers usually have exactly the same name as the BlockDriver fields.
> + }
> + if (bs->file) {
> + return bdrv_load_dirty_bitmap(bs, name, errp);
> + }
> + return NULL;
> +}
Let me ask a general question about this series: What is the expected
state after it is applied?
I'm asking because even after the full series is applied, I don't see a
single user of bdrv_load_dirty_bitmap(), bdrv_load_check_dirty_bitmap()
or bdrv_store_dirty_bitmap(). Is all of this dead code?
Kevin