From: Peter Krempa Date: Wed, 15 Sep 2021 13:09:00 +0000 (+0200) Subject: virshDomainGetVcpuBitmap: Return bitmap when taking the fallback path X-Git-Tag: v7.8.0-rc1~193 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=59e74c319384b766a50669c6248222da0cf10fd0;p=thirdparty%2Flibvirt.git virshDomainGetVcpuBitmap: Return bitmap when taking the fallback path In case the specific VCPU states are not present in the XML we were taking a fallback code path just noting that all cpus of the VM are enabled. This was broken by a mistake in a recent refactor where a 'goto cleanup' was mistakenly replaced by a 'return NULL'. This broke reporting of cpus and also caused a memory leak. Return the fallback cpu map. Fixes: bd1f40fe7d4 Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2004429 Signed-off-by: Peter Krempa Reviewed-by: Pavel Hrdina Reviewed-by: Jiri Denemark Reviewed-by: Jonathon Jongsma --- diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index e5bd1fdd75..f5a3e1accc 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -6710,7 +6710,7 @@ virshDomainGetVcpuBitmap(vshControl *ctl, for (i = 0; i < curvcpus; i++) ignore_value(virBitmapSetBit(ret, i)); - return NULL; + return ret; } for (i = 0; i < nnodes; i++) {