[PATCH 1/3] ch: Use uint for @maxvcpus in virCHDomainRefreshThreadInfo()

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

 



The @maxvcpus variable inside of virCHDomainRefreshThreadInfo()
holds retval of virDomainDefGetVcpusMax() which returns an
unsigned int. Also, the variable is then passed to VIR_WARN()
with incorrect format directive (%ld). Switch variable to uint
and fix the format directive.

Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
 src/ch/ch_domain.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/ch/ch_domain.c b/src/ch/ch_domain.c
index 35e3471cba..d6b64b6c59 100644
--- a/src/ch/ch_domain.c
+++ b/src/ch/ch_domain.c
@@ -225,7 +225,7 @@ chValidateDomainDeviceDef(const virDomainDeviceDef *dev,
 int
 virCHDomainRefreshThreadInfo(virDomainObj *vm)
 {
-    size_t maxvcpus = virDomainDefGetVcpusMax(vm->def);
+    unsigned int maxvcpus = virDomainDefGetVcpusMax(vm->def);
     virCHMonitorThreadInfo *info = NULL;
     size_t nthreads;
     size_t ncpus = 0;
@@ -252,7 +252,7 @@ virCHDomainRefreshThreadInfo(virDomainObj *vm)
 
     /* TODO: Remove the warning when hotplug is implemented.*/
     if (ncpus != maxvcpus)
-        VIR_WARN("Mismatch in the number of cpus, expected: %ld, actual: %ld",
+        VIR_WARN("Mismatch in the number of cpus, expected: %u, actual: %zu",
                  maxvcpus, ncpus);
 
     return 0;
-- 
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