diff mbox series

[v4,24/34] qapi: Replace qmp_dispatch()'s TODO comment by an explanation

Message ID 20200317115459.31821-25-armbru@redhat.com (mailing list archive)
State New, archived
Headers show
Series Configurable policy for handling deprecated interfaces | expand

Commit Message

Markus Armbruster March 17, 2020, 11:54 a.m. UTC
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 qapi/qmp-dispatch.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Eric Blake March 17, 2020, 8:29 p.m. UTC | #1
On 3/17/20 6:54 AM, Markus Armbruster wrote:
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>   qapi/qmp-dispatch.c | 6 +++++-
>   1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/qapi/qmp-dispatch.c b/qapi/qmp-dispatch.c
> index 91e50fa0dd..44fc368d61 100644
> --- a/qapi/qmp-dispatch.c
> +++ b/qapi/qmp-dispatch.c
> @@ -162,7 +162,11 @@ QDict *qmp_dispatch(QmpCommandList *cmds, QObject *request,
>           g_assert(!ret);
>           return NULL;
>       } else if (!ret) {
> -        /* TODO turn into assertion */
> +        /*
> +         * When the command's schema has no 'returns', cmd->fn()
> +         * leaves @ret null.  The QMP spec calls for an empty object
> +         * then; supply it.
> +         */
>           ret = QOBJECT(qdict_new());
>       }

Reviewed-by: Eric Blake <eblake@redhat.com>
diff mbox series

Patch

diff --git a/qapi/qmp-dispatch.c b/qapi/qmp-dispatch.c
index 91e50fa0dd..44fc368d61 100644
--- a/qapi/qmp-dispatch.c
+++ b/qapi/qmp-dispatch.c
@@ -162,7 +162,11 @@  QDict *qmp_dispatch(QmpCommandList *cmds, QObject *request,
         g_assert(!ret);
         return NULL;
     } else if (!ret) {
-        /* TODO turn into assertion */
+        /*
+         * When the command's schema has no 'returns', cmd->fn()
+         * leaves @ret null.  The QMP spec calls for an empty object
+         * then; supply it.
+         */
         ret = QOBJECT(qdict_new());
     }