qemu/stubs
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
..
bdrv-next-monitor-owned.c
blk-commit-all.c
blk-exp-close-all.c
blockdev-close-all-bdrv-states.c
change-state-handler.c
cmos.c
cpu-get-clock.c
cpu-synchronize-state.c
cpus-get-virtual-clock.c
dump.c
error-printf.c
fdset.c
fw_cfg.c
gdbstub.c
get-vm-name.c
icount.c
io_uring.c
iothread-lock-block.c main-loop.h: introduce qemu_in_main_thread() 2022-03-04 18:18:15 +01:00
iothread-lock.c async: the main AioContext is only "current" if under the BQL 2021-06-18 10:59:52 -05:00
is-daemonized.c
isa-bus.c
linux-aio.c
meson.build main-loop.h: introduce qemu_in_main_thread() 2022-03-04 18:18:15 +01:00
migr-blocker.c
module-opts.c modules: use modinfo for qemu opts load 2021-07-09 18:20:27 +02:00
monitor-core.c
monitor.c
pci-bus.c
qdev.c qapi/qdev.json: add DEVICE_UNPLUG_GUEST_ERROR QAPI event 2021-09-30 12:25:51 +10:00
qemu-timer-notify-cb.c
qmp_memory_device.c
qmp-command-available.c
qmp-quit.c chardev: don't exit() straight away on C-a x 2021-11-04 10:32:01 +00:00
qtest.c
ram-block.c
ramfb.c
replay-tools.c
replay.c
runstate-check.c
semihost.c Do not include sysemu/sysemu.h if it's not really necessary 2021-05-02 17:24:50 +02:00
sysbus.c
target-get-monitor-def.c
target-monitor-defs.c
trace-control.c
usb-dev-stub.c qapi: introduce x-query-usb QMP command 2021-11-02 15:55:14 +00:00
uuid.c
vm-stop.c
vmgenid.c
vmstate.c cpu: Move CPUClass::vmsd to SysemuCPUOps 2021-05-26 15:33:59 -07:00
win32-kbd-hook.c
xen-hw-stub.c