qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 24/25] qmp: block-dirty-bitmap-remove: remove pe


From: Max Reitz
Subject: Re: [Qemu-devel] [PATCH 24/25] qmp: block-dirty-bitmap-remove: remove persistent
Date: Mon, 29 May 2017 19:38:36 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0

On 2017-05-03 14:25, Vladimir Sementsov-Ogievskiy wrote:
> Remove persistent bitmap from the storage on block-dirty-bitmap-remove.
> 
> Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
> Reviewed-by: Max Reitz <address@hidden>
> Reviewed-by: John Snow <address@hidden>
> ---
>  blockdev.c           | 10 ++++++++++
>  qapi/block-core.json |  3 ++-
>  2 files changed, 12 insertions(+), 1 deletion(-)
> 
> diff --git a/blockdev.c b/blockdev.c
> index c49d414891..0ad1a658b9 100644
> --- a/blockdev.c
> +++ b/blockdev.c
> @@ -2802,6 +2802,7 @@ void qmp_block_dirty_bitmap_remove(const char *node, 
> const char *name,
>      AioContext *aio_context;
>      BlockDriverState *bs;
>      BdrvDirtyBitmap *bitmap;
> +    Error *local_err = NULL;
>  
>      bitmap = block_dirty_bitmap_lookup(node, name, &bs, &aio_context, errp);
>      if (!bitmap || !bs) {
> @@ -2814,6 +2815,15 @@ void qmp_block_dirty_bitmap_remove(const char *node, 
> const char *name,
>                     name);
>          goto out;
>      }
> +
> +    if (bdrv_dirty_bitmap_get_persistance(bitmap)) {
> +        bdrv_remove_persistent_dirty_bitmap(bs, name, &local_err);
> +        if (local_err != NULL) {
> +            error_propagate(errp, local_err);
> +            goto out;
> +        }
> +    }
> +
>      bdrv_dirty_bitmap_make_anon(bitmap);
>      bdrv_release_dirty_bitmap(bs, bitmap);
>  
> diff --git a/qapi/block-core.json b/qapi/block-core.json
> index e9523b4b8c..933b1a5fe5 100644
> --- a/qapi/block-core.json
> +++ b/qapi/block-core.json
> @@ -1600,7 +1600,8 @@
>  # @block-dirty-bitmap-remove:
>  #
>  # Stop write tracking and remove the dirty bitmap that was created
> -# with block-dirty-bitmap-add.
> +# with block-dirty-bitmap-add. If bitmap is persistent, remove it from it's

s/If bitmap/If the bitmap/, s/it's/its/

Max

> +# storage too.
>  #
>  # Returns: nothing on success
>  #          If @node is not a valid block device or node, DeviceNotFound
> 


Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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