util/log: Drop call to setvbuf

Now that the log buffer is flushed after every qemu_log_unlock,
which includes every call to qemu_log, we do not need to force
line buffering (or unbuffering for windows).  Block buffer the
entire loggable unit.

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220417183019.755276-21-richard.henderson@linaro.org>
This commit is contained in:
Richard Henderson 2022-04-17 11:30:00 -07:00
parent 90f37362d7
commit fb6efecf54

View File

@ -136,12 +136,6 @@ bool qemu_set_log(int log_flags, Error **errp)
logfile->fd = stderr;
}
#if defined(_WIN32)
/* Win32 doesn't support line-buffering, so use unbuffered output. */
setvbuf(logfile->fd, NULL, _IONBF, 0);
#else
setvbuf(logfile->fd, NULL, _IOLBF, 0);
#endif
log_append = 1;
qatomic_rcu_set(&qemu_logfile, logfile);
}