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

Peter Maydell posted 2 patches 1 month ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260308185421.972734-1-peter.maydell@linaro.org
Maintainers: "Michael S. Tsirkin" <mst@redhat.com>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Fabiano Rosas <farosas@suse.de>, Laurent Vivier <lvivier@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>
tests/qtest/test-x86-cpuid-compat.c | 430 ++++++++++++++++------------
1 file changed, 245 insertions(+), 185 deletions(-)
[PATCH 0/2] tests/qtest/test-x86-cpuid-compat: fix leaks
Posted by Peter Maydell 1 month ago
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(-)

-- 
2.43.0