tests/qtest/libqtest: Replace QTEST_TRACE with QTEST_QEMU_ARGS
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. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Link: https://lore.kernel.org/qemu-devel/20260429003130.15164-2-farosas@suse.de [end all fmt strings with space] Signed-off-by: Fabiano Rosas <farosas@suse.de>
Fabiano Rosas committed
Apr 28, 2026 at 21:31 UTC
1fb7bc9fa044b68aa9e2bedf14f559f7e90f446c
1 file changed
+9
-10
tests/qtest/libqtest.c
+9
-10
@@ -454,28 +454,27 @@ gchar *qtest_qemu_args(const char *extra_args)
454
{
455
g_autofree gchar *socket_path = qtest_socket_path("sock");
456
g_autofree gchar *qmp_socket_path = qtest_socket_path("qmp");
457
- const char *trace = g_getenv("QTEST_TRACE");
458
- g_autofree char *tracearg = trace ? g_strdup_printf("-trace %s ", trace) :
459
- g_strdup("");
457
+ const char *args_from_env = g_getenv("QTEST_QEMU_ARGS");
458
+
459
gchar *args = g_strdup_printf(
461
- "%s"
460
"-qtest unix:%s "
461
"-qtest-log %s "
462
"-chardev socket,path=%s,id=char0 "
463
"-mon chardev=char0,mode=control "
464
"-display none "
465
"-audio none "
468
- "%s"
469
- "%s"
470
- " -accel qtest",
466
+ "%s "
467
+ "%s "
468
+ "%s "
469
+ "-accel qtest",
470
472
- tracearg,
471
socket_path,
472
getenv("QTEST_LOG") ? DEV_STDERR : DEV_NULL,
473
qmp_socket_path,
474
can_exit_with_parent() ?
477
- "-run-with exit-with-parent=on " : "",
478
- extra_args ?: "");
475
+ "-run-with exit-with-parent=on" : "",
476
+ extra_args ?: "",
477
+ args_from_env ?: "");
478
479
return args;
480
}