aboutsummaryrefslogtreecommitdiff
path: root/util/log.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2016-05-19 15:55:08 +0100
committerPeter Maydell <peter.maydell@linaro.org>2016-05-19 15:55:08 +0100
commit776efef32439a31cb13a6acfe8aab833687745ad (patch)
tree8bb3579b495d9c5d19145041623dc10f6e2f8d18 /util/log.c
parent8ec4fe0a4bed4fa27e6f28a746bcf77b27cd05a3 (diff)
parentdf43d49cb8708b9c88a20afe0d1a3089b550a5b8 (diff)
Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging
NEED_CPU_H cleanups, big enough to deserve their own pull request. # gpg: Signature made Thu 19 May 2016 15:42:37 BST using RSA key ID 78C7AE83 # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" # gpg: aka "Paolo Bonzini <pbonzini@redhat.com>" * remotes/bonzini/tags/for-upstream: (52 commits) hw: clean up hw/hw.h includes hw: remove pio_addr_t cpu: move exec-all.h inclusion out of cpu.h exec: extract exec/tb-context.h hw: explicitly include qemu/log.h mips: move CP0 functions out of cpu.h arm: move arm_log_exception into .c file qemu-common: push cpu.h inclusion out of qemu-common.h acpi: do not use TARGET_PAGE_SIZE s390x: reorganize CSS bits between cpu.h and other headers dma: do not depend on kvm_enabled() gdbstub: remove unnecessary includes from gdbstub-xml.c qemu-common: stop including qemu/host-utils.h from qemu-common.h qemu-common: stop including qemu/bswap.h from qemu-common.h cpu: move endian-dependent load/store functions to cpu-all.h hw: cannot include hw/hw.h from user emulation hw: move CPU state serialization to migration/cpu.h hw: do not use VMSTATE_*TL include: poison symbols in osdep.h apic: move target-dependent definitions to cpu.h ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'util/log.c')
-rw-r--r--util/log.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/util/log.c b/util/log.c
index 1857730dcb..5ad72c197f 100644
--- a/util/log.c
+++ b/util/log.c
@@ -42,8 +42,10 @@ void qemu_log(const char *fmt, ...)
va_end(ap);
}
+static bool log_uses_own_buffers;
+
/* enable or disable low levels log */
-void do_qemu_set_log(int log_flags, bool use_own_buffers)
+void qemu_set_log(int log_flags)
{
qemu_loglevel = log_flags;
#ifdef CONFIG_TRACE_LOG
@@ -70,7 +72,7 @@ void do_qemu_set_log(int log_flags, bool use_own_buffers)
qemu_logfile = stderr;
}
/* must avoid mmap() usage of glibc by setting a buffer "by hand" */
- if (use_own_buffers) {
+ if (log_uses_own_buffers) {
static char logfile_buf[4096];
setvbuf(qemu_logfile, logfile_buf, _IOLBF, sizeof(logfile_buf));
@@ -89,6 +91,12 @@ void do_qemu_set_log(int log_flags, bool use_own_buffers)
qemu_log_close();
}
}
+
+void qemu_log_needs_buffers(void)
+{
+ log_uses_own_buffers = true;
+}
+
/*
* Allow the user to include %d in their logfile which will be
* substituted with the current PID. This is useful for debugging many