'query-named-block-nodes' in non-flat mode returns redundantly nested
data under the 'backing-image' field. Fortunately we don't need it when
updating the capacity stats.
This function was unfortunately not fixed originally when the support
for flat mode was added. Use the flat cached in the monitor object to
force flat mode if available.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/qemu/qemu_monitor_json.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index 8a3421a6fc..0e34cb55ad 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -2503,7 +2503,7 @@ qemuMonitorJSONBlockStatsUpdateCapacityBlockdev(qemuMonitor *mon,
{
g_autoptr(virJSONValue) nodes = NULL;
- if (!(nodes = qemuMonitorJSONQueryNamedBlockNodes(mon, false)))
+ if (!(nodes = qemuMonitorJSONQueryNamedBlockNodes(mon,
mon->queryNamedBlockNodesFlat)))
return -1;
if (virJSONValueArrayForeachSteal(nodes,
--
2.37.3