qmp: Add some comments around null responses

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20180703085358.13941-28-armbru@redhat.com>
This commit is contained in:
Markus Armbruster 2018-07-03 10:53:53 +02:00
parent 7cb2123f22
commit 62e93be286

View File

@ -133,6 +133,7 @@ static QObject *do_qmp_dispatch(QmpCommandList *cmds, QObject *request,
} else if (cmd->options & QCO_NO_SUCCESS_RESP) {
g_assert(!ret);
} else if (!ret) {
/* TODO turn into assertion */
ret = QOBJECT(qdict_new());
}
@ -176,6 +177,7 @@ QDict *qmp_dispatch(QmpCommandList *cmds, QObject *request,
rsp = qdict_new();
qdict_put_obj(rsp, "return", ret);
} else {
/* Can only happen for commands with QCO_NO_SUCCESS_RESP */
rsp = NULL;
}