From 104fc3027960dd2aa9d310936a6cb201c60e1088 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Fri, 3 Mar 2017 13:32:28 +0100 Subject: qmp: Drop duplicated QMP command object checks qmp_check_input_obj() duplicates qmp_dispatch_check_obj(), except the latter screws up an error message. handle_qmp_command() runs first the former, then the latter via qmp_dispatch(), masking the screwup. qemu-ga also masks the screwup, because it also duplicates checks, just differently. qmp_check_input_obj() exists because handle_qmp_command() needs to examine the command before dispatching it. The previous commit got rid of this need, except for a tracepoint, and a bit of "id" code that relies on qdict not being null. Fix up the error message in qmp_dispatch_check_obj(), drop qmp_check_input_obj() and the tracepoint. Protect the "id" code with a conditional. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Message-Id: <1488544368-30622-9-git-send-email-armbru@redhat.com> --- qapi/qmp-dispatch.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'qapi') diff --git a/qapi/qmp-dispatch.c b/qapi/qmp-dispatch.c index 72827a3..7fb8aef 100644 --- a/qapi/qmp-dispatch.c +++ b/qapi/qmp-dispatch.c @@ -30,8 +30,7 @@ static QDict *qmp_dispatch_check_obj(const QObject *request, Error **errp) dict = qobject_to_qdict(request); if (!dict) { - error_setg(errp, QERR_QMP_BAD_INPUT_OBJECT, - "request is not a dictionary"); + error_setg(errp, QERR_QMP_BAD_INPUT_OBJECT, "object"); return NULL; } -- cgit v1.1