All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fabiano Rosas <farosas@suse.de>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-devel@nongnu.org, Laurent Vivier <lvivier@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH v1 1/3] tests/qtest/libqtest: Replace QTEST_TRACE with QTEST_QEMU_ARGS
Date: Thu, 30 Apr 2026 11:35:35 -0300	[thread overview]
Message-ID: <87wlxoplc8.fsf@suse.de> (raw)
In-Reply-To: <CAFEAcA_5hpKE3t07+NqjXWnhwAiRCBugt1DirJ+2-bq4r657jg@mail.gmail.com>

Peter Maydell <peter.maydell@linaro.org> writes:

> On Wed, 29 Apr 2026 at 01:32, Fabiano Rosas <farosas@suse.de> wrote:
>>
>> The QTEST_TRACE environment variable allows for any QEMU command line
>> option to be passed if used like so:
>>
>> export QTEST_TRACE="-trace tracepoint -more -opts -here"
>>
>> Formalize that usage by accepting a new QTEST_QEMU_ARGS
>> variable. Since the QTEST_TRACE now becomes redundant, remove its
>> usage.
>>
>> Signed-off-by: Fabiano Rosas <farosas@suse.de>
>> ---
>>  tests/qtest/libqtest.c | 11 +++++------
>>  1 file changed, 5 insertions(+), 6 deletions(-)
>>
>> diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c
>> index 051faf31e1..a580d75179 100644
>> --- a/tests/qtest/libqtest.c
>> +++ b/tests/qtest/libqtest.c
>> @@ -454,11 +454,9 @@ gchar *qtest_qemu_args(const char *extra_args)
>>  {
>>      g_autofree gchar *socket_path = qtest_socket_path("sock");
>>      g_autofree gchar *qmp_socket_path = qtest_socket_path("qmp");
>> -    const char *trace = g_getenv("QTEST_TRACE");
>> -    g_autofree char *tracearg = trace ? g_strdup_printf("-trace %s ", trace) :
>> -                                        g_strdup("");
>> +    const char *args_from_env = g_getenv("QTEST_QEMU_ARGS");
>> +
>>      gchar *args = g_strdup_printf(
>> -                      "%s"
>>                        "-qtest unix:%s "
>>                        "-qtest-log %s "
>>                        "-chardev socket,path=%s,id=char0 "
>> @@ -466,16 +464,17 @@ gchar *qtest_qemu_args(const char *extra_args)
>>                        "-display none "
>>                        "-audio none "
>>                        "%s"
>> +                      "%s "
>>                        "%s"
>>                        " -accel qtest",
>>
>> -                      tracearg,
>>                        socket_path,
>>                        getenv("QTEST_LOG") ? DEV_STDERR : DEV_NULL,
>>                        qmp_socket_path,
>>                        can_exit_with_parent() ?
>>                        "-run-with exit-with-parent=on " : "",
>> -                      extra_args ?: "");
>> +                      extra_args ?: "",
>> +                      args_from_env ?: "");
>
> Maybe we should have all those "%s" consistently be "%s "
> (and drop the trailing space in the "-run-with exit-with-parent=on "
> string and the leading one in " -accel qtest")?
>

Yep, I'll fix it.

At some point I'll figure out how to integrate this qgraph thing with
the rest of qtest so we can build command lines in a cleaner way.

> Sometimes we might get an extra space we don't technically
> need in the command line, but on the other hand we would be able
> to look at the format string and see at a glance that it
> definitely doesn't potentially run one argument into the next
> without having to cross-check all the %s with the arguments,
> and the arguments would consistently always be just strings
> with no requirement to bring along a leading or trailing space.
>
> But either way
> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
>
> thanks
> -- PMM


  reply	other threads:[~2026-04-30 14:36 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-29  0:31 [PATCH v1 0/3] tests/qtest: Tweak env variables Fabiano Rosas
2026-04-29  0:31 ` [PATCH v1 1/3] tests/qtest/libqtest: Replace QTEST_TRACE with QTEST_QEMU_ARGS Fabiano Rosas
2026-04-30 13:28   ` Peter Maydell
2026-04-30 14:35     ` Fabiano Rosas [this message]
2026-04-29  0:31 ` [PATCH v1 2/3] tests/qtest: Individual verbose switches Fabiano Rosas
2026-04-29 21:24   ` Peter Xu
2026-04-29 23:08     ` Fabiano Rosas
2026-04-29  0:31 ` [PATCH v1 3/3] docs/devel/qtest: Mention environment variables usage Fabiano Rosas
2026-04-29 22:28   ` Pierrick Bouvier
2026-04-30 13:21   ` Peter Maydell
2026-04-30 13:25     ` Fabiano Rosas

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=87wlxoplc8.fsf@suse.de \
    --to=farosas@suse.de \
    --cc=lvivier@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.