diff options
author | Luiz Capitulino <lcapitulino@redhat.com> | 2010-09-15 10:56:17 -0300 |
---|---|---|
committer | Luiz Capitulino <lcapitulino@redhat.com> | 2010-10-01 10:20:06 -0300 |
commit | 0fb88582e60e16e809c1aabc2c4b3e1f0832e267 (patch) | |
tree | bc3e9868eab32689cf68afa1e10987b299e035b5 /monitor.c | |
parent | 945c5ac8d3c792bab36dc0990f11ca55f6eb3148 (diff) |
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>
Diffstat (limited to 'monitor.c')
-rw-r--r-- | monitor.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -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"); |