[PATCH 1/2] virshDomainGetVcpuBitmap: Return bitmap when taking the fallback path

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 tools/virsh-domain.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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++) {
-- 
2.31.1




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux