From 21986f5047ba0e4d11268e2fcd9756ddabc78705 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Fri, 29 Nov 2019 09:11:15 +0100 Subject: [PATCH] qemu: Fix indexes in statistics of iothreads MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Ján Tomko --- 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 18bd0101e7..b5300241a8 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -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; } } -- GitLab