]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemuDomainBlocksStatsGather: Always fetch stats for the full backing chain
authorPeter Krempa <pkrempa@redhat.com>
Tue, 19 Oct 2021 12:32:09 +0000 (14:32 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 20 Oct 2021 11:43:37 +0000 (13:43 +0200)
In certain cases such as when running a backup blockjob qemu installs a
filter node between the frontend and the top node of the backend of the
disk. The stats gathering code didn't instruct the monitor code to fetch
the stats for all the layers, so since the top layer now doesn't have
stats we were reporting wrong stats such as allocation.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2015281
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_driver.c

index b9cc8f8379c7f0547f609512b9579474d4895480..34da87e330874f641a048cf84c5501f5b477135e 100644 (file)
@@ -10051,13 +10051,13 @@ qemuDomainBlocksStatsGather(virQEMUDriver *driver,
     }
 
     qemuDomainObjEnterMonitor(driver, vm);
-    nstats = qemuMonitorGetAllBlockStatsInfo(priv->mon, &blockstats, false);
+    nstats = qemuMonitorGetAllBlockStatsInfo(priv->mon, &blockstats, true);
 
     if (capacity && nstats >= 0) {
         if (blockdev)
             rc = qemuMonitorBlockStatsUpdateCapacityBlockdev(priv->mon, blockstats);
         else
-            rc = qemuMonitorBlockStatsUpdateCapacity(priv->mon, blockstats, false);
+            rc = qemuMonitorBlockStatsUpdateCapacity(priv->mon, blockstats, true);
     }
 
     if (qemuDomainObjExitMonitor(driver, vm) < 0 || nstats < 0 || rc < 0)