[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 02/24] fuzz: Change the way we write qtest log to stderr
From: |
Thomas Huth |
Subject: |
[PULL 02/24] fuzz: Change the way we write qtest log to stderr |
Date: |
Wed, 16 Sep 2020 13:47:09 +0200 |
From: Alexander Bulekov <alxndr@bu.edu>
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 | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/tests/qtest/fuzz/fuzz.c b/tests/qtest/fuzz/fuzz.c
index 1ceea84702..7f266ffc63 100644
--- a/tests/qtest/fuzz/fuzz.c
+++ b/tests/qtest/fuzz/fuzz.c
@@ -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;
--
2.18.2
- [PULL 00/24] qtests, unit tests and Cirrus-CI fixes / improvements, Thomas Huth, 2020/09/16
- [PULL 01/24] iotests: Drop readlink -f, Thomas Huth, 2020/09/16
- [PULL 02/24] fuzz: Change the way we write qtest log to stderr,
Thomas Huth <=
- [PULL 03/24] tests/qtest/qmp-cmd-test: Use inclusive language, Thomas Huth, 2020/09/16
- [PULL 04/24] tests/socket-helpers: Treat EAI_NONAME as EADDRNOTAVAIL, Thomas Huth, 2020/09/16
- [PULL 06/24] qga/commands-win32: Fix problem with redundant protype declaration, Thomas Huth, 2020/09/16
- [PULL 05/24] Simplify the .gitignore file, Thomas Huth, 2020/09/16
- [PULL 08/24] tests: Convert g_free to g_autofree macro in test-logging.c, Thomas Huth, 2020/09/16
- [PULL 07/24] rcu: Implement drain_call_rcu, Thomas Huth, 2020/09/16
- [PULL 10/24] meson: Disable test-char on msys2/mingw for fixing tests stuck, Thomas Huth, 2020/09/16
- [PULL 09/24] rcu: fixes test-logging.c by call drain_call_rcu before rmdir_full, Thomas Huth, 2020/09/16