From 989b697ddd46769b0999e8cd16b5ecd393204734 Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Tue, 26 Feb 2013 17:52:40 +0000 Subject: qemu-log: default to stderr for logging output Switch the default for qemu_log logging output from "/tmp/qemu.log" to stderr. This is an incompatible change in some sense, but logging is mostly used for debugging purposes so it shouldn't affect production use. The previous behaviour can be obtained by adding "-D /tmp/qemu.log" to the command line. This change requires us to: * update all the documentation/help text (we take the opportunity to smooth out minor inconsistencies between the phrasing in linux-user/bsd-user/system help messages) * make linux-user and bsd-user defer to qemu-log for the default logging destination rather than overriding it themselves * ensure that all logfile closing is done via qemu_log_close() and that that function doesn't close stderr as well as the obvious change to the behaviour of do_qemu_set_log() when no logfile name has been specified. Signed-off-by: Peter Maydell Reviewed-by: Stefan Hajnoczi Reviewed-by: Markus Armbruster Message-id: 1361901160-28729-1-git-send-email-peter.maydell@linaro.org Signed-off-by: Anthony Liguori --- bsd-user/main.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'bsd-user') diff --git a/bsd-user/main.c b/bsd-user/main.c index 097fbfe432..cc8498187a 100644 --- a/bsd-user/main.c +++ b/bsd-user/main.c @@ -34,8 +34,6 @@ #include "qemu/timer.h" #include "qemu/envlist.h" -#define DEBUG_LOGFILE "/tmp/qemu.log" - int singlestep; #if defined(CONFIG_USE_GUEST_BASE) unsigned long mmap_min_addr; @@ -691,11 +689,12 @@ static void usage(void) "-bsd type select emulated BSD type FreeBSD/NetBSD/OpenBSD (default)\n" "\n" "Debug options:\n" - "-d options activate log (default logfile=%s)\n" - "-D logfile override default logfile location\n" - "-p pagesize set the host page size to 'pagesize'\n" - "-singlestep always run in singlestep mode\n" - "-strace log system calls\n" + "-d item1[,...] enable logging of specified items\n" + " (use '-d help' for a list of log items)\n" + "-D logfile write logs to 'logfile' (default stderr)\n" + "-p pagesize set the host page size to 'pagesize'\n" + "-singlestep always run in singlestep mode\n" + "-strace log system calls\n" "\n" "Environment variables:\n" "QEMU_STRACE Print system calls and arguments similar to the\n" @@ -709,8 +708,7 @@ static void usage(void) , TARGET_ARCH, interp_prefix, - x86_stack_size, - DEBUG_LOGFILE); + x86_stack_size); exit(1); } @@ -733,7 +731,7 @@ int main(int argc, char **argv) { const char *filename; const char *cpu_model; - const char *log_file = DEBUG_LOGFILE; + const char *log_file = NULL; const char *log_mask = NULL; struct target_pt_regs regs1, *regs = ®s1; struct image_info info1, *info = &info1; -- cgit v1.2.1