qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2] qapi: Add "backing" to BlockStats


From: Benoît Canet
Subject: Re: [Qemu-devel] [PATCH v2] qapi: Add "backing" to BlockStats
Date: Thu, 23 Jan 2014 18:23:47 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

Le Thursday 23 Jan 2014 à 10:03:26 (+0800), Fam Zheng a écrit :
> Currently there is no way to query BlockStats of the backing chain. This
> adds "backing" field into BlockStats to make it possible.
> 
> The comment of "parent" is reworded.
> 
> Signed-off-by: Fam Zheng <address@hidden>
> 
> ---
> v2: Only add "backing", drop "file".
> 
> Signed-off-by: Fam Zheng <address@hidden>
> ---
>  block/qapi.c     |  5 +++++
>  qapi-schema.json | 10 ++++++----
>  2 files changed, 11 insertions(+), 4 deletions(-)
> 
> diff --git a/block/qapi.c b/block/qapi.c
> index a32cb79..98b1b83 100644
> --- a/block/qapi.c
> +++ b/block/qapi.c
> @@ -318,6 +318,11 @@ BlockStats *bdrv_query_stats(const BlockDriverState *bs)
>          s->parent = bdrv_query_stats(bs->file);
>      }
>  
> +    if (bs->backing_hd) {
> +        s->has_backing = true;
> +        s->backing = bdrv_query_stats(bs->backing_hd);
> +    }
> +
>      return s;
>  }
>  
> diff --git a/qapi-schema.json b/qapi-schema.json
> index f27c48a..0e534d0 100644
> --- a/qapi-schema.json
> +++ b/qapi-schema.json
> @@ -1022,15 +1022,17 @@
>  #
>  # @stats:  A @BlockDeviceStats for the device.
>  #
> -# @parent: #optional This may point to the backing block device if this is a
> -#          a virtual block device.  If it's a backing block, this will point
> -#          to the backing file is one is present.
> +# @parent: #optional This describes the file block device if it has one.
> +#
> +# @backing: #optional This describes the backing block device if it has one.
> +#           (Since 2.0)
>  #
>  # Since: 0.14.0
>  ##
>  { 'type': 'BlockStats',
>    'data': {'*device': 'str', 'stats': 'BlockDeviceStats',
> -           '*parent': 'BlockStats'} }
> +           '*parent': 'BlockStats',
> +           '*backing': 'BlockStats'} }
>  
>  ##
>  # @query-blockstats:
> -- 
> 1.8.5.3
> 
> 

Reviewed-by: Benoit Canet <address@hidden>



reply via email to

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