|
|
9ae3a8 |
From ec69926313e8edae11091849f536b1f16da53ab7 Mon Sep 17 00:00:00 2001
|
|
|
9ae3a8 |
From: Fam Zheng <famz@redhat.com>
|
|
|
9ae3a8 |
Date: Mon, 27 Jan 2014 07:46:43 +0100
|
|
|
9ae3a8 |
Subject: [PATCH 19/22] qapi: Add "backing" to BlockStats
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
RH-Author: Fam Zheng <famz@redhat.com>
|
|
|
9ae3a8 |
Message-id: <1390808803-6464-1-git-send-email-famz@redhat.com>
|
|
|
9ae3a8 |
Patchwork-id: 56952
|
|
|
9ae3a8 |
O-Subject: [RHEL-7 qemu-kvm PATCH] qapi: Add "backing" to BlockStats
|
|
|
9ae3a8 |
Bugzilla: 1041564
|
|
|
9ae3a8 |
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1041564
|
|
|
9ae3a8 |
Brew: https://brewweb.devel.redhat.com/taskinfo?taskID=6949016
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Currently there is no way to query BlockStats of the backing chain. This
|
|
|
9ae3a8 |
adds "backing" field into BlockStats to make it possible.
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
The comment of "parent" is reworded.
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Fam Zheng <famz@redhat.com>
|
|
|
9ae3a8 |
Reviewed-by: Benoit Canet <benoit@irqsave.net>
|
|
|
9ae3a8 |
Reviewed-by: Eric Blake <eblake@redhat.com>
|
|
|
9ae3a8 |
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
|
|
|
9ae3a8 |
(cherry picked from commit c8059b97e1f9b4635b836ee98373a0f72f9fc0b4)
|
|
|
9ae3a8 |
Signed-off-by: Fam Zheng <famz@redhat.com>
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
block/qapi.c | 5 +++++
|
|
|
9ae3a8 |
qapi-schema.json | 10 ++++++----
|
|
|
9ae3a8 |
2 files changed, 11 insertions(+), 4 deletions(-)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
block/qapi.c | 5 +++++
|
|
|
9ae3a8 |
qapi-schema.json | 10 ++++++----
|
|
|
9ae3a8 |
2 files changed, 11 insertions(+), 4 deletions(-)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
diff --git a/block/qapi.c b/block/qapi.c
|
|
|
9ae3a8 |
index 87423fb..77e1719 100644
|
|
|
9ae3a8 |
--- a/block/qapi.c
|
|
|
9ae3a8 |
+++ b/block/qapi.c
|
|
|
9ae3a8 |
@@ -295,6 +295,11 @@ BlockStats *bdrv_query_stats(const BlockDriverState *bs)
|
|
|
9ae3a8 |
s->parent = bdrv_query_stats(bs->file);
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
+ if (bs->backing_hd) {
|
|
|
9ae3a8 |
+ s->has_backing = true;
|
|
|
9ae3a8 |
+ s->backing = bdrv_query_stats(bs->backing_hd);
|
|
|
9ae3a8 |
+ }
|
|
|
9ae3a8 |
+
|
|
|
9ae3a8 |
return s;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
diff --git a/qapi-schema.json b/qapi-schema.json
|
|
|
9ae3a8 |
index 6158ea5..8b257e2 100644
|
|
|
9ae3a8 |
--- a/qapi-schema.json
|
|
|
9ae3a8 |
+++ b/qapi-schema.json
|
|
|
9ae3a8 |
@@ -1007,15 +1007,17 @@
|
|
|
9ae3a8 |
#
|
|
|
9ae3a8 |
# @stats: A @BlockDeviceStats for the device.
|
|
|
9ae3a8 |
#
|
|
|
9ae3a8 |
-# @parent: #optional This may point to the backing block device if this is a
|
|
|
9ae3a8 |
-# a virtual block device. If it's a backing block, this will point
|
|
|
9ae3a8 |
-# to the backing file is one is present.
|
|
|
9ae3a8 |
+# @parent: #optional This describes the file block device if it has one.
|
|
|
9ae3a8 |
+#
|
|
|
9ae3a8 |
+# @backing: #optional This describes the backing block device if it has one.
|
|
|
9ae3a8 |
+# (Since 2.0)
|
|
|
9ae3a8 |
#
|
|
|
9ae3a8 |
# Since: 0.14.0
|
|
|
9ae3a8 |
##
|
|
|
9ae3a8 |
{ 'type': 'BlockStats',
|
|
|
9ae3a8 |
'data': {'*device': 'str', 'stats': 'BlockDeviceStats',
|
|
|
9ae3a8 |
- '*parent': 'BlockStats'} }
|
|
|
9ae3a8 |
+ '*parent': 'BlockStats',
|
|
|
9ae3a8 |
+ '*backing': 'BlockStats'} }
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
##
|
|
|
9ae3a8 |
# @query-blockstats:
|
|
|
9ae3a8 |
--
|
|
|
9ae3a8 |
1.7.1
|
|
|
9ae3a8 |
|