From 4a8837389ef28554a57cdad8e2fc90ae1362dcb2 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Tue, 17 Mar 2020 12:54:49 +0100 Subject: qapi: Replace qmp_dispatch()'s TODO comment by an explanation Signed-off-by: Markus Armbruster Message-Id: <20200317115459.31821-25-armbru@redhat.com> Reviewed-by: Eric Blake --- qapi/qmp-dispatch.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'qapi/qmp-dispatch.c') 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()); } -- cgit v1.2.3-55-g7522