aboutsummaryrefslogtreecommitdiff
path: root/monitor.c
diff options
context:
space:
mode:
authorLuiz Capitulino <lcapitulino@redhat.com>2010-06-24 17:58:20 -0300
committerLuiz Capitulino <lcapitulino@redhat.com>2010-07-01 14:27:14 -0300
commite4940c603a209c82c2ea80cfeb244c5dec8e3118 (patch)
treea54eed7b7c229e08bee4b9e49092f8246b767fa1 /monitor.c
parent0bbab46db67bd5a059aadabc498be3c371551506 (diff)
QMP: handle_qmp_command(): Small cleanup
Drop a unneeded label and QDECREF() call. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Diffstat (limited to 'monitor.c')
-rw-r--r--monitor.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/monitor.c b/monitor.c
index 1c8992bd24..00a627acfa 100644
--- a/monitor.c
+++ b/monitor.c
@@ -4234,7 +4234,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) {
@@ -4255,7 +4255,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;
}
/*
@@ -4264,7 +4264,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",
@@ -4273,7 +4273,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;
}
}
@@ -4285,8 +4285,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;
@@ -4301,13 +4299,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);
}