util/log: Remove qemu_log_close

The only real use is in cpu_abort, where we have just
flushed the file via qemu_log_unlock, and are just about
to force-crash the application via abort.  We do not
really need to close the FILE before the abort.

The two uses in test-logging.c can be handled with
qemu_set_log_filename_flags.

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220417183019.755276-32-richard.henderson@linaro.org>
This commit is contained in:
Richard Henderson 2022-04-17 11:30:11 -07:00
parent b2528af10a
commit ec0d1849d9
4 changed files with 3 additions and 22 deletions

View file

@ -198,7 +198,7 @@ static bool qemu_set_log_internal(const char *filename, bool changed_name,
if (is_daemonized()) {
dup2(fileno(fd), STDERR_FILENO);
fclose(fd);
/* This will skip closing logfile in qemu_log_close() */
/* This will skip closing logfile in qemu_logfile_free. */
fd = stderr;
}
} else {
@ -322,21 +322,6 @@ out:
g_strfreev(ranges);
}
/* Close the log file */
void qemu_log_close(void)
{
QemuLogFile *logfile;
qemu_mutex_lock(&qemu_logfile_mutex);
logfile = qemu_logfile;
if (logfile) {
qatomic_rcu_set(&qemu_logfile, NULL);
call_rcu(logfile, qemu_logfile_free, rcu);
}
qemu_mutex_unlock(&qemu_logfile_mutex);
}
const QEMULogItem qemu_log_items[] = {
{ CPU_LOG_TB_OUT_ASM, "out_asm",
"show generated host assembly code for each compiled TB" },