[PATCH 2/3] ch: Use int for @niothreads in virCHMonitorGetIOThreads()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 src/ch/ch_monitor.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/ch/ch_monitor.c b/src/ch/ch_monitor.c
index 4f32b1ee4c..200ad6c77b 100644
--- a/src/ch/ch_monitor.c
+++ b/src/ch/ch_monitor.c
@@ -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;
 
-- 
2.41.0




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux