[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 29/39] linux-user: Use qemu_set_log_filename_flags
From: |
Richard Henderson |
Subject: |
[PATCH v3 29/39] linux-user: Use qemu_set_log_filename_flags |
Date: |
Sun, 17 Apr 2022 11:30:09 -0700 |
Perform all logfile setup in one step.
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
linux-user/main.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/linux-user/main.c b/linux-user/main.c
index d263b2a669..0297ae8321 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -85,6 +85,7 @@ static bool enable_strace;
* Used to support command line arguments overriding environment variables.
*/
static int last_log_mask;
+static const char *last_log_filename;
/*
* When running 32-on-64 we should make sure we can fit all of the possible
@@ -257,7 +258,7 @@ static void handle_arg_dfilter(const char *arg)
static void handle_arg_log_filename(const char *arg)
{
- qemu_set_log_filename(arg, &error_fatal);
+ last_log_filename = arg;
}
static void handle_arg_set_env(const char *arg)
@@ -643,7 +644,6 @@ int main(int argc, char **argv, char **envp)
int i;
int ret;
int execfd;
- int log_mask;
unsigned long max_reserved_va;
bool preserve_argv0;
@@ -677,10 +677,9 @@ int main(int argc, char **argv, char **envp)
optind = parse_args(argc, argv);
- log_mask = last_log_mask | (enable_strace ? LOG_STRACE : 0);
- if (log_mask) {
- qemu_set_log(log_mask, &error_fatal);
- }
+ qemu_set_log_filename_flags(last_log_filename,
+ last_log_mask | (enable_strace * LOG_STRACE),
+ &error_fatal);
if (!trace_init_backends()) {
exit(1);
--
2.25.1
- [PATCH v3 26/39] sysemu/os-win32: Test for and use _lock_file/_unlock_file, (continued)
- [PATCH v3 26/39] sysemu/os-win32: Test for and use _lock_file/_unlock_file, Richard Henderson, 2022/04/17
- [PATCH v3 19/39] util/log: Remove qemu_log_flush, Richard Henderson, 2022/04/17
- [PATCH v3 30/39] softmmu: Use qemu_set_log_filename_flags, Richard Henderson, 2022/04/17
- [PATCH v3 31/39] util/log: Remove qemu_log_close, Richard Henderson, 2022/04/17
- [PATCH v3 28/39] bsd-user: Use qemu_set_log_filename_flags, Richard Henderson, 2022/04/17
- [PATCH v3 02/39] target/hexagon: Remove qemu_set_log in hexagon_translate_init, Richard Henderson, 2022/04/17
- [PATCH v3 04/39] util/log: Pass Error pointer to qemu_set_log, Richard Henderson, 2022/04/17
- [PATCH v3 15/39] target/nios2: Remove log_cpu_state from reset, Richard Henderson, 2022/04/17
- [PATCH v3 24/39] include/exec/log: Do not reference QemuLogFile directly, Richard Henderson, 2022/04/17
- [PATCH v3 29/39] linux-user: Use qemu_set_log_filename_flags,
Richard Henderson <=
- [PATCH v3 35/39] util/log: Hoist the eval of is_daemonized in qemu_set_log_internal, Richard Henderson, 2022/04/17
- [PATCH v3 34/39] util/log: Rename qemu_logfile_mutex to global_mutex, Richard Henderson, 2022/04/17
- [PATCH v3 36/39] util/log: Combine two logfile closes, Richard Henderson, 2022/04/17
- [PATCH v3 39/39] util/log: Support per-thread log files, Richard Henderson, 2022/04/17
- [PATCH v3 38/39] util/log: Limit RCUCloseFILE to file closing, Richard Henderson, 2022/04/17
- [PATCH v3 33/39] util/log: Rename qemu_logfile to global_file, Richard Henderson, 2022/04/17
- [PATCH v3 12/39] exec/translator: Pass the locked filepointer to disas_log hook, Richard Henderson, 2022/04/17
- [PATCH v3 18/39] util/log: Mark qemu_log_trylock as G_GNUC_WARN_UNUSED_RESULT, Richard Henderson, 2022/04/17