From: Markus Armbruster Date: Tue, 17 Mar 2020 11:54:49 +0000 (+0100) Subject: qapi: Replace qmp_dispatch()'s TODO comment by an explanation X-Git-Tag: v5.0.0-rc0~23^2~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4a8837389ef28554a57cdad8e2fc90ae1362dcb2;p=thirdparty%2Fqemu.git 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 --- diff --git a/qapi/qmp-dispatch.c b/qapi/qmp-dispatch.c index 91e50fa0dd4..44fc368d617 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()); }