qemu/tests
Emanuele Giuseppe Esposito d05ab380db block: Mark drain related functions GRAPH_RDLOCK
Draining recursively traverses the graph, therefore we need to make sure
that also such accesses to the graph are protected by the graph rdlock.

There are 3 different drain callers to consider:
1. drain in the main loop: no issue at all, rdlock is nop.
2. drain in an iothread: rdlock only works in main loop or coroutines,
   so disallow it.
3. drain in a coroutine (regardless of AioContext): the drain mechanism
   takes care of scheduling a BH in the bs->aio_context that will
   then take care of perform the actual draining. This is wrong,
   because as pointed in (2) if bs->aio_context is an iothread then
   rdlock won't work. Therefore change bdrv_co_yield_to_drain to
   schedule the BH in the main loop.

Caller (2) also implies that we need to modify test-bdrv-drain.c to
disallow draining in the iothreads.

For some places, we know that they will hold the lock, but we don't have
the GRAPH_RDLOCK annotations yet. In this case, add assume_graph_lock()
with a FIXME comment. These places will be removed once everything is
properly annotated.

Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-ID: <20230929145157.45443-6-kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2023-10-12 16:31:33 +02:00
..
avocado tests/avocado: remove flaky test marking for test_sbsaref_edk2_firmware 2023-10-11 08:46:23 +01:00
bench
data tests/acpi: update expected data files 2023-10-10 11:11:37 +02:00
decode tests/: spelling fixes 2023-09-08 13:08:52 +03:00
docker tests/docker: make docker engine choice entirely configure driven 2023-10-11 08:46:33 +01:00
fp
guest-debug tests/tcg: clean-up gdb confirm/pagination settings 2023-08-30 14:57:50 +01:00
image-fuzzer
include
keys
lcitool tests/lcitool: add swtpm to the package list 2023-10-11 08:46:23 +01:00
migration s390x/a-b-bios: zero the first byte of each page on start 2023-10-04 11:48:18 +02:00
multiboot
perf/block/qcow2
plugin Makefile: build plugins before running TCG tests 2023-10-02 18:04:39 +02:00
qapi-schema tests/: spelling fixes 2023-09-08 13:08:52 +03:00
qemu-iotests nbd/server: Add FLAG_PAYLOAD support to CMD_BLOCK_STATUS 2023-10-05 11:02:08 -05:00
qtest tests/qtest: migration: Add support for negative testing of qmp_migrate 2023-10-11 11:17:02 +02:00
rocker
tcg tcg: Correct invalid mentions of 'softmmu' by 'system-mode' 2023-10-07 19:02:33 +02:00
tsan tests/: spelling fixes 2023-09-08 13:08:52 +03:00
uefi-test-tools tests/: spelling fixes 2023-09-08 13:08:52 +03:00
unit block: Mark drain related functions GRAPH_RDLOCK 2023-10-12 16:31:33 +02:00
vm tests/: spelling fixes 2023-09-08 13:08:52 +03:00
vmstate-static-checker-data
dbus-vmstate-daemon.sh
Makefile.include Makefile: build plugins before running TCG tests 2023-10-02 18:04:39 +02: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