]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Do not pass negative ncpus to virCapabilitiesClearHostNUMACellCPUTopology
authorJiri Denemark <jdenemar@redhat.com>
Thu, 4 Nov 2021 18:49:36 +0000 (19:49 +0100)
committerJiri Denemark <jdenemar@redhat.com>
Fri, 5 Nov 2021 08:25:55 +0000 (09:25 +0100)
It won't cause any harm as cpus is NULL when we pass a negative ncpus,
but doing so when the function expects unsigned value is not right.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/conf/capabilities.c

index a3e68741a9496d3dee06e4a0409321fad7d121aa..cea4803fc8930ee95f6be9805c73c8624e105ef6 100644 (file)
@@ -1954,6 +1954,7 @@ virCapabilitiesHostNUMAInitReal(virCapsHostNUMA *caps)
             if (ncpus == -2)
                 continue;
 
+            ncpus = 0;
             goto cleanup;
         }