From 579e05536b814052f2b9a962e3045d45cbe45f8f Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Tue, 19 Oct 2021 14:32:09 +0200 Subject: [PATCH] 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 --- src/qemu/qemu_driver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) -- 2.47.2