From: Peter Krempa Date: Tue, 19 Oct 2021 12:32:09 +0000 (+0200) Subject: qemuDomainBlocksStatsGather: Always fetch stats for the full backing chain X-Git-Tag: v7.9.0-rc1~74 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=579e05536b814052f2b9a962e3045d45cbe45f8f;p=thirdparty%2Flibvirt.git qemuDomainBlocksStatsGather: Always fetch stats for the full backing chain 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 Reviewed-by: Michal Privoznik --- diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index b9cc8f8379..34da87e330 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -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)