qemu/tests
Stefan Hajnoczi f389309d29 monitor: only run coroutine commands in qemu_aio_context
monitor_qmp_dispatcher_co() runs in the iohandler AioContext that is not
polled during nested event loops. The coroutine currently reschedules
itself in the main loop's qemu_aio_context AioContext, which is polled
during nested event loops. One known problem is that QMP device-add
calls drain_call_rcu(), which temporarily drops the BQL, leading to all
sorts of havoc like other vCPU threads re-entering device emulation code
while another vCPU thread is waiting in device emulation code with
aio_poll().

Paolo Bonzini suggested running non-coroutine QMP handlers in the
iohandler AioContext. This avoids trouble with nested event loops. His
original idea was to move coroutine rescheduling to
monitor_qmp_dispatch(), but I resorted to moving it to qmp_dispatch()
because we don't know if the QMP handler needs to run in coroutine
context in monitor_qmp_dispatch(). monitor_qmp_dispatch() would have
been nicer since it's associated with the monitor implementation and not
as general as qmp_dispatch(), which is also used by qemu-ga.

A number of qemu-iotests need updated .out files because the order of
QMP events vs QMP responses has changed.

Solves Issue #1933.

Cc: qemu-stable@nongnu.org
Fixes: 7bed89958b ("device_core: use drain_call_rcu in in qmp_device_add")
Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=2215192
Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=2214985
Buglink: https://issues.redhat.com/browse/RHEL-17369
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-ID: <20240118144823.1497953-4-stefanha@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Tested-by: Fiona Ebner <f.ebner@proxmox.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit effd60c878)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2024-01-26 19:31:33 +03:00
..
avocado acpi/tests/avocado/bits: wait for 200 seconds for SHUTDOWN event from bits VM 2024-01-24 11:39:00 +03:00
bench migration/xbzrle: Use i386 host/cpuinfo.h 2023-05-23 16:51:18 -07:00
data tests/acpi: update expected data files 2024-01-12 17:23:21 +03:00
decode tests/: spelling fixes 2023-09-08 13:08:52 +03:00
docker tests/docker: merge debian-native with debian-amd64 2023-11-23 14:10:04 +00:00
fp tests: fp: remove unused submodules 2023-06-07 11:05:09 +02:00
guest-debug tests/tcg: clean-up gdb confirm/pagination settings 2023-08-30 14:57:50 +01:00
image-fuzzer
include
keys
lcitool .gitlab-ci.d/cirrus: Add manual testing of macOS 14 (Sonoma) 2023-11-24 16:21:55 +01:00
migration tests/migration: Introduce dirty-limit into guestperf 2023-11-03 07:48:25 +01:00
multiboot
perf/block/qcow2
plugin plugins: fix win plugin tests on cross compile 2023-11-23 14:10:04 +00:00
qapi-schema tests/qapi-schema: Tidy up pylint warnings and advice 2023-11-13 10:36:51 +01:00
qemu-iotests monitor: only run coroutine commands in qemu_aio_context 2024-01-26 19:31:33 +03:00
qtest tests/qtest/virtio-ccw: Fix device presence checking 2024-01-13 11:18:30 +03:00
rocker
tcg target/arm: Handle overflow in calculation of next timer tick 2023-11-27 15:27:36 +00:00
tsan tests/tsan: Rename the file with the entries that should be ignored 2023-11-13 11:35:47 +01:00
uefi-test-tools tests/: spelling fixes 2023-09-08 13:08:52 +03:00
unit block: Fix deadlocks in bdrv_graph_wrunlock() 2023-11-21 12:45:21 +01:00
vm tests/vm/netbsd: Use Python v3.11 2023-11-13 11:35:47 +01:00
vmstate-static-checker-data hw: Replace anti-social QOM type names 2021-03-19 15:18:43 +01:00
dbus-vmstate-daemon.sh
Makefile.include tests: respect --enable/--disable-download for Avocado 2023-11-24 12:07:47 +01:00
meson.build Makefile: build plugins before running TCG tests 2023-10-02 18:04:39 +02:00
test-qht-par.c
vhost-user-bridge.c error handling: Use RETRY_ON_EINTR() macro where applicable 2023-01-09 13:50:47 +01:00