util/log: Rename qemu_logfile_mutex to global_mutex
Rename to emphasize this covers the file-scope global variables. Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20220417183019.755276-35-richard.henderson@linaro.org>
This commit is contained in:
parent
8ae58d6009
commit
702979f736
10
util/log.c
10
util/log.c
@ -34,9 +34,11 @@ typedef struct QemuLogFile {
|
|||||||
FILE *fd;
|
FILE *fd;
|
||||||
} QemuLogFile;
|
} QemuLogFile;
|
||||||
|
|
||||||
|
/* Mutex covering the other global_* variables. */
|
||||||
|
static QemuMutex global_mutex;
|
||||||
static char *global_filename;
|
static char *global_filename;
|
||||||
static QemuMutex qemu_logfile_mutex;
|
|
||||||
static QemuLogFile *global_file;
|
static QemuLogFile *global_file;
|
||||||
|
|
||||||
int qemu_loglevel;
|
int qemu_loglevel;
|
||||||
static int log_append = 0;
|
static int log_append = 0;
|
||||||
static GArray *debug_regions;
|
static GArray *debug_regions;
|
||||||
@ -101,9 +103,9 @@ void qemu_log(const char *fmt, ...)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void __attribute__((__constructor__)) qemu_logfile_init(void)
|
static void __attribute__((__constructor__)) startup(void)
|
||||||
{
|
{
|
||||||
qemu_mutex_init(&qemu_logfile_mutex);
|
qemu_mutex_init(&global_mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void qemu_logfile_free(QemuLogFile *logfile)
|
static void qemu_logfile_free(QemuLogFile *logfile)
|
||||||
@ -123,7 +125,7 @@ static bool qemu_set_log_internal(const char *filename, bool changed_name,
|
|||||||
bool need_to_open_file;
|
bool need_to_open_file;
|
||||||
QemuLogFile *logfile;
|
QemuLogFile *logfile;
|
||||||
|
|
||||||
QEMU_LOCK_GUARD(&qemu_logfile_mutex);
|
QEMU_LOCK_GUARD(&global_mutex);
|
||||||
logfile = global_file;
|
logfile = global_file;
|
||||||
|
|
||||||
if (changed_name) {
|
if (changed_name) {
|
||||||
|
Loading…
Reference in New Issue
Block a user