Skip to content

tests/qtest/test-x86-cpuid-compat: fix leaks

Peter Maydell qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2tests/qtest/test-x86-cpuid-compat: Switch test_cpuid_prop to data-driventests/qtest/test-x86-cpuid-compat.c+173 -1231 reply
2/2tests/qtest/test-x86-cpuid-compat: Switch test_feature_flag to data-driventests/qtest/test-x86-cpuid-compat.c+72 -621 reply

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchFabiano Rosas
1/2R-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/2] tests/qtest/test-x86-cpuid-compat: fix leaks

The test-x86-cpuid-compat has some leaks because it allocates memory when setting up tests, and only frees it when the test is actually run. This means that it leaks:
* if the user asks to run only a particular test
* if the user asks to list the tests with -l
* when the subprocess tests re-invoke the test binary to run a single test in a subprocess

This patchset fixes this by deferring all allocations to when the test is actually run, and instead passing the test a pointer to a constant struct that has the information it needs.

thanks
-- PMM

Peter Maydell (2):
tests/qtest/test-x86-cpuid-compat: Switch test_cpuid_prop to
data-driven
tests/qtest/test-x86-cpuid-compat: Switch test_feature_flag to
data-driven

 tests/qtest/test-x86-cpuid-compat.c | 430 ++++++++++++++++------------
 1 file changed, 245 insertions(+), 185 deletions(-)
Signature · 1 line
2.43.0