All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luiz Capitulino <lcapitulino@redhat.com>
To: qemu-devel@nongnu.org
Cc: armbru@redhat.com
Subject: [Qemu-devel] [PATCH 13/14] QMP: Drop old input object checking
Date: Thu, 24 Jun 2010 18:33:39 -0300	[thread overview]
Message-ID: <1277415220-17810-14-git-send-email-lcapitulino@redhat.com> (raw)
In-Reply-To: <1277415220-17810-1-git-send-email-lcapitulino@redhat.com>

Previous commit added qmp_check_input_obj(), it does all the
checking we need.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
---
 monitor.c |   19 +------------------
 1 files changed, 1 insertions(+), 18 deletions(-)

diff --git a/monitor.c b/monitor.c
index fab553a..b68b464 100644
--- a/monitor.c
+++ b/monitor.c
@@ -4234,10 +4234,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);
@@ -4249,17 +4245,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;
@@ -4287,9 +4273,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.1.359.gd0b8d

  parent reply	other threads:[~2010-06-24 21:34 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-24 21:33 [Qemu-devel] [PATCH v3 00/14]: QMP: Replace client argument checker Luiz Capitulino
2010-06-24 21:33 ` [Qemu-devel] [PATCH 01/14] QDict: Rename 'err_value' Luiz Capitulino
2010-06-24 21:33 ` [Qemu-devel] [PATCH 02/14] QDict: Small terminology change Luiz Capitulino
2010-06-24 21:33 ` [Qemu-devel] [PATCH 03/14] QDict: Introduce functions to retrieve QDictEntry values Luiz Capitulino
2010-06-24 21:33 ` [Qemu-devel] [PATCH 04/14] QDict: Introduce new iteration API Luiz Capitulino
2010-06-24 21:33 ` [Qemu-devel] [PATCH 05/14] check-qdict: Introduce test for the " Luiz Capitulino
2010-06-24 21:33 ` [Qemu-devel] [PATCH 06/14] QDict: Introduce qdict_get_try_bool() Luiz Capitulino
2010-06-24 21:33 ` [Qemu-devel] [PATCH 07/14] Monitor: handle optional '-' arg as a bool Luiz Capitulino
2010-06-24 21:33 ` [Qemu-devel] [PATCH 08/14] QMP: New argument checker (first part) Luiz Capitulino
2010-06-24 21:33 ` [Qemu-devel] [PATCH 09/14] QMP: New argument checker (second part) Luiz Capitulino
2010-06-24 21:33 ` [Qemu-devel] [PATCH 10/14] QMP: Drop old client argument checker Luiz Capitulino
2010-06-24 21:33 ` [Qemu-devel] [PATCH 11/14] QError: Introduce QERR_QMP_EXTRA_MEMBER Luiz Capitulino
2010-06-24 21:33 ` [Qemu-devel] [PATCH 12/14] QMP: Introduce qmp_check_input_obj() Luiz Capitulino
2010-06-24 21:33 ` Luiz Capitulino [this message]
2010-06-24 21:33 ` [Qemu-devel] [PATCH 14/14] QMP: handle_qmp_command(): Small cleanup Luiz Capitulino
2010-06-24 21:48 ` [Qemu-devel] [PATCH v3 00/14]: QMP: Replace client argument checker Luiz Capitulino

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1277415220-17810-14-git-send-email-lcapitulino@redhat.com \
    --to=lcapitulino@redhat.com \
    --cc=armbru@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.