qemu/system
Phil Dennis-Jordan e7bc0204e5 system/runstate: Fix regression, clarify BQL status of exit notifiers
By changing the way the main QEMU event loop is invoked, I inadvertently
changed the BQL status of exit notifiers: some of them implicitly
assumed they would be called with the BQL held; the BQL is however
not held during the exit(status) call in qemu_default_main().

Instead of attempting to ensuring we always call exit() from the BQL -
including any transitive calls - this change adds a BQL lock guard to
qemu_run_exit_notifiers, ensuring the BQL will always be held in the
exit notifiers.

Additionally, the BQL promise is now documented at the
qemu_{add,remove}_exit_notifier() declarations.

Fixes: f5ab12caba ("ui & main loop: Redesign of system-specific main
thread event handling")
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2771
Reported-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Phil Dennis-Jordan <phil@philjordan.eu>
Tested-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
2025-01-15 18:05:19 +00:00
..
arch_init.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
async-teardown.c qemu/osdep: Add excluded fd parameter to qemu_close_all_open_fd() 2024-08-05 08:21:59 +10:00
balloon.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
bootdevice.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
cpu-timers.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
cpus.c Accel & Exec patch queue 2024-12-21 11:07:00 -05:00
datadir.c system: Rename softmmu/ directory as system/ 2023-10-08 21:08:08 +02:00
device_tree-stub.c kconfig: allow compiling out QEMU device tree code per target 2024-05-10 15:45:15 +02:00
device_tree.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
dirtylimit.c system/dirtylimit: Don't use migration_is_active() 2024-12-26 07:23:38 +01:00
dma-helpers.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
globals.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
ioport.c qdev: Use machine_get_container() 2025-01-09 18:16:24 +01:00
main.c ui & main loop: Redesign of system-specific main thread event handling 2024-12-31 21:21:34 +01:00
memory.c qdev: Use machine_get_container() 2025-01-09 18:16:24 +01:00
memory_ldst.c.inc system: Move memory_ldst.c.inc to system 2024-02-13 10:59:25 +03:00
memory_mapping.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
meson.build migration: Move cpu-throttle.c from system to migration 2024-10-31 15:48:18 -04:00
physmem.c accel/tcg: Include missing 'exec/translation-block.h' header 2024-12-20 17:44:57 +01:00
qdev-monitor.c hw/qdev: Check machine_hotplug_handler in hotplug_unplug_allowed_common 2025-01-13 17:16:03 +01:00
qemu-seccomp.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
qtest.c system/qtest: properly feedback results of clock_[step|set] 2025-01-10 11:18:32 +00:00
rtc.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
runstate-action.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
runstate-hmp-cmds.c system: Rename softmmu/ directory as system/ 2023-10-08 21:08:08 +02:00
runstate.c system/runstate: Fix regression, clarify BQL status of exit notifiers 2025-01-15 18:05:19 +00:00
tpm-hmp-cmds.c system: Rename softmmu/ directory as system/ 2023-10-08 21:08:08 +02:00
tpm.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
trace-events system/dma-helpers.c: Move trace events to system/trace-events 2024-11-19 14:14:13 +00:00
trace.h system: Rename softmmu/ directory as system/ 2023-10-08 21:08:08 +02:00
vl.c system: Inline machine_containers[] in qemu_create_machine_containers() 2025-01-09 18:16:27 +01:00
watchpoint.c system/watchpoint: Move TCG specific code to accel/tcg/ 2024-01-19 12:28:59 +01:00