qapi: Add "backing" to BlockStats
PATCH v2 1/1 qapi: Add "backing" to BlockStats
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.
---
v2: Only add "backing", drop "file".
--- block/qapi.c | 5 +++++ qapi-schema.json | 10 ++++++---- 2 files changed, 11 insertions(+), 4 deletions(-)
block/qapi.c +5 -0
@@ -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; }
qapi-schema.json +6 -4
@@ -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:
Signature · 1 line
1.8.5.3
Quoted 7 lines · Fam Zheng
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]>
Quoted 8 lines
---
v2: Only add "backing", drop "file".Signed-off-by Fam Zheng <[email protected]>--- block/qapi.c | 5 +++++ qapi-schema.json | 10 ++++++---- 2 files changed, 11 insertions(+), 4 deletions(-)
Signature · 2 lines
Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
Quoted 62 lines · Fam Zheng
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]>---
v2: Only add "backing", drop "file".Signed-off-by Fam Zheng <[email protected]>--- block/qapi.c | 5 +++++ qapi-schema.json | 10 ++++++---- 2 files changed, 11 insertions(+), 4 deletions(-)block/qapi.c +5
-0@@ -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; }qapi-schema.json +6
-4@@ -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:Signature · 1 line
1.8.5.3
Kevin Wolf
AppliedAm 23.01.2014 um 03:03 hat Fam Zheng geschrieben:
Quoted 6 lines
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]>
Thanks, applied to the block branch.
Kevin