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 <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Peter Krempa 2021-10-19 14:32:09 +02:00
parent c66115b6e8
commit 579e05536b
1 changed files with 2 additions and 2 deletions

View 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)