diff --git a/libvirt-virshDomainGetVcpuBitmap-Return-bitmap-when-taking-the-fallback-path.patch b/libvirt-virshDomainGetVcpuBitmap-Return-bitmap-when-taking-the-fallback-path.patch new file mode 100644 index 0000000..f7f3b0e --- /dev/null +++ b/libvirt-virshDomainGetVcpuBitmap-Return-bitmap-when-taking-the-fallback-path.patch @@ -0,0 +1,45 @@ +From fdbfa94e98ef8a62dc170c6f22970bddba602eda Mon Sep 17 00:00:00 2001 +Message-Id: +From: Peter Krempa +Date: Wed, 15 Sep 2021 15:09:00 +0200 +Subject: [PATCH] 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 +(cherry picked from commit 59e74c319384b766a50669c6248222da0cf10fd0) +Signed-off-by: Jiri Denemark +--- + 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.33.0 + diff --git a/libvirt.spec b/libvirt.spec index c24fb14..890d281 100644 --- a/libvirt.spec +++ b/libvirt.spec @@ -206,7 +206,7 @@ Summary: Library providing a simple virtualization API Name: libvirt Version: 7.7.0 -Release: 2%{?dist}%{?extra_release} +Release: 3%{?dist}%{?extra_release} License: LGPLv2+ URL: https://libvirt.org/ @@ -218,6 +218,7 @@ Source1: symlinks Patch1: libvirt-RHEL-Fix-virConnectGetMaxVcpus-output.patch Patch2: libvirt-RHEL-Enable-usage-of-x-blockdev-reopen.patch +Patch3: libvirt-virshDomainGetVcpuBitmap-Return-bitmap-when-taking-the-fallback-path.patch Requires: libvirt-daemon = %{version}-%{release} Requires: libvirt-daemon-config-network = %{version}-%{release} @@ -2086,6 +2087,9 @@ exit 0 %changelog +* Wed Sep 22 2021 Jiri Denemark - 7.7.0-3 +- virshDomainGetVcpuBitmap: Return bitmap when taking the fallback path (rhbz#2004429) + * Tue Sep 21 2021 Jiri Denemark - 7.7.0-2 - Update gating.yaml by adding subject_type - Revert "RHEL: spec: Do not enable modular daemons yet" (rhbz#1920012)