qemu-e2k/monitor
Stefan Reiter a67b996e78 monitor/qmp: fix race on CHR_EVENT_CLOSED without OOB
The QMP dispatcher coroutine holds the qmp_queue_lock over a yield
point, where it expects to be rescheduled from the main context. If a
CHR_EVENT_CLOSED event is received just then, it can race and block the
main thread on the mutex in monitor_qmp_cleanup_queue_and_resume.

monitor_resume does not need to be called from main context, so we can
call it immediately after popping a request from the queue, which allows
us to drop the qmp_queue_lock mutex before yielding.

Suggested-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
Message-Id: <20210322154024.15011-1-s.reiter@proxmox.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Markus Armbruster <armbru@redhat.com>
2021-05-12 17:29:11 +02:00
..
hmp-cmds.c hmp: QAPIfy object_add 2021-03-19 10:17:14 +01:00
hmp.c machine: introduce MachineInitPhase 2020-12-15 12:51:52 -05:00
meson.build meson: add spice_headers dependency. 2020-10-15 11:14:40 +02:00
misc.c Do not include cpu.h if it's not really necessary 2021-05-02 17:24:51 +02:00
monitor-internal.h monitor: Drop query-qmp-schema 'gen': false hack 2021-03-19 16:05:09 +01:00
monitor.c Do not include sysemu/sysemu.h if it's not really necessary 2021-05-02 17:24:50 +02:00
qmp-cmds-control.c qapi: Implement deprecated-output=hide for QMP introspection 2021-03-19 16:05:11 +01:00
qmp-cmds.c qmp: add new qmp display-reload 2021-03-23 08:48:21 +01:00
qmp.c monitor/qmp: fix race on CHR_EVENT_CLOSED without OOB 2021-05-12 17:29:11 +02:00
trace-events qmp: Add more tracepoints 2021-02-04 13:20:29 +01:00
trace.h trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00