[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 21/23] QMP: Drop old input object checking
From: |
Luiz Capitulino |
Subject: |
[Qemu-devel] [PATCH 21/23] QMP: Drop old input object checking |
Date: |
Thu, 1 Jul 2010 16:21:49 -0300 |
Previous commit added qmp_check_input_obj(), it does all the
checking we need.
Signed-off-by: Luiz Capitulino <address@hidden>
---
monitor.c | 19 +------------------
1 files changed, 1 insertions(+), 18 deletions(-)
diff --git a/monitor.c b/monitor.c
index 22e0650..1c8992b 100644
--- a/monitor.c
+++ b/monitor.c
@@ -4241,10 +4241,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);
@@ -4256,17 +4252,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;
@@ -4294,9 +4280,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.2.rc0
- [Qemu-devel] [PATCH 10/23] QDict: Small terminology change, (continued)
- [Qemu-devel] [PATCH 10/23] QDict: Small terminology change, Luiz Capitulino, 2010/07/01
- [Qemu-devel] [PATCH 13/23] check-qdict: Introduce test for the new iteration API, Luiz Capitulino, 2010/07/01
- [Qemu-devel] [PATCH 14/23] QDict: Introduce qdict_get_try_bool(), Luiz Capitulino, 2010/07/01
- [Qemu-devel] [PATCH 12/23] QDict: Introduce new iteration API, Luiz Capitulino, 2010/07/01
- [Qemu-devel] [PATCH 15/23] Monitor: handle optional '-' arg as a bool, Luiz Capitulino, 2010/07/01
- [Qemu-devel] [PATCH 16/23] QMP: New argument checker (first part), Luiz Capitulino, 2010/07/01
- [Qemu-devel] [PATCH 17/23] QMP: New argument checker (second part), Luiz Capitulino, 2010/07/01
- [Qemu-devel] [PATCH 18/23] QMP: Drop old client argument checker, Luiz Capitulino, 2010/07/01
- [Qemu-devel] [PATCH 19/23] QError: Introduce QERR_QMP_EXTRA_MEMBER, Luiz Capitulino, 2010/07/01
- [Qemu-devel] [PATCH 20/23] QMP: Introduce qmp_check_input_obj(), Luiz Capitulino, 2010/07/01
- [Qemu-devel] [PATCH 21/23] QMP: Drop old input object checking,
Luiz Capitulino <=
- [Qemu-devel] [PATCH 22/23] QMP: handle_qmp_command(): Small cleanup, Luiz Capitulino, 2010/07/01
- [Qemu-devel] [PATCH 23/23] monitor: Allow to exclude commands from QMP, Luiz Capitulino, 2010/07/01
- Re: [Qemu-devel] [PATCH 00/23][PULL]: QMP/Monitor queue, Anthony Liguori, 2010/07/06