diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2016-02-25 15:30:57 +0000 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2016-02-25 15:30:57 +0000 |
commit | 586fc27e6a2ade22e35089e8972bc678b113e1db (patch) | |
tree | 3757f6e443da156b390e913c0c8437c3d5e4ddb4 /util | |
parent | 774ae4254d3910f1c94ad6ed44d14cbea0e6a2f2 (diff) | |
parent | cfc3b074de4b4ccee2540edbf8cfdb026dc19943 (diff) |
Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging
* Asynchronous dump-guest-memory from Peter
* improved logging with -D -daemonize from Dimitris
* more address_space_* optimization from Gonglei
* TCG xsave/xrstor thinko fix
* chardev bugfix and documentation patch
# gpg: Signature made Thu 25 Feb 2016 15:12:27 GMT 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:
target-i386: fix confusion in xcr0 bit position vs. mask
chardev: Properly initialize ChardevCommon components
memory: Remove unreachable return statement
memory: optimize qemu_get_ram_ptr and qemu_ram_ptr_length
exec: store RAMBlock pointer into memory region
log: Redirect stderr to logfile if deamonized
dump-guest-memory: add qmp event DUMP_COMPLETED
Dump: add hmp command "info dump"
Dump: add qmp command "query-dump"
DumpState: adding total_size and written_size fields
dump-guest-memory: add "detach" support
dump-guest-memory: disable dump when in INMIGRATE state
dump-guest-memory: introduce dump_process() helper function.
dump-guest-memory: add dump_in_progress() helper function
dump-guest-memory: using static DumpState, add DumpStatus
dump-guest-memory: add "detach" flag for QMP/HMP interfaces.
dump-guest-memory: cleanup: removing dump_{error|cleanup}().
scripts/kvm/kvm_stat: Fix missing right parantheses and ".format(...)"
qemu-options.hx: Improve documentation of chardev multiplexing mode
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'util')
-rw-r--r-- | util/log.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/util/log.c b/util/log.c index 2709e98f98..a7ddc7ecd1 100644 --- a/util/log.c +++ b/util/log.c @@ -56,13 +56,20 @@ void do_qemu_set_log(int log_flags, bool use_own_buffers) #ifdef CONFIG_TRACE_LOG qemu_loglevel |= LOG_TRACE; #endif - if (qemu_loglevel && !qemu_logfile) { + if ((qemu_loglevel || is_daemonized()) && !qemu_logfile) { if (logfilename) { qemu_logfile = fopen(logfilename, log_append ? "a" : "w"); if (!qemu_logfile) { perror(logfilename); _exit(1); } + /* In case we are a daemon redirect stderr to logfile */ + if (is_daemonized()) { + dup2(fileno(qemu_logfile), STDERR_FILENO); + fclose(qemu_logfile); + /* This will skip closing logfile in qemu_log_close() */ + qemu_logfile = stderr; + } } else { /* Default to stderr if no log file specified */ qemu_logfile = stderr; @@ -82,7 +89,7 @@ void do_qemu_set_log(int log_flags, bool use_own_buffers) log_append = 1; } } - if (!qemu_loglevel && qemu_logfile) { + if (!qemu_loglevel && !is_daemonized() && qemu_logfile) { qemu_log_close(); } } |