[PATCH 0/3] Add test for virHostCPUGetMap and fix it

Martin Kletzander via Devel posted 3 patches 1 week ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/cover.1774525263.git.mkletzan@redhat.com
src/util/virhostcpu.c                         | 22 ++++---
.../linux-many-offline/cpu/online             |  1 +
.../linux-many-offline/cpu/present            |  1 +
tests/virhostcputest.c                        | 57 +++++++++++++++++++
4 files changed, 69 insertions(+), 12 deletions(-)
create mode 100644 tests/virhostcpudata/linux-many-offline/cpu/online
create mode 100644 tests/virhostcpudata/linux-many-offline/cpu/present
[PATCH 0/3] Add test for virHostCPUGetMap and fix it
Posted by Martin Kletzander via Devel 1 week ago
I found an old patch that fell between the cracks and to show that it can
manifest itself I also added a test in PATCH 3/3 which fails without PATCH 2/3,
but it shows the explained case from the 2nd patch's commit message.  Can be
squashed to any of the other two, this is just easier to see I feel like.

Felix Huettner (1):
  virhostcpu: Fix potential use of unallocated memory

Martin Kletzander (2):
  tests: Extend virhostcputest to check virHostCPUGetMap
  tests/virhostcpudata: Add test case with many offline CPUs

 src/util/virhostcpu.c                         | 22 ++++---
 .../linux-many-offline/cpu/online             |  1 +
 .../linux-many-offline/cpu/present            |  1 +
 tests/virhostcputest.c                        | 57 +++++++++++++++++++
 4 files changed, 69 insertions(+), 12 deletions(-)
 create mode 100644 tests/virhostcpudata/linux-many-offline/cpu/online
 create mode 100644 tests/virhostcpudata/linux-many-offline/cpu/present

-- 
2.53.0
Re: [PATCH 0/3] Add test for virHostCPUGetMap and fix it
Posted by Ján Tomko via Devel 1 week ago
On a Thursday in 2026, Martin Kletzander via Devel wrote:
>I found an old patch that fell between the cracks and to show that it can
>manifest itself I also added a test in PATCH 3/3 which fails without PATCH 2/3,
>but it shows the explained case from the 2nd patch's commit message.  Can be
>squashed to any of the other two, this is just easier to see I feel like.
>
>Felix Huettner (1):
>  virhostcpu: Fix potential use of unallocated memory
>
>Martin Kletzander (2):
>  tests: Extend virhostcputest to check virHostCPUGetMap
>  tests/virhostcpudata: Add test case with many offline CPUs
>
> src/util/virhostcpu.c                         | 22 ++++---
> .../linux-many-offline/cpu/online             |  1 +
> .../linux-many-offline/cpu/present            |  1 +
> tests/virhostcputest.c                        | 57 +++++++++++++++++++
> 4 files changed, 69 insertions(+), 12 deletions(-)
> create mode 100644 tests/virhostcpudata/linux-many-offline/cpu/online
> create mode 100644 tests/virhostcpudata/linux-many-offline/cpu/present
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano