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 <[email protected]>
Link: https://lore.kernel.org/qemu-devel/[email protected]
[end all fmt strings with space]
Signed-off-by: Fabiano Rosas <[email protected]>
---
 tests/qtest/libqtest.c | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c
index 116a8a3258..dc4a665cfa 100644
--- a/tests/qtest/libqtest.c
+++ b/tests/qtest/libqtest.c
@@ -454,28 +454,27 @@ 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 "
                       "-mon chardev=char0,mode=control "
                       "-display none "
                       "-audio none "
-                      "%s"
-                      "%s"
-                      " -accel qtest",
+                      "%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 ?: "");
+                      "-run-with exit-with-parent=on" : "",
+                      extra_args ?: "",
+                      args_from_env ?: "");
 
     return args;
 }
-- 
2.51.0


Reply via email to