From 5d4511ce42c4e309a44b64ba1020c0285c373aef Mon Sep 17 00:00:00 2001 From: Jeffrey Cody Date: Tue, 20 Mar 2012 14:07:28 -0300 Subject: [RHEL6 qemu-kvm PATCH 08/21] QMP: Drop old input object checking RH-Author: Jeffrey Cody Message-id: <340c80db628382a9cb2c716d70da2db2d405d25b.1332249823.git.jcody@redhat.com> Patchwork-id: 38634 O-Subject: [RHEL6.3 qemu-kvm PATCH v3 08/21] QMP: Drop old input object checking Bugzilla: 784153 RH-Acked-by: Kevin Wolf RH-Acked-by: Paolo Bonzini RH-Acked-by: Markus Armbruster From: Luiz Capitulino Previous commit added qmp_check_input_obj(), it does all the checking we need. Signed-off-by: Luiz Capitulino (cherry picked from commit 0bbab46db67bd5a059aadabc498be3c371551506) Signed-off-by: Jeff Cody --- monitor.c | 19 +------------------ 1 files changed, 1 insertions(+), 18 deletions(-) Signed-off-by: Eduardo Habkost --- monitor.c | 19 +------------------ 1 files changed, 1 insertions(+), 18 deletions(-) diff --git a/monitor.c b/monitor.c index a1342ea..7d04744 100644 --- a/monitor.c +++ b/monitor.c @@ -4680,10 +4680,6 @@ static void handle_qmp_command(JSONMessageParser *parser, QList *tokens) // FIXME: should be triggered in json_parser_parse() qerror_report(QERR_JSON_PARSING); goto err_out; - } else if (qobject_type(obj) != QTYPE_QDICT) { - qerror_report(QERR_QMP_BAD_INPUT_OBJECT, "object"); - qobject_decref(obj); - goto err_out; } input = qmp_check_input_obj(obj); @@ -4695,17 +4691,7 @@ static void handle_qmp_command(JSONMessageParser *parser, QList *tokens) mon->mc->id = qdict_get(input, "id"); qobject_incref(mon->mc->id); - obj = qdict_get(input, "execute"); - if (!obj) { - qerror_report(QERR_QMP_BAD_INPUT_OBJECT, "execute"); - goto err_input; - } else if (qobject_type(obj) != QTYPE_QSTRING) { - qerror_report(QERR_QMP_BAD_INPUT_OBJECT_MEMBER, "execute", "string"); - goto err_input; - } - - cmd_name = qstring_get_str(qobject_to_qstring(obj)); - + cmd_name = qdict_get_str(input, "execute"); if (invalid_qmp_mode(mon, cmd_name)) { qerror_report(QERR_COMMAND_NOT_FOUND, cmd_name); goto err_input; @@ -4733,9 +4719,6 @@ static void handle_qmp_command(JSONMessageParser *parser, QList *tokens) obj = qdict_get(input, "arguments"); if (!obj) { args = qdict_new(); - } else if (qobject_type(obj) != QTYPE_QDICT) { - qerror_report(QERR_QMP_BAD_INPUT_OBJECT_MEMBER, "arguments", "object"); - goto err_input; } else { args = qobject_to_qdict(obj); QINCREF(args); -- 1.7.3.2