[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 3/9] log: improve code in do_qemu_set_log

From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 3/9] log: improve code in do_qemu_set_log
Date: Mon, 14 Mar 2016 15:28:57 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0

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.
 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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]