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
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
char.json qapi: Indent tagged doc comment sections properly 2024-01-26 07:04:53 +01:00
common.json
compat.json
control.json
crypto.json
cryptodev.json
cxl.json
dump.json
error.json
introspect.json qapi: Drop redundant documentation of inherited members 2024-02-03 09:19:25 +01:00
job.json
machine-common.json
machine-target.json
machine.json qapi: Indent tagged doc comment sections properly 2024-01-26 07:04:53 +01:00
meson.build
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
pci.json
pragma.json
qapi-clone-visitor.c
qapi-dealloc-visitor.c
qapi-forward-visitor.c
qapi-schema.json
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
transaction.json
ui.json
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