|
From: | Denis V. Lunev |
Subject: | Re: [Qemu-devel] [PATCH 3/9] log: improve code in do_qemu_set_log |
Date: | Wed, 16 Mar 2016 14:20:46 +0300 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 |
On 03/14/2016 05:28 PM, Paolo Bonzini wrote:
On 14/03/2016 12:21, Denis V. Lunev wrote:/* In case -D is given do not redirect stderr to /dev/null */ - if (!qemu_logfile) { + if (!qemu_logfile || qemu_logfile == stderr) { dup2(fd, 2);This relies on knowledge that fileno(qemu_logfile) is dup-ed to stderr.
actually the comment 2 lines above is exactly about this :))))))
I'm not sure what's the problem in commit c586eac33; the idea is that, if -daemonize is given, a named logfile should always be open (so that stderr is redirected) but stderr should not be used as log destination (because that's just /dev/null). That's clear from the condition: is_daemonized() ? logfilename != NULL : qemu_loglevel Paolo
The question here is the following actually. Should we continue to keep writing 'stderr' output to the log file when we have cleared all log levels. If the answer is 'yes', original == your code is correct while my is wrong. In the other case - the situation becomes mirrored. Den
[Prev in Thread] | Current Thread | [Next in Thread] |