[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 14/14] QMP: handle_qmp_command(): Small cleanup
From: |
Luiz Capitulino |
Subject: |
[Qemu-devel] [PATCH 14/14] QMP: handle_qmp_command(): Small cleanup |
Date: |
Thu, 24 Jun 2010 18:33:40 -0300 |
Drop a unneeded label and QDECREF() call.
Signed-off-by: Luiz Capitulino <address@hidden>
---
monitor.c | 14 ++++++--------
1 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/monitor.c b/monitor.c
index b68b464..e38a3a4 100644
--- a/monitor.c
+++ b/monitor.c
@@ -4227,7 +4227,7 @@ static void handle_qmp_command(JSONMessageParser *parser,
QList *tokens)
Monitor *mon = cur_mon;
const char *cmd_name, *info_item;
- args = NULL;
+ args = input = NULL;
obj = json_parser_parse(tokens, NULL);
if (!obj) {
@@ -4248,7 +4248,7 @@ static void handle_qmp_command(JSONMessageParser *parser,
QList *tokens)
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;
+ goto err_out;
}
/*
@@ -4257,7 +4257,7 @@ static void handle_qmp_command(JSONMessageParser *parser,
QList *tokens)
*/
if (compare_cmd(cmd_name, "info")) {
qerror_report(QERR_COMMAND_NOT_FOUND, cmd_name);
- goto err_input;
+ goto err_out;
} else if (strstart(cmd_name, "query-", &info_item)) {
cmd = monitor_find_command("info");
qdict_put_obj(input, "arguments",
@@ -4266,7 +4266,7 @@ static void handle_qmp_command(JSONMessageParser *parser,
QList *tokens)
cmd = monitor_find_command(cmd_name);
if (!cmd || !monitor_handler_ported(cmd)) {
qerror_report(QERR_COMMAND_NOT_FOUND, cmd_name);
- goto err_input;
+ goto err_out;
}
}
@@ -4278,8 +4278,6 @@ static void handle_qmp_command(JSONMessageParser *parser,
QList *tokens)
QINCREF(args);
}
- QDECREF(input);
-
err = qmp_check_client_args(cmd, args);
if (err < 0) {
goto err_out;
@@ -4294,13 +4292,13 @@ static void handle_qmp_command(JSONMessageParser
*parser, QList *tokens)
} else {
monitor_call_handler(mon, cmd, args);
}
+
goto out;
-err_input:
- QDECREF(input);
err_out:
monitor_protocol_emitter(mon, NULL);
out:
+ QDECREF(input);
QDECREF(args);
}
--
1.7.1.359.gd0b8d
- [Qemu-devel] [PATCH 04/14] QDict: Introduce new iteration API, (continued)
- [Qemu-devel] [PATCH 04/14] QDict: Introduce new iteration API, Luiz Capitulino, 2010/06/24
- [Qemu-devel] [PATCH 05/14] check-qdict: Introduce test for the new iteration API, Luiz Capitulino, 2010/06/24
- [Qemu-devel] [PATCH 06/14] QDict: Introduce qdict_get_try_bool(), Luiz Capitulino, 2010/06/24
- [Qemu-devel] [PATCH 07/14] Monitor: handle optional '-' arg as a bool, Luiz Capitulino, 2010/06/24
- [Qemu-devel] [PATCH 08/14] QMP: New argument checker (first part), Luiz Capitulino, 2010/06/24
- [Qemu-devel] [PATCH 09/14] QMP: New argument checker (second part), Luiz Capitulino, 2010/06/24
- [Qemu-devel] [PATCH 10/14] QMP: Drop old client argument checker, Luiz Capitulino, 2010/06/24
- [Qemu-devel] [PATCH 11/14] QError: Introduce QERR_QMP_EXTRA_MEMBER, Luiz Capitulino, 2010/06/24
- [Qemu-devel] [PATCH 13/14] QMP: Drop old input object checking, Luiz Capitulino, 2010/06/24
- [Qemu-devel] [PATCH 12/14] QMP: Introduce qmp_check_input_obj(), Luiz Capitulino, 2010/06/24
- [Qemu-devel] [PATCH 14/14] QMP: handle_qmp_command(): Small cleanup,
Luiz Capitulino <=
- Re: [Qemu-devel] [PATCH v3 00/14]: QMP: Replace client argument checker, Luiz Capitulino, 2010/06/24