qemu-block
[Top][All Lists]
Advanced

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

Re: [Qemu-block] [Qemu-devel] [PATCH] qapi: add dirty-bitmaps to query-n


From: John Snow
Subject: Re: [Qemu-block] [Qemu-devel] [PATCH] qapi: add dirty-bitmaps to query-named-block-nodes result
Date: Thu, 30 May 2019 12:26:26 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1


On 5/30/19 10:39 AM, Vladimir Sementsov-Ogievskiy wrote:
> Let's add a possibility to query dirty-bitmaps not only on root nodes.
> It is useful when dealing both with snapshots and incremental backups.
> 
> Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
> ---
>  qapi/block-core.json | 5 ++++-
>  block/qapi.c         | 5 +++++
>  2 files changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/qapi/block-core.json b/qapi/block-core.json
> index 1defcde048..64ae1ab812 100644
> --- a/qapi/block-core.json
> +++ b/qapi/block-core.json
> @@ -360,6 +360,9 @@
>  # @write_threshold: configured write threshold for the device.
>  #                   0 if disabled. (Since 2.3)
>  #
> +# @dirty-bitmaps: dirty bitmaps information (only present if node
> +#                 has one or more dirty bitmaps) (Since 4.1)
> +#
>  # Since: 0.14.0
>  #
>  ##
> @@ -378,7 +381,7 @@
>              '*bps_wr_max_length': 'int', '*iops_max_length': 'int',
>              '*iops_rd_max_length': 'int', '*iops_wr_max_length': 'int',
>              '*iops_size': 'int', '*group': 'str', 'cache': 
> 'BlockdevCacheInfo',
> -            'write_threshold': 'int' } }
> +            'write_threshold': 'int', '*dirty-bitmaps': ['BlockDirtyInfo'] } 
> }
>  
>  ##
>  # @BlockDeviceIoStatus:
> diff --git a/block/qapi.c b/block/qapi.c
> index 0c13c86f4e..7eefdecb29 100644
> --- a/block/qapi.c
> +++ b/block/qapi.c
> @@ -78,6 +78,11 @@ BlockDeviceInfo *bdrv_block_device_info(BlockBackend *blk,
>          info->backing_file = g_strdup(bs->backing_file);
>      }
>  
> +    if (!QLIST_EMPTY(&bs->dirty_bitmaps)) {
> +        info->has_dirty_bitmaps = true;
> +        info->dirty_bitmaps = bdrv_query_dirty_bitmaps(bs);
> +    }
> +
>      info->detect_zeroes = bs->detect_zeroes;
>  
>      if (blk && blk_get_public(blk)->throttle_group_member.throttle_state) {
> 

So query-block uses bdrv_query_info, which calls bdrv_block_device_info,
so we'll duplicate the bitmap output when doing the old-fashioned block
query, but that's probably harmless overall.

We can continue to support the output in both places, or we could opt to
deprecate the older interface; I think this is one of the last chances
we'd get to do so before libvirt and wider adoption.

I think that's probably Eric's choice.

Reviewed-by: John Snow <address@hidden>



reply via email to

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