On 9/20/2025 3:12 AM, Markus Armbruster wrote:
Steve Sistare <[email protected]> writes:
qtest_get_machines returns the machines supported by the QEMU binary
described by an environment variable and caches the result. If the
next call to qtest_get_machines passes the same variable name, the cached
result is returned, but if the name changes, the caching is defeated.
To make caching more effective, remember the path of the QEMU binary
instead. Different env vars, eg QTEST_QEMU_BINARY_SRC and
QTEST_QEMU_BINARY_DST, usually resolve to the same path.
Before the optimization, the test /x86_64/migration/precopy/unix/plain
exec's QEMU and calls query-machines 3 times. After optimization, that
only happens once. This does not significantly speed up the tests, but
it reduces QTEST_LOG output, and launches fewer QEMU instances, making
it easier to debug problems.
Signed-off-by: Steve Sistare <[email protected]>
I guess this is a followup to an observation I made during review of my
[PATCH 1/5] qtest/qom-test: Plug memory leak with -p:
Message-ID: <[email protected]>
https://lore.kernel.org/qemu-devel/[email protected]/
Appreciated!
In truth, this new patch is not intended to reduce leaks. If it does,
that is a bonus :)
- Steve