On Mon, Aug 13, 2018 at 06:00:25PM +0200, Peter Krempa wrote:
In cases when -blockdev is used we need to use
'query-named-block-nodes'
instead of 'query-block'. This means that we can extract the
write-threshold variable right away.
To keep compatibility with old VMs modify the code which was extracting
the value previously so that it updates the stats structure and a single
code path then can be used to extract the data.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/qemu/qemu_driver.c | 57 ++++++++++++++++++++++++++------------------
src/qemu/qemu_monitor.h | 3 +++
src/qemu/qemu_monitor_json.c | 16 ++++++++++---
3 files changed, 50 insertions(+), 26 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 63ce68bd35..688746c36f 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -20029,29 +20029,39 @@ qemuDomainGetStatsOneBlockFallback(virQEMUDriverPtr driver,
}
-static int
-qemuDomainGetStatsOneBlockNode(virDomainStatsRecordPtr record,
- int *maxparams,
- virStorageSourcePtr src,
- size_t block_idx,
- virHashTablePtr nodedata)
+/**
+ * qemuDomainGetStatsOneBlockRefreshNamed:
+ * @src: disk source structure
+ * @alias: disk alias
+ * @stats: hash table containing stats for all disks
+ * @nodedata: reply containin 'query-named-block-nodes' data
containing
+ *
+ * Refresh disk block stats data (qemuBlockStatsPtr) which are present only
+ * in the reply of 'query-named-block-nodes' in cases when the data was gathered
+ * by using qem-block originally.
query-block
+ */
+static void
Reviewed-by: Ján Tomko <jtomko(a)redhat.com>
Jano