mirror of https://github.com/xemu-project/xemu.git
qmp: Eliminate silly QERR_COMMAND_NOT_FOUND macro
The QERR_ macros are leftovers from the days of "rich" error objects. They're used with error_set() and qerror_report(), and expand into the first *two* arguments. This trickiness has become pointless. Clean this one up. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
bb5224edfb
commit
a6c90cbccd
|
@ -52,9 +52,6 @@ void qerror_report_err(Error *err);
|
||||||
#define QERR_BUS_NOT_FOUND \
|
#define QERR_BUS_NOT_FOUND \
|
||||||
ERROR_CLASS_GENERIC_ERROR, "Bus '%s' not found"
|
ERROR_CLASS_GENERIC_ERROR, "Bus '%s' not found"
|
||||||
|
|
||||||
#define QERR_COMMAND_NOT_FOUND \
|
|
||||||
ERROR_CLASS_COMMAND_NOT_FOUND, "The command %s has not been found"
|
|
||||||
|
|
||||||
#define QERR_DEVICE_ENCRYPTED \
|
#define QERR_DEVICE_ENCRYPTED \
|
||||||
ERROR_CLASS_DEVICE_ENCRYPTED, "'%s' (%s) is encrypted"
|
ERROR_CLASS_DEVICE_ENCRYPTED, "'%s' (%s) is encrypted"
|
||||||
|
|
||||||
|
|
|
@ -5081,7 +5081,8 @@ static void handle_qmp_command(JSONMessageParser *parser, QList *tokens)
|
||||||
trace_handle_qmp_command(mon, cmd_name);
|
trace_handle_qmp_command(mon, cmd_name);
|
||||||
cmd = qmp_find_cmd(cmd_name);
|
cmd = qmp_find_cmd(cmd_name);
|
||||||
if (!cmd || invalid_qmp_mode(mon, cmd)) {
|
if (!cmd || invalid_qmp_mode(mon, cmd)) {
|
||||||
qerror_report(QERR_COMMAND_NOT_FOUND, cmd_name);
|
qerror_report(ERROR_CLASS_COMMAND_NOT_FOUND,
|
||||||
|
"The command %s has not been found", cmd_name);
|
||||||
goto err_out;
|
goto err_out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -76,7 +76,8 @@ static QObject *do_qmp_dispatch(QObject *request, Error **errp)
|
||||||
command = qdict_get_str(dict, "execute");
|
command = qdict_get_str(dict, "execute");
|
||||||
cmd = qmp_find_command(command);
|
cmd = qmp_find_command(command);
|
||||||
if (cmd == NULL) {
|
if (cmd == NULL) {
|
||||||
error_set(errp, QERR_COMMAND_NOT_FOUND, command);
|
error_set(errp, ERROR_CLASS_COMMAND_NOT_FOUND,
|
||||||
|
"The command %s has not been found", command);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (!cmd->enabled) {
|
if (!cmd->enabled) {
|
||||||
|
|
Loading…
Reference in New Issue