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 <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Jiri Denemark 2021-11-04 19:49:36 +01:00
parent 0402a66e8b
commit 6cb5464ab4

View File

@ -1954,6 +1954,7 @@ virCapabilitiesHostNUMAInitReal(virCapsHostNUMA *caps)
if (ncpus == -2)
continue;
ncpus = 0;
goto cleanup;
}