qemu/softmmu
Emanuele Giuseppe Esposito 6538692e28 main-loop.h: introduce qemu_in_main_thread()
When invoked from the main loop, this function is the same
as qemu_mutex_iothread_locked, and returns true if the BQL is held.
When invoked from iothreads or tests, it returns true only
if the current AioContext is the Main Loop.

This essentially just extends qemu_mutex_iothread_locked to work
also in unit tests or other users like storage-daemon, that run
in the Main Loop but end up using the implementation in
stubs/iothread-lock.c.

Using qemu_mutex_iothread_locked in unit tests defaults to false
because they use the implementation in stubs/iothread-lock,
making all assertions added in next patches fail despite the
AioContext is still the main loop.

See the comment in the function header for more information.

Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Message-Id: <20220303151616.325444-2-eesposit@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2022-03-04 18:18:15 +01:00
..
arch_init.c meson.build: Define QEMU_ARCH in config-target.h 2021-08-26 17:02:00 +01:00
balloon.c qapi: Restrict balloon-related commands to machine code 2020-09-29 15:41:35 +02:00
bootdevice.c softmmu: move more files to softmmu/ 2020-10-12 11:50:21 -04:00
cpu-throttle.c cpu-throttle: Remove timer_mod() from cpu_throttle_set() 2021-02-08 15:15:32 +01:00
cpu-timers.c icount: get rid of static variable 2021-04-01 09:40:45 +02:00
cpus.c main-loop.h: introduce qemu_in_main_thread() 2022-03-04 18:18:15 +01:00
datadir.c vl: extract softmmu/datadir.c 2020-12-10 12:15:18 -05:00
device_tree.c softmmu/device_tree: Remove redundant pointer assignment 2022-01-21 15:52:56 +10:00
dma-helpers.c exec/memory: Extract address_space_set() from dma_memory_set() 2022-01-20 09:09:37 +01:00
globals.c qmp: generalize watchdog-set-action to -no-reboot/-no-shutdown 2020-12-15 12:51:57 -05:00
icount.c icount: get rid of static variable 2021-04-01 09:40:45 +02:00
ioport.c softmmu: Add missing trace-events file 2020-09-09 17:15:18 +01:00
main.c meson: move SDL and SDL-image detection to meson 2020-08-21 06:30:44 -04:00
memory.c memory: Fix qemu crash on starting dirty log twice with stopped VM 2022-02-16 15:01:33 +01:00
memory_mapping.c softmmu/memory_mapping: optimize for RamDiscardManager sections 2021-10-02 08:43:22 +02:00
meson.build configure, meson: move TPM check to meson 2022-02-21 10:35:53 +01:00
physmem.c include: Move qemu_madvise() and related #defines to new qemu/madvise.h 2022-02-21 13:30:20 +00:00
qdev-monitor.c pci,pc,virtio: bugfixes 2021-11-15 21:56:15 +01:00
qemu-seccomp.c seccomp: block setns, unshare and execveat syscalls 2022-02-16 18:52:40 +00:00
qtest.c qtest: Add missing 'hw/qdev-core.h' include 2022-02-21 10:18:06 +01:00
rtc.c rtc: Move RTC function prototypes to their own header 2022-01-28 14:29:46 +00:00
runstate-action.c runstate: cleanup reboot and panic actions 2021-01-21 13:00:41 +01:00
runstate.c exec/exec-all: Move 'qemu/log.h' include in units requiring it 2022-02-21 10:18:06 +01:00
timers-state.h qemu/atomic: Add aligned_{int64,uint64}_t types 2021-07-21 07:45:38 -10:00
tpm.c qapi: More complex uses of QAPI_LIST_APPEND 2021-01-28 08:08:45 +01:00
trace-events memory: make global_dirty_tracking a bitmask 2021-11-01 22:56:43 +01:00
trace.h softmmu: Add missing trace-events file 2020-09-09 17:15:18 +01:00
vl.c include: Move hardware version declarations to new qemu/hw-version.h 2022-02-21 13:30:20 +00:00