qemu-e2k/qapi
Stefan Hajnoczi 1f25c172f8 monitor: use aio_co_reschedule_self()
The aio_co_reschedule_self() API is designed to avoid the race
condition between scheduling the coroutine in another AioContext and
yielding.

The QMP dispatch code uses the open-coded version that appears
susceptible to the race condition at first glance:

  aio_co_schedule(qemu_get_aio_context(), qemu_coroutine_self());
  qemu_coroutine_yield();

The code is actually safe because the iohandler and qemu_aio_context
AioContext run under the Big QEMU Lock. Nevertheless, set a good example
and use aio_co_reschedule_self() so it's obvious that there is no race.

Suggested-by: Hanna Reitz <hreitz@redhat.com>
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Reviewed-by: Hanna Czenczek <hreitz@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-ID: <20240206190610.107963-6-stefanha@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Acked-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2024-02-07 14:44:21 +01:00
..
acpi.json
audio.json audio/pw: Pipewire->PipeWire case fix for user-visible text 2023-07-17 15:22:56 +04:00
authz.json
block-core.json qga: Move type description right after type name 2024-02-03 09:20:24 +01:00
block-export.json qapi: Elide "Potential additional modes" from generated docs 2024-02-03 09:20:01 +01:00
block.json qapi: Reformat recent doc comments to conform to current conventions 2023-07-26 14:51:36 +02:00
char.json qapi: Indent tagged doc comment sections properly 2024-01-26 07:04:53 +01:00
common.json
compat.json qapi: Belatedly update CompatPolicy documentation for unstable 2023-10-19 07:02:29 +02:00
control.json
crypto.json
cryptodev.json spelling: information 2023-06-09 23:38:16 +03:00
cxl.json qapi: Reformat recent doc comments to conform to current conventions 2023-07-26 14:51:36 +02:00
dump.json dump: Add command interface for kdump-raw formats 2023-11-02 18:40:37 +04:00
error.json
introspect.json qapi: Drop redundant documentation of inherited members 2024-02-03 09:19:25 +01:00
job.json blockjob: introduce block-job-change QMP command 2023-10-31 18:20:25 +01:00
machine-common.json CPU topology: extend with s390 specifics 2023-10-20 07:16:53 +02:00
machine-target.json qapi,risc-v: add query-cpu-model-expansion 2023-11-07 11:06:01 +10:00
machine.json qapi: Indent tagged doc comment sections properly 2024-01-26 07:04:53 +01:00
meson.build CPU topology: extend with s390 specifics 2023-10-20 07:16:53 +02:00
migration.json qapi/migration.json: Fix the member name for MigrationCapability 2024-01-30 21:20:20 +03:00
misc-target.json qapi: Drop redundant documentation of conditional 2024-02-03 09:19:55 +01:00
misc.json qapi: Indent tagged doc comment sections properly 2024-01-26 07:04:53 +01:00
net.json qapi: Fix mangled "Returns" sections in documentation 2024-01-26 07:04:53 +01:00
opts-visitor.c cutils: Adjust signature of parse_uint[_full] 2023-06-02 12:27:19 -05:00
pci.json
pragma.json qapi/pragma.json: Improve the comment about the lists of QAPI rule exceptions 2023-11-15 11:09:17 +03:00
qapi-clone-visitor.c
qapi-dealloc-visitor.c
qapi-forward-visitor.c
qapi-schema.json CPU topology: extend with s390 specifics 2023-10-20 07:16:53 +02:00
qapi-type-helpers.c
qapi-util.c qapi: Fix dangling references to docs/devel/qapi-code-gen.txt 2024-01-26 07:04:53 +01:00
qapi-visit-core.c
qdev.json qapi: Fix mangled "Returns" sections in documentation 2024-01-26 07:04:53 +01:00
qmp-dispatch.c monitor: use aio_co_reschedule_self() 2024-02-07 14:44:21 +01:00
qmp-event.c
qmp-registry.c
qobject-input-visitor.c
qobject-output-visitor.c
qom.json qapi: Fix mangled "Returns" sections in documentation 2024-01-26 07:04:53 +01:00
rdma.json
replay.json
rocker.json
run-state.json qapi: Remove deprecated 'singlestep' member of StatusInfo 2024-01-19 11:38:32 +01:00
sockets.json
stats.json
string-input-visitor.c
string-output-visitor.c string-output-visitor: Fix (pseudo) struct handling 2024-01-26 11:16:58 +01:00
tpm.json
trace-events
trace.h
trace.json qapi: Reformat recent doc comments to conform to current conventions 2023-07-26 14:51:36 +02:00
transaction.json
ui.json Make Pixman an optional dependency 2023-11-07 19:00:03 +08:00
virtio.json qdev: add IOThreadVirtQueueMappingList property type 2023-12-21 22:49:28 +01:00
yank.json qapi: Indent tagged doc comment sections properly 2024-01-26 07:04:53 +01:00