]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virshDomainGetVcpuBitmap: Return bitmap when taking the fallback path
authorPeter Krempa <pkrempa@redhat.com>
Wed, 15 Sep 2021 13:09:00 +0000 (15:09 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 15 Sep 2021 13:31:17 +0000 (15:31 +0200)
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 <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
tools/virsh-domain.c

index e5bd1fdd75cd49c10b78f6d491b8601f23e6fc31..f5a3e1accc834d2bebf8d89a4a92ed36ca8b1b93 100644 (file)
@@ -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++) {