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 <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2018-08-03 14:19:46 +02:00
parent e004f1c609
commit 419c7e12c7

View File

@ -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,