Re: [PATCH] util/log: do not close and reopen log files when flags are turned off

2022-10-26 Thread Greg Kurz
On Tue, 25 Oct 2022 22:27:36 +0200 Paolo Bonzini wrote: > Il mar 25 ott 2022, 16:39 Greg Kurz ha scritto: > > > > > -if (logfile && (!need_to_open_file || changed_name)) { > > > > -qatomic_rcu_set(_file, NULL); > > > > Hmm... wait, shouldn't this NULLifying be performed... > > > >

Re: [PATCH] util/log: do not close and reopen log files when flags are turned off

2022-10-25 Thread Paolo Bonzini
Il mar 25 ott 2022, 16:39 Greg Kurz ha scritto: > > > -if (logfile && (!need_to_open_file || changed_name)) { > > > -qatomic_rcu_set(_file, NULL); > > Hmm... wait, shouldn't this NULLifying be performed... > > > > -if (logfile != stderr) { > > > +if (logfile) { > > > +

Re: [PATCH] util/log: do not close and reopen log files when flags are turned off

2022-10-25 Thread Greg Kurz
On Tue, 25 Oct 2022 14:33:15 +0200 Greg Kurz wrote: > On Tue, 25 Oct 2022 11:21:19 +0200 > Paolo Bonzini wrote: > > > log_append makes sure that if you turn off the logging (which clears > > log_flags and makes need_to_open_file false) the old log is not > > overwritten. The usecase is that

Re: [PATCH] util/log: do not close and reopen log files when flags are turned off

2022-10-25 Thread Greg Kurz
On Tue, 25 Oct 2022 11:21:19 +0200 Paolo Bonzini wrote: > log_append makes sure that if you turn off the logging (which clears > log_flags and makes need_to_open_file false) the old log is not > overwritten. The usecase is that if you remove or move the file > QEMU will not keep writing to the

Re: [PATCH] util/log: do not close and reopen log files when flags are turned off

2022-10-25 Thread Richard Henderson
On 10/25/22 19:21, Paolo Bonzini wrote: log_append makes sure that if you turn off the logging (which clears log_flags and makes need_to_open_file false) the old log is not overwritten. The usecase is that if you remove or move the file QEMU will not keep writing to the old file. However, this

[PATCH] util/log: do not close and reopen log files when flags are turned off

2022-10-25 Thread Paolo Bonzini
log_append makes sure that if you turn off the logging (which clears log_flags and makes need_to_open_file false) the old log is not overwritten. The usecase is that if you remove or move the file QEMU will not keep writing to the old file. However, this is not always the desited behavior, in