qemu-log: introduce qemu_log_separate

In some cases, the same message is printed both on stderr and in the log.
Avoid duplicate output in the default case where stderr _is_ the log,
and standardize this to stderr+log where it used to use stdio+log.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Paolo Bonzini 2015-11-13 13:16:27 +01:00
parent 31e38a22a0
commit 013a29424c
8 changed files with 43 additions and 27 deletions

View file

@ -28,6 +28,13 @@ static inline bool qemu_log_enabled(void)
return qemu_logfile != NULL;
}
/* Returns true if qemu_log() will write somewhere else than stderr
*/
static inline bool qemu_log_separate(void)
{
return qemu_logfile != NULL && qemu_logfile != stderr;
}
#define CPU_LOG_TB_OUT_ASM (1 << 0)
#define CPU_LOG_TB_IN_ASM (1 << 1)
#define CPU_LOG_TB_OP (1 << 2)