qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] os-posix: Log to logfile in case of daemonize


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH] os-posix: Log to logfile in case of daemonize
Date: Thu, 11 Feb 2016 18:56:20 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256



On 11/02/2016 17:49, Dimitris Aragiorgis wrote:
>> Perhaps when the logfile is opened you can replace the straight
>> fopen with
>> 
>> qemu_logfile = fopen(...); if (daemonized) { 
>> dup2(fileno(qemu_logfile), STDERR_FILENO); fclose(qemu_logfile); 
>> qemu_logfile = stderr; }
>> 
>> Then the logfile will never be closed by qemu_log_close, and
>> stderr will always be sent to it.  Does this look sane?
>> 
> 
> I guess the above snippet will go in do_qemu_set_log(), right?
> 
> If true, we have to open the logfile even if the -d option is not
> given.

Right, but only if daemonize.

> Besides that, log.c should become aware of daemonize.

Yes.

Paolo



reply via email to

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