[libvirt] [PATCHv2 56/62] qemu: Report frontend stats only for the frontend entry

Peter Krempa posted 62 patches 7 years, 5 months ago
[libvirt] [PATCHv2 56/62] qemu: Report frontend stats only for the frontend entry
Posted by Peter Krempa 7 years, 5 months ago
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>
---
 src/qemu/qemu_driver.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index e8e8bdbb14..c09108b57e 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -20209,9 +20209,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,
-- 
2.16.2

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCHv2 56/62] qemu: Report frontend stats only for the frontend entry
Posted by Ján Tomko 7 years, 5 months ago
On Mon, Aug 13, 2018 at 06:00:30PM +0200, Peter Krempa wrote:
>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>
>---
> src/qemu/qemu_driver.c | 9 ++++++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list