]> Git Repo - qemu.git/commitdiff
qapi: Add "backing" to BlockStats
authorFam Zheng <[email protected]>
Thu, 23 Jan 2014 02:03:26 +0000 (10:03 +0800)
committerKevin Wolf <[email protected]>
Fri, 24 Jan 2014 13:33:01 +0000 (14:33 +0100)
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 <[email protected]>
Reviewed-by: Benoit Canet <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
block/qapi.c
qapi-schema.json

index a32cb79db8e020cfe16aceb2309b423ac5490168..98b1b83bd6a08e54b7249119e5bb9e1fde59ebc9 100644 (file)
@@ -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;
 }
 
index 35f7b34410fa6cc16400593d809763ceb6d0dc14..a433869962c641293f99ed2718915bd0a412e075 100644 (file)
 #
 # @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:
This page took 0.028242 seconds and 4 git commands to generate.