]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Fix indexes in statistics of iothreads
authorPeter Krempa <pkrempa@redhat.com>
Fri, 29 Nov 2019 08:11:15 +0000 (09:11 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 29 Nov 2019 13:51:47 +0000 (14:51 +0100)
In commit 2ccb5335dc4 I've refactored how we fill the typed parameters
for domain statistics. The commit introduced a regression in the
formating of stats for IOthreads by using the array index to label the
entries as it's common for all other types of statistics rather than
the iothread IDs used for iothreads.

Since only the design of iothread deviates from the common approach used
in all other statistic types this was not caught.

https://bugzilla.redhat.com/show_bug.cgi?id=1778014

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_driver.c

index 18bd0101e7dedb0bc1d7bc0addf400df419a4144..b5300241a8e6317346a98c091f56760ecf2e73b5 100644 (file)
@@ -21208,13 +21208,16 @@ qemuDomainGetStatsIOThread(virQEMUDriverPtr driver,
     for (i = 0; i < niothreads; i++) {
         if (iothreads[i]->poll_valid) {
             if (virTypedParamListAddULLong(params, iothreads[i]->poll_max_ns,
-                                           "iothread.%zu.poll-max-ns", i) < 0)
+                                           "iothread.%u.poll-max-ns",
+                                           iothreads[i]->iothread_id) < 0)
                 goto cleanup;
             if (virTypedParamListAddUInt(params, iothreads[i]->poll_grow,
-                                         "iothread.%zu.poll-grow", i) < 0)
+                                         "iothread.%u.poll-grow",
+                                         iothreads[i]->iothread_id) < 0)
                 goto cleanup;
             if (virTypedParamListAddUInt(params, iothreads[i]->poll_shrink,
-                                         "iothread.%zu.poll-shrink", i) < 0)
+                                         "iothread.%u.poll-shrink",
+                                         iothreads[i]->iothread_id) < 0)
                 goto cleanup;
         }
     }