From bb4b9ead95c3aaca84823e28dd9f11ccaa875c14 Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Mon, 5 Oct 2020 17:58:51 +0200 Subject: hmp: Add support for coroutine command handlers Often, QMP command handlers are not only called to handle QMP commands, but also from a corresponding HMP command handler. In order to give them a consistent environment, optionally run HMP command handlers in a coroutine, too. The implementation is a lot simpler than in QMP because for HMP, we still block the VM while the coroutine is running. Signed-off-by: Kevin Wolf Reviewed-by: Dr. David Alan Gilbert Message-Id: <20201005155855.256490-11-kwolf@redhat.com> Reviewed-by: Markus Armbruster Reviewed-by: Stefan Hajnoczi Signed-off-by: Markus Armbruster --- docs/devel/qapi-code-gen.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/devel/qapi-code-gen.txt b/docs/devel/qapi-code-gen.txt index 4a41e36a75..c6438c6aa9 100644 --- a/docs/devel/qapi-code-gen.txt +++ b/docs/devel/qapi-code-gen.txt @@ -617,8 +617,8 @@ pitfalls are: Since the command handler may assume coroutine context, any callers other than the QMP dispatcher must also call it in coroutine context. -In particular, HMP commands calling such a QMP command handler must -enter coroutine context before calling the handler. +In particular, HMP commands calling such a QMP command handler must be +marked .coroutine = true in hmp-commands.hx. It is an error to specify both 'coroutine': true and 'allow-oob': true for a command. We don't currently have a use case for both together and -- cgit v1.2.3