util/log: Remove qemu_log_flush

All uses flush output immediately before or after qemu_log_unlock.
Instead of a separate call, move the flush into qemu_log_unlock.

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>
Message-Id: <20220417183019.755276-20-richard.henderson@linaro.org>
This commit is contained in:
Richard Henderson 2022-04-17 11:29:59 -07:00
parent 27ea81337f
commit 90f37362d7
8 changed files with 1 additions and 21 deletions

View file

@ -54,6 +54,7 @@ FILE *qemu_log_trylock(void)
void qemu_log_unlock(FILE *fd)
{
if (fd) {
fflush(fd);
qemu_funlockfile(fd);
rcu_read_unlock();
}
@ -269,19 +270,6 @@ out:
g_strfreev(ranges);
}
/* fflush() the log file */
void qemu_log_flush(void)
{
QemuLogFile *logfile;
rcu_read_lock();
logfile = qatomic_rcu_read(&qemu_logfile);
if (logfile) {
fflush(logfile->fd);
}
rcu_read_unlock();
}
/* Close the log file */
void qemu_log_close(void)
{