qemu/tests
Stefan Hajnoczi 4b02c718b5 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:37 +03:00
..
avocado tests/avocado: Replace assertRegexpMatches() for Python 3.12 compatibility 2023-11-29 15:35:38 +03:00
bench migration/xbzrle: Use i386 host/cpuinfo.h 2023-05-23 16:51:18 -07:00
data tests: acpi: update expected blobs 2023-08-03 16:06:49 -04:00
decode decodetree: Add --output-null for meson testing 2023-05-31 19:56:42 -07:00
docker tests/docker: avoid invalid escape in Python string 2023-10-19 14:52:59 +03:00
fp tests: fp: remove unused submodules 2023-06-07 11:05:09 +02:00
guest-debug tests/tcg: ensure system-mode gdb tests start stopped 2023-08-10 11:04:34 -07:00
image-fuzzer
include
keys
lcitool tests/lcitool: Generate distribution packages list in JSON format 2023-07-18 09:36:28 +02:00
migration tests/migration: Add -fno-stack-protector 2023-08-01 23:52:23 +02:00
multiboot
perf/block/qcow2
plugin plugins: fix memory leak while parsing options 2023-07-03 12:51:58 +01:00
qapi-schema qapi: Improve error message for description following section 2023-05-22 10:03:26 +02:00
qemu-iotests monitor: only run coroutine commands in qemu_aio_context 2024-01-26 19:31:37 +03:00
qtest tests/qtest/virtio-ccw: Fix device presence checking 2024-01-13 11:18:43 +03:00
rocker
tcg target/arm: Handle overflow in calculation of next timer tick 2023-12-05 12:32:36 +03:00
tsan
uefi-test-tools
unit util/uuid: Add UUID_STR_LEN definition 2023-11-09 16:39:13 +03:00
vm tests/vm: avoid invalid escape in Python string 2023-10-19 14:52:59 +03:00
vmstate-static-checker-data
dbus-vmstate-daemon.sh
Makefile.include tests: Use separate virtual environment for avocado 2023-06-06 16:29:53 +02:00
meson.build tests/decode: Convert tests to meson 2023-05-30 10:55:39 -07:00
requirements.txt tests: Use separate virtual environment for avocado 2023-06-06 16:29:53 +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