]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
ch: Use uint for @maxvcpus in virCHDomainRefreshThreadInfo()
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 5 Sep 2023 10:13:39 +0000 (12:13 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 5 Sep 2023 14:09:49 +0000 (16:09 +0200)
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@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/ch/ch_domain.c

index 35e3471cba6e714235a4eb0ecee18d11155ac784..d6b64b6c59b42e3f62d375e950a3d1e3f6a73f98 100644 (file)
@@ -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;