]> Git Repo - qemu.git/commitdiff
qmp: Drop dead command->type
authorEric Blake <[email protected]>
Thu, 28 Apr 2016 21:45:11 +0000 (15:45 -0600)
committerMarkus Armbruster <[email protected]>
Thu, 12 May 2016 07:47:54 +0000 (09:47 +0200)
Ever since QMP was first added back in commit 43c20a43, we have
never had any QmpCommandType other than QCT_NORMAL.  It's
pointless to carry around the cruft.

Signed-off-by: Eric Blake <[email protected]>
Message-Id: <1461879932[email protected]>
Signed-off-by: Markus Armbruster <[email protected]>
include/qapi/qmp/dispatch.h
qapi/qmp-dispatch.c
qapi/qmp-registry.c

index 495520994cb80001c775d8867d6c7c5bdb2b079c..5609946a16b55dca04e711f4979c23b2f6eb9521 100644 (file)
 
 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;
index 510a1aead8ae7826619a46e5f3c716cf0eeb88b6..08faf853ac74d94cf9781c6539194d84e03364ab 100644 (file)
@@ -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);
index 4ebfbccd46ff84aeda9cdf02a23e49c502a1ede6..4332a6818d6acfd238d21ace7deb355a93a3c8f2 100644 (file)
@@ -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;
This page took 0.038401 seconds and 4 git commands to generate.