]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemuMonitorJSONBlockStatsUpdateCapacityBlockdev: Use 'flat' mode of query-named-block...
authorPeter Krempa <pkrempa@redhat.com>
Wed, 9 Nov 2022 10:06:25 +0000 (11:06 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 9 Nov 2022 13:08:31 +0000 (14:08 +0100)
'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@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_monitor_json.c

index 8a3421a6fc40c60fb90474cb70feb516dadae9b7..0e34cb55adf6cc79a94742d1d19c053feba86daa 100644 (file)
@@ -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,