qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Steven Sistare <steven.sistare@oracle.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: qemu-devel@nongnu.org, Fabiano Rosas <farosas@suse.de>,
	Laurent Vivier <lvivier@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH] tests/qtest: optimize qtest_get_machines
Date: Mon, 22 Sep 2025 14:22:05 -0400	[thread overview]
Message-ID: <9136ecc5-a6cb-4c16-a0a5-a9090790667f@oracle.com> (raw)
In-Reply-To: <87frchtx5j.fsf@pond.sub.org>

On 9/20/2025 3:12 AM, Markus Armbruster wrote:
> Steve Sistare <steven.sistare@oracle.com> 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 <steven.sistare@oracle.com>
> 
> 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: <87h5ymdzrf.fsf@pond.sub.org>
>      https://lore.kernel.org/qemu-devel/87h5ymdzrf.fsf@pond.sub.org/
> 
> Appreciated!

In truth, this new patch is not intended to reduce leaks.  If it does,
that is a bonus :)

- Steve




  reply	other threads:[~2025-09-22 18:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-19 13:58 [PATCH] tests/qtest: optimize qtest_get_machines Steve Sistare
2025-09-19 15:47 ` Fabiano Rosas
2025-09-20  7:12 ` Markus Armbruster
2025-09-22 18:22   ` Steven Sistare [this message]
2025-09-23  5:49     ` Markus Armbruster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9136ecc5-a6cb-4c16-a0a5-a9090790667f@oracle.com \
    --to=steven.sistare@oracle.com \
    --cc=armbru@redhat.com \
    --cc=farosas@suse.de \
    --cc=lvivier@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).