From: Peter Krempa Date: Fri, 3 Aug 2018 12:19:46 +0000 (+0200) Subject: qemu: Report frontend stats only for the frontend entry X-Git-Tag: v4.7.0-rc1~61 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=419c7e12c7c79752c9466b31c1fd0bb0b03e159a;p=thirdparty%2Flibvirt.git qemu: Report frontend stats only for the frontend entry When reporting stats for the backing chain some of them make sense only for the topmost entry as they are actually tied to the frontend device. We unfortunately can't change that fact, but we can stop reporting all zero stats for the backing chain members where they don't make any sense. Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko --- diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 53c2fc5ddf..8fbc4dd75e 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -20206,9 +20206,12 @@ qemuDomainGetStatsBlockExportDisk(virDomainDiskDefPtr disk, records, nrecords) < 0) goto cleanup; - if (qemuDomainGetStatsBlockExportFrontend(alias, stats, *recordnr, - records, nrecords) < 0) - goto cleanup; + /* The following stats make sense only for the frontend device */ + if (n == disk->src) { + if (qemuDomainGetStatsBlockExportFrontend(alias, stats, *recordnr, + records, nrecords) < 0) + goto cleanup; + } if (qemuDomainGetStatsOneBlock(driver, cfg, dom, records, nrecords, alias, n, *recordnr,