mirror of
https://github.com/qemu/qemu.git
synced 2024-11-25 03:43:37 +08:00
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:
parent
945c5ac8d3
commit
0fb88582e6
10
monitor.c
10
monitor.c
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user