qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 10/18] block/dirty-bitmap: add bdrv_dirty_bit


From: Max Reitz
Subject: Re: [Qemu-devel] [PATCH v2 10/18] block/dirty-bitmap: add bdrv_dirty_bitmap_get
Date: Thu, 4 Jul 2019 19:01:42 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0

On 03.07.19 23:55, John Snow wrote:
> Add a public interface for get. While we're at it,
> rename "bdrv_get_dirty_bitmap_locked" to "bdrv_dirty_bitmap_get_locked".
> 
> (There are more functions to rename to the bdrv_dirty_bitmap_VERB form,
> but they will wait until the conclusion of this series.)
> 
> Signed-off-by: John Snow <address@hidden>
> ---
>  block/dirty-bitmap.c         | 18 +++++++++++-------
>  block/mirror.c               |  2 +-
>  include/block/dirty-bitmap.h |  4 ++--
>  migration/block.c            |  5 ++---
>  nbd/server.c                 |  2 +-
>  5 files changed, 17 insertions(+), 14 deletions(-)
> 
> diff --git a/block/dirty-bitmap.c b/block/dirty-bitmap.c
> index b0f76826b3..97541521ab 100644
> --- a/block/dirty-bitmap.c
> +++ b/block/dirty-bitmap.c
> @@ -509,14 +509,18 @@ BlockDirtyInfoList 
> *bdrv_query_dirty_bitmaps(BlockDriverState *bs)
>  }
>  
>  /* Called within bdrv_dirty_bitmap_lock..unlock */
> -bool bdrv_get_dirty_locked(BlockDriverState *bs, BdrvDirtyBitmap *bitmap,
> -                           int64_t offset)
> +bool bdrv_dirty_bitmap_get_locked(BdrvDirtyBitmap *bitmap, int64_t offset)
>  {
> -    if (bitmap) {
> -        return hbitmap_get(bitmap->bitmap, offset);
> -    } else {
> -        return false;
> -    }
> +    return hbitmap_get(bitmap->bitmap, offset);
> +}
> +
> +bool bdrv_dirty_bitmap_get(BdrvDirtyBitmap *bitmap, int64_t offset) {

I’m sure Patchew has told this already, but this is not Rust yet.

With that fixed:

Reviewed-by: Max Reitz <address@hidden>

> +    bool ret;
> +    bdrv_dirty_bitmap_lock(bitmap);
> +    ret = bdrv_dirty_bitmap_get_locked(bitmap, offset);
> +    bdrv_dirty_bitmap_unlock(bitmap);
> +
> +    return ret;
>  }
>  
>  /**

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]