From: Jiri Denemark Date: Thu, 4 Nov 2021 18:49:36 +0000 (+0100) Subject: qemu: Do not pass negative ncpus to virCapabilitiesClearHostNUMACellCPUTopology X-Git-Tag: v7.10.0-rc1~205 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6cb5464ab4697acbc56341732a15519234edfef0;p=thirdparty%2Flibvirt.git qemu: Do not pass negative ncpus to virCapabilitiesClearHostNUMACellCPUTopology 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 Reviewed-by: Michal Privoznik --- diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c index a3e68741a9..cea4803fc8 100644 --- a/src/conf/capabilities.c +++ b/src/conf/capabilities.c @@ -1954,6 +1954,7 @@ virCapabilitiesHostNUMAInitReal(virCapsHostNUMA *caps) if (ncpus == -2) continue; + ncpus = 0; goto cleanup; }