aboutsummaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorFam Zheng <famz@redhat.com>2014-01-23 10:03:26 +0800
committerKevin Wolf <kwolf@redhat.com>2014-01-24 14:33:01 +0100
commitc8059b97e1f9b4635b836ee98373a0f72f9fc0b4 (patch)
treeb0b94819f101a3c1a42d36aa0d48977bf7bad844 /block
parentd8a7b061ae01e5692cc994f05ad6480d8c170125 (diff)
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. Signed-off-by: Fam Zheng <famz@redhat.com> Reviewed-by: Benoit Canet <benoit@irqsave.net> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block')
-rw-r--r--block/qapi.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/block/qapi.c b/block/qapi.c
index a32cb79db8..98b1b83bd6 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;
}