[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 32/39] util/log: Rename logfilename to global_filename
From: |
Richard Henderson |
Subject: |
[PATCH v3 32/39] util/log: Rename logfilename to global_filename |
Date: |
Sun, 17 Apr 2022 11:30:12 -0700 |
Rename to emphasize this is the file-scope global variable.
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
util/log.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/util/log.c b/util/log.c
index 491a8f97f9..b3f79deb6c 100644
--- a/util/log.c
+++ b/util/log.c
@@ -34,7 +34,7 @@ typedef struct QemuLogFile {
FILE *fd;
} QemuLogFile;
-static char *logfilename;
+static char *global_filename;
static QemuMutex qemu_logfile_mutex;
static QemuLogFile *qemu_logfile;
int qemu_loglevel;
@@ -151,8 +151,8 @@ static bool qemu_set_log_internal(const char *filename,
bool changed_name,
}
}
- g_free(logfilename);
- logfilename = newname;
+ g_free(global_filename);
+ global_filename = newname;
filename = newname;
if (logfile) {
@@ -161,7 +161,7 @@ static bool qemu_set_log_internal(const char *filename,
bool changed_name,
logfile = NULL;
}
} else {
- filename = logfilename;
+ filename = global_filename;
}
#ifdef CONFIG_TRACE_LOG
@@ -173,9 +173,8 @@ static bool qemu_set_log_internal(const char *filename,
bool changed_name,
* In all cases we only log if qemu_loglevel is set.
* Also:
* If not daemonized we will always log either to stderr
- * or to a file (if there is a logfilename).
- * If we are daemonized,
- * we will only log if there is a logfilename.
+ * or to a file (if there is a filename).
+ * If we are daemonized, we will only log if there is a filename.
*/
need_to_open_file = log_flags && (!is_daemonized() || filename);
--
2.25.1
- [PATCH v3 05/39] os-posix: Use qemu_log_enabled, (continued)
- [PATCH v3 05/39] os-posix: Use qemu_log_enabled, Richard Henderson, 2022/04/17
- [PATCH v3 14/39] accel/tcg: Use cpu_dump_state between qemu_log_trylock/unlock, Richard Henderson, 2022/04/17
- [PATCH v3 20/39] util/log: Drop call to setvbuf, Richard Henderson, 2022/04/17
- [PATCH v3 10/39] util/log: Remove qemu_log_vprintf, Richard Henderson, 2022/04/17
- [PATCH v3 08/39] hw/xen: Split out xen_pv_output_msg, Richard Henderson, 2022/04/17
- [PATCH v3 09/39] *: Use fprintf between qemu_log_trylock/unlock, Richard Henderson, 2022/04/17
- [PATCH v3 16/39] util/log: Use qemu_log_trylock/unlock in qemu_log, Richard Henderson, 2022/04/17
- [PATCH v3 17/39] util/log: Drop return value from qemu_log, Richard Henderson, 2022/04/17
- [PATCH v3 25/39] include/qemu/log: Move entire implementation out-of-line, Richard Henderson, 2022/04/17
- [PATCH v3 27/39] util/log: Introduce qemu_set_log_filename_flags, Richard Henderson, 2022/04/17
- [PATCH v3 32/39] util/log: Rename logfilename to global_filename,
Richard Henderson <=
- [PATCH v3 37/39] util/log: Rename QemuLogFile to RCUCloseFILE, Richard Henderson, 2022/04/17
- [PATCH v3 13/39] exec/log: Remove log_disas and log_target_disas, Richard Henderson, 2022/04/17
- [PATCH v3 07/39] util/log: Rename qemu_log_lock to qemu_log_trylock, Richard Henderson, 2022/04/17
- [PATCH v3 22/39] linux-user: Expand log_page_dump inline, Richard Henderson, 2022/04/17
- [PATCH v3 23/39] tests/unit: Do not reference QemuLogFile directly, Richard Henderson, 2022/04/17
- [PATCH v3 21/39] bsd-user: Expand log_page_dump inline, Richard Henderson, 2022/04/17
- [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