Re: [PATCH] util/log: Always send errors to logfile when daemonized

2022-10-14 Thread Paolo Bonzini
Il ven 14 ott 2022, 18:07 Greg Kurz ha scritto: > 2) and 3) can certainly be preparatory work but I think 1) > should be squashed in my patch. Because of the !per_thread > check in need_to_open_file, the existing code in > qemu_set_log_internal() doesn't even open the global file > and qemu_log_t

Re: [PATCH] util/log: Always send errors to logfile when daemonized

2022-10-14 Thread Greg Kurz
On Fri, 14 Oct 2022 10:51:36 +0200 Paolo Bonzini wrote: > On 10/14/22 08:08, Greg Kurz wrote: > > > > +need_to_open_file = log_flags && !per_thread; > > Pre-existing, but I think this should check log_per_thread instead of > per_thread. > Yes I agree, and also check qemu_loglevel ins

Re: [PATCH] util/log: Always send errors to logfile when daemonized

2022-10-14 Thread Paolo Bonzini
On 10/14/22 08:08, Greg Kurz wrote: +need_to_open_file = log_flags && !per_thread; Pre-existing, but I think this should check log_per_thread instead of per_thread. +} else if (filename) { +/* + * If we are daemonized, we will only log if there is a filename. +

[PATCH] util/log: Always send errors to logfile when daemonized

2022-10-13 Thread Greg Kurz
When QEMU is started with `-daemonize`, all stdio descriptors get redirected to `/dev/null`. This basically means that anything printed with `error_report()` and friends is lost. One could hope that passing `-D ${logfile}` would cause the messages to go to `${logfile}`, as the documentation tends