@@ -19,11 +19,6 @@
typedef void (QmpCommandFunc)(QDict *, QObject **, Error **);
-typedef enum QmpCommandType
-{
- QCT_NORMAL,
-} QmpCommandType;
-
typedef enum QmpCommandOptions
{
QCO_NO_OPTIONS = 0x0,
@@ -33,7 +28,6 @@ typedef enum QmpCommandOptions
typedef struct QmpCommand
{
const char *name;
- QmpCommandType type;
QmpCommandFunc *fn;
QmpCommandOptions options;
QTAILQ_ENTRY(QmpCommand) node;
@@ -94,17 +94,13 @@ static QObject *do_qmp_dispatch(QObject *request, Error **errp)
QINCREF(args);
}
- switch (cmd->type) {
- case QCT_NORMAL:
- cmd->fn(args, &ret, &local_err);
- if (local_err) {
- error_propagate(errp, local_err);
- } else if (cmd->options & QCO_NO_SUCCESS_RESP) {
- g_assert(!ret);
- } else if (!ret) {
- ret = QOBJECT(qdict_new());
- }
- break;
+ cmd->fn(args, &ret, &local_err);
+ if (local_err) {
+ error_propagate(errp, local_err);
+ } else if (cmd->options & QCO_NO_SUCCESS_RESP) {
+ g_assert(!ret);
+ } else if (!ret) {
+ ret = QOBJECT(qdict_new());
}
QDECREF(args);
@@ -25,7 +25,6 @@ void qmp_register_command(const char *name, QmpCommandFunc *fn,
QmpCommand *cmd = g_malloc0(sizeof(*cmd));
cmd->name = name;
- cmd->type = QCT_NORMAL;
cmd->fn = fn;
cmd->enabled = true;
cmd->options = options;