Skip to content

util/log: Always send errors to logfile when daemonized

Greg Kurz qemu-devel 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest2 patches 1 replyIn review
  2. v22 patches 11 repliesSuperseded
  3. v11 patch 3 repliesSuperseded

Changes in v3 from the cover letter

- drop log_append (Paolo's patch)
- new approach : call qemu_log_trylock() from qemu_set_log_internal() in the per-thread case, instead of trying to special case the main thread

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2util/log: do not close and reopen log files when flags are turned offutil/log.c+6 -80 replies
2/2util/log: Always send errors to logfile when daemonizedutil/log.c+53 -191 reply

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchRichard HendersonGreg Kurz
1/2R-b R-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/2] util/log: Always send errors to logfile when daemonized

When QEMU is started with --daemonize -D ${logfile} -d ${some_log_item}, error logs from error_report() and friends go to ${logfile}, but if QEMU is started with -daemonize -D ${logfile} and no -d, the file isn't even created and all logs go to /dev/null.

This inconsistency is quite confusing for users and gives the impression that QEMU doesn't log errors at all. It seems much saner to always create the log file when -D was passed and to be able to report errors.

It was spotted by the kata-containers project, which happens to do just that --daemonize -D without -d trick.

v3:
- drop log_append (Paolo's patch)
- new approach : call qemu_log_trylock() from qemu_set_log_internal() in the per-thread case, instead of trying to special case the main thread

v2:
- new log_thread_id() implementation for hosts without gettid() syscall
- avoid conflict between global log file and per-thread logfile
- style improvements

Greg Kurz (1):
util/log: Always send errors to logfile when daemonized

Paolo Bonzini (1):
util/log: do not close and reopen log files when flags are turned off

 util/log.c | 84 +++++++++++++++++++++++++++++++++++++-----------------
 1 file changed, 58 insertions(+), 26 deletions(-)
Signature · 1 line
2.38.1