qemu-e2k/util
Greg Kurz 479b350ebf util/log: Make the per-thread flag immutable
Per-thread logging was implemented under the assumption that once
enabled, it is not possible to switch back to single file logging.
This isn't enforced though and it is possible to go through the
global file opening sequence in per-thread mode. The code isn't
ready for this and produces unexpected results as detailed below.

Start QEMU in system emulation mode with `-D ./qemu.log.%d -d tid`
and then change the log level from the monitor to something that
doesn't have tid, e.g. `log cpu_reset`. The value of log_flags
is zero and per_thread is set to false : the rest of the code
then assumes it is running in the global log case and opens a
file named `qemu.log.%d`, which is obviously not an expected
behavior.

Enforce the immutability of the flag early in qemu_set_log_internal()
so that its value is correct for all subsequent users.

Fixes: 4e51069d67 ("util/log: Support per-thread log files")
Cc: richard.henderson@linaro.org
Signed-off-by: Greg Kurz <groug@kaod.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20221104120059.678470-2-groug@kaod.org
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2022-11-07 16:00:02 -05:00
..
aio-posix.c util/event-loop-base: Introduce options to set the thread pool size 2022-05-09 10:43:23 +01:00
aio-posix.h aio-posix: fix spurious ->poll_ready() callbacks in main loop 2022-03-17 11:23:18 +00:00
aio-wait.c aio_wait_kick: add missing memory barrier 2022-06-24 17:07:06 +02:00
aio-win32.c util/aio-win32: Correct the event array size in aio_poll() 2022-11-06 09:48:26 +01:00
aiocb.c
async-teardown.c os-posix: asynchronous teardown for shutdown on Linux 2022-10-31 09:46:34 +01:00
async.c replay: notify vCPU when BH is scheduled 2022-06-06 09:26:53 +02:00
atomic64.c osdep: Move memalign-related functions to their own header 2022-03-07 13:16:49 +00:00
base64.c
bitmap.c Replace config-time define HOST_WORDS_BIGENDIAN 2022-04-06 10:50:37 +02:00
bitops.c
block-helpers.c
block-helpers.h
buffer.c
bufferiszero.c cpuid: use unsigned for max cpuid 2022-02-04 09:07:43 -05:00
cacheflush.c util/cacheflush: Optimize flushing when ppc host has coherent icache 2022-06-21 09:28:41 -07:00
compatfd.c util: replace pipe()+cloexec with g_unix_open_pipe() 2022-05-03 15:18:14 +04:00
coroutine-sigaltstack.c Remove qemu-common.h include from most units 2022-04-06 14:31:55 +02:00
coroutine-ucontext.c coroutine-ucontext: use QEMU_DEFINE_STATIC_CO_TLS() 2022-05-04 15:55:23 +02:00
coroutine-win32.c coroutine-win32: use QEMU_DEFINE_STATIC_CO_TLS() 2022-05-04 15:55:23 +02:00
crc32c.c
crc-ccitt.c
cutils.c cutils: Add missing dyld(3) include on macOS 2022-08-12 11:33:52 +01:00
dbus.c
drm.c
envlist.c Use g_new() & friends where that makes obvious sense 2022-03-21 15:44:44 +01:00
error-report.c error-report: fix g_date_time_format assertion 2022-04-28 08:51:56 +02:00
error.c
event_notifier-posix.c Replace qemu_pipe() with g_unix_open_pipe() 2022-05-03 15:17:56 +04:00
event_notifier-win32.c Remove qemu-common.h include from most units 2022-04-06 14:31:55 +02:00
fdmon-epoll.c
fdmon-io_uring.c aio-posix: fix build failure io_uring 2.2 2022-03-17 11:23:18 +00:00
fdmon-poll.c
fifo8.c
filemonitor-inotify.c
filemonitor-stub.c
getauxval.c
guest-random.c
hbitmap.c block: simplify handling of try to merge different sized bitmaps 2022-06-24 17:07:06 +02:00
hexdump.c include: move C/util-related declarations to cutils.h 2022-04-06 14:31:43 +02:00
host-utils.c host-utils: Implemented signed 256-by-128 division 2022-06-20 08:38:58 -03:00
id.c
int128.c qemu/int128: addition of div/rem 128-bit operations 2022-01-08 15:46:10 +10:00
iov.c util: make do_send_recv work with partial send/recv 2022-10-12 19:22:01 +04:00
iova-tree.c util: accept iova_tree_remove_parameter by value 2022-09-02 10:22:39 +08:00
keyval.c include: add qemu/keyval.h 2022-04-21 17:03:51 +04:00
lockcnt.c
log.c util/log: Make the per-thread flag immutable 2022-11-07 16:00:02 -05:00
main-loop.c util/main-loop: Avoid adding the same HANDLE twice 2022-11-06 09:48:26 +01:00
memalign.c osdep: Move memalign-related functions to their own header 2022-03-07 13:16:49 +00:00
memfd.c
meson.build * bug fixes 2022-11-03 10:54:37 -04:00
mmap-alloc.c util/mmap-alloc: Remove qemu_mempath_getpagesize() 2022-08-26 13:34:21 +02:00
module.c module: add Error arguments to module_load and module_load_qom 2022-11-06 09:48:50 +01:00
notify.c
nvdimm-utils.c
osdep.c tests/qtest: Use send/recv for socket communication 2022-10-28 11:17:12 +02:00
oslib-posix.c util: Make qemu_prealloc_mem() optionally consume a ThreadContext 2022-10-27 11:00:56 +02:00
oslib-win32.c util: Make qemu_prealloc_mem() optionally consume a ThreadContext 2022-10-27 11:00:56 +02:00
path.c
qdist.c
qemu-co-shared-resource.c
qemu-co-timeout.c util: add qemu-co-timeout 2022-06-29 10:56:12 +03:00
qemu-config.c s390x/s390-virtio-ccw: add zpcii-disable machine property 2022-09-26 17:23:47 +02:00
qemu-coroutine-io.c Remove qemu-common.h include from most units 2022-04-06 14:31:55 +02:00
qemu-coroutine-lock.c coroutine: add flag to re-queue at front of CoQueue 2022-10-26 14:56:42 -04:00
qemu-coroutine-sleep.c
qemu-coroutine.c coroutine: remove incorrect coroutine_fn annotations 2022-10-07 12:11:40 +02:00
qemu-option.c qemu-option: Allow deleting opts during qemu_opts_foreach() 2021-10-15 16:11:22 +02:00
qemu-print.c
qemu-progress.c include: move progress API to qemu-progress.h 2022-04-06 14:31:43 +02:00
qemu-sockets.c -----BEGIN PGP SIGNATURE----- 2022-10-30 18:30:01 -04:00
qemu-thread-common.h
qemu-thread-posix.c util: Introduce qemu_thread_set_affinity() and qemu_thread_get_affinity() 2022-10-27 11:00:36 +02:00
qemu-thread-win32.c util: Introduce qemu_thread_set_affinity() and qemu_thread_get_affinity() 2022-10-27 11:00:36 +02:00
qemu-timer-common.c
qemu-timer.c qemu-timer: Skip empty timer lists before locking in qemu_clock_deadline_ns_all 2022-06-21 09:24:34 -07:00
qht.c osdep: Move memalign-related functions to their own header 2022-03-07 13:16:49 +00:00
qsp.c
range.c
rcu.c rcu: use coroutine TLS macros 2022-03-04 18:14:40 +01:00
readline.c
selfmap.c util/selfmap: Discard mapping on error 2021-07-26 07:06:49 -10:00
stats64.c
sys_membarrier.c
systemd.c
thread-context.c util: Add write-only "node-affinity" property for ThreadContext 2022-10-27 11:00:50 +02:00
thread-pool.c thread-pool: remove stopping variable 2022-05-25 21:26:26 +02:00
throttle.c
timed-average.c
trace-events
trace.h
transactions.c transactions: Invoke clean() after everything else 2021-11-16 09:43:44 +01:00
unicode.c
uri.c
userfaultfd.c
uuid.c
vfio-helpers.c numa: call ->ram_block_removed() in ram_block_notifer_remove() 2022-10-26 14:56:42 -04:00
vhost-user-server.c util: rename qemu_*block() socket functions 2022-05-03 15:53:20 +04:00
yank.c