sim-card
/
qemu
Archived
10
0
Fork 0

QMP: handle_qmp_command(): Move 'cmd' sanity check

Next commit will change how query commands are handled in a
way that the 'cmd' sanity check is also going to be needed
for query commands handling.

Let's move it out of the else body then.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
This commit is contained in:
Luiz Capitulino 2010-09-15 10:56:17 -03:00
parent 945c5ac8d3
commit 0fb88582e6
1 changed files with 5 additions and 5 deletions

View File

@ -4375,11 +4375,11 @@ static void handle_qmp_command(JSONMessageParser *parser, QList *tokens)
qobject_from_jsonf("{ 'item': %s }", info_item));
} else {
cmd = monitor_find_command(cmd_name);
if (!cmd || !monitor_handler_ported(cmd)
|| monitor_cmd_user_only(cmd)) {
qerror_report(QERR_COMMAND_NOT_FOUND, cmd_name);
goto err_out;
}
}
if (!cmd || !monitor_handler_ported(cmd) || monitor_cmd_user_only(cmd)) {
qerror_report(QERR_COMMAND_NOT_FOUND, cmd_name);
goto err_out;
}
obj = qdict_get(input, "arguments");