]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
ch: Use int for @niothreads in virCHMonitorGetIOThreads()
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 5 Sep 2023 10:17:19 +0000 (12:17 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 5 Sep 2023 14:09:49 +0000 (16:09 +0200)
The @niothreads inside of virCHMonitorGetIOThreads() is declared
as of size_t type. This would work, except the variable is then
passed to VIR_DEBUG with incorrect format directive (%ld) and
returned.  But the function returns an int not size_t. Fix the
variable declaration and format directive.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/ch/ch_monitor.c

index 4f32b1ee4c1d7edb97ba6fe2653aa3911e19e0c1..200ad6c77b15e104bbd16f75f4caff428a33eb62 100644 (file)
@@ -937,7 +937,7 @@ virCHMonitorGetIOThreads(virCHMonitor *mon,
                          virDomainIOThreadInfo ***iothreads)
 {
     size_t nthreads = 0;
-    size_t niothreads = 0;
+    int niothreads = 0;
     int thd_index;
     virDomainIOThreadInfo **iothreadinfolist = NULL;
     virDomainIOThreadInfo *iothreadinfo = NULL;
@@ -969,7 +969,7 @@ virCHMonitorGetIOThreads(virCHMonitor *mon,
         }
     }
 
-    VIR_DEBUG("niothreads = %ld", niothreads);
+    VIR_DEBUG("niothreads = %d", niothreads);
     *iothreads = g_steal_pointer(&iothreadinfolist);
     return niothreads;