]> git.proxmox.com Git - mirror_qemu.git/commitdiff
fuzz: Change the way we write qtest log to stderr
authorAlexander Bulekov <alxndr@bu.edu>
Wed, 19 Aug 2020 06:10:56 +0000 (02:10 -0400)
committerThomas Huth <thuth@redhat.com>
Wed, 16 Sep 2020 06:41:06 +0000 (08:41 +0200)
Telling QTest to log to /dev/fd/2, essentially results in dup(2). This
is fine, if other code isn't logging to stderr. Otherwise, the order of
the logs is mixed due to buffering issues, since two file-descriptors
are used to write to the same file. We can avoid this, since just
specifying "-qtest" sets the log fd to stderr. If we want to disable
qtest logs, we can just add -qtest-log none.

Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
Message-Id: <20200819061110.1320568-2-alxndr@bu.edu>
Signed-off-by: Thomas Huth <thuth@redhat.com>
tests/qtest/fuzz/fuzz.c

index 1ceea8470269a63c182e2ddd52c9b6674e9d3c3a..7f266ffc63ed60db4f0f0098c943917cf30a7c4a 100644 (file)
@@ -202,9 +202,8 @@ int LLVMFuzzerInitialize(int *argc, char ***argv, char ***envp)
 
     /* Run QEMU's softmmu main with the fuzz-target dependent arguments */
     GString *cmd_line = fuzz_target->get_init_cmdline(fuzz_target);
-    g_string_append_printf(cmd_line,
-                           " -qtest /dev/null -qtest-log %s",
-                           getenv("QTEST_LOG") ? "/dev/fd/2" : "/dev/null");
+    g_string_append_printf(cmd_line, " %s -qtest /dev/null ",
+                           getenv("QTEST_LOG") ? "" : "-qtest-log none");
 
     /* Split the runcmd into an argv and argc */
     wordexp_t result;