mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 09:43:56 -06:00
qmp: Move dispatcher to a coroutine
This moves the QMP dispatcher to a coroutine and runs all QMP command handlers that declare 'coroutine': true in coroutine context so they can avoid blocking the main loop while doing I/O or waiting for other events. For commands that are not declared safe to run in a coroutine, the dispatcher drops out of coroutine context by calling the QMP command handler from a bottom half. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20201005155855.256490-10-kwolf@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
This commit is contained in:
parent
04f22362f1
commit
9ce44e2ce2
7 changed files with 213 additions and 45 deletions
|
@ -20,6 +20,9 @@ void qmp_register_command(QmpCommandList *cmds, const char *name,
|
|||
{
|
||||
QmpCommand *cmd = g_malloc0(sizeof(*cmd));
|
||||
|
||||
/* QCO_COROUTINE and QCO_ALLOW_OOB are incompatible for now */
|
||||
assert(!((options & QCO_COROUTINE) && (options & QCO_ALLOW_OOB)));
|
||||
|
||||
cmd->name = name;
|
||||
cmd->fn = fn;
|
||||
cmd->enabled = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue