All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2] qapi: Add "backing" to BlockStats
@ 2014-01-23  2:03 Fam Zheng
  2014-01-23  2:08 ` Eric Blake
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Fam Zheng @ 2014-01-23  2:03 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, stefanha

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 <famz@redhat.com>

---
v2: Only add "backing", drop "file".

Signed-off-by: Fam Zheng <famz@redhat.com>
---
 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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH v2] qapi: Add "backing" to BlockStats
  2014-01-23  2:03 [Qemu-devel] [PATCH v2] qapi: Add "backing" to BlockStats Fam Zheng
@ 2014-01-23  2:08 ` Eric Blake
  2014-01-23 17:23 ` Benoît Canet
  2014-01-24 11:20 ` Kevin Wolf
  2 siblings, 0 replies; 4+ messages in thread
From: Eric Blake @ 2014-01-23  2:08 UTC (permalink / raw)
  To: Fam Zheng, qemu-devel; +Cc: kwolf, stefanha

[-- Attachment #1: Type: text/plain, Size: 662 bytes --]

On 01/22/2014 07:03 PM, Fam Zheng wrote:
> 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 <famz@redhat.com>
> 
> ---
> v2: Only add "backing", drop "file".
> 
> Signed-off-by: Fam Zheng <famz@redhat.com>
> ---
>  block/qapi.c     |  5 +++++
>  qapi-schema.json | 10 ++++++----
>  2 files changed, 11 insertions(+), 4 deletions(-)

Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH v2] qapi: Add "backing" to BlockStats
  2014-01-23  2:03 [Qemu-devel] [PATCH v2] qapi: Add "backing" to BlockStats Fam Zheng
  2014-01-23  2:08 ` Eric Blake
@ 2014-01-23 17:23 ` Benoît Canet
  2014-01-24 11:20 ` Kevin Wolf
  2 siblings, 0 replies; 4+ messages in thread
From: Benoît Canet @ 2014-01-23 17:23 UTC (permalink / raw)
  To: Fam Zheng; +Cc: kwolf, qemu-devel, stefanha

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 <famz@redhat.com>
> 
> ---
> v2: Only add "backing", drop "file".
> 
> Signed-off-by: Fam Zheng <famz@redhat.com>
> ---
>  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 <benoit@irqsave.net>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH v2] qapi: Add "backing" to BlockStats
  2014-01-23  2:03 [Qemu-devel] [PATCH v2] qapi: Add "backing" to BlockStats Fam Zheng
  2014-01-23  2:08 ` Eric Blake
  2014-01-23 17:23 ` Benoît Canet
@ 2014-01-24 11:20 ` Kevin Wolf
  2 siblings, 0 replies; 4+ messages in thread
From: Kevin Wolf @ 2014-01-24 11:20 UTC (permalink / raw)
  To: Fam Zheng; +Cc: qemu-devel, stefanha

Am 23.01.2014 um 03:03 hat Fam Zheng geschrieben:
> 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 <famz@redhat.com>

Thanks, applied to the block branch.

Kevin

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-01-24 11:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-23  2:03 [Qemu-devel] [PATCH v2] qapi: Add "backing" to BlockStats Fam Zheng
2014-01-23  2:08 ` Eric Blake
2014-01-23 17:23 ` Benoît Canet
2014-01-24 11:20 ` Kevin Wolf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.