On Tue, Mar 10, 2015 at 05:26:36PM +0100, Peter Krempa wrote:
Our virDomainBlockStatsFlags API uses the old approach where, when
it's
called without the typed parameter array, returs the count of parameters
s/returs/returns/
supported by qemu.
The supported parameter count is obtained via separate monitor calls
which is a waste since we can calculate it when gathering the data.
This patch adds code to the qemuMonitorGetAllBlockStatsInfo workers that
allows to track the count of supported fields reported by qemu and will
allow to remove the old duplicate code.
---
src/qemu/qemu_monitor.c | 26 +++++++++++++++++++-------
src/qemu/qemu_monitor_json.c | 15 +++++++++++----
src/qemu/qemu_monitor_text.c | 10 +++++++++-
3 files changed, 39 insertions(+), 12 deletions(-)
diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index 149e743..e4ff06e 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -1848,14 +1848,24 @@ int qemuMonitorGetBlockStatsInfo(qemuMonitorPtr mon,
}
-/* Creates a hash table in 'ret_stats' with all block stats.
- * Returns <0 on error, 0 on success.
+/**
+ * qemuMonitorGetAllBlockStatsInfo:
+ * @mon: monitor object
+ * @ret_stats: pointer that is filled with a hash table containing the stats
+ * @backingChain: recurse into the bakcing chain of devices
s/bakcing/backing/
Jan