diff mbox

[08/20] monitor: Drop unused "new" HMP command interface

Message ID 1432294585-5984-9-git-send-email-armbru@redhat.com
State New
Headers show

Commit Message

Markus Armbruster May 22, 2015, 11:36 a.m. UTC
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 monitor.c | 22 +---------------------
 1 file changed, 1 insertion(+), 21 deletions(-)

Comments

Eric Blake May 22, 2015, 10:10 p.m. UTC | #1
On 05/22/2015 05:36 AM, Markus Armbruster wrote:
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>  monitor.c | 22 +---------------------
>  1 file changed, 1 insertion(+), 21 deletions(-)
> 

Goodbye!  Nice knowing you!  (For how many incomplete conversions we
have scattered throughout the tree, it's interesting to know that this
one was easier to get rid of by reverting instead of finishing the
conversion)

Reviewed-by: Eric Blake <eblake@redhat.com>
diff mbox

Patch

diff --git a/monitor.c b/monitor.c
index 64e7bd3..3a7e625 100644
--- a/monitor.c
+++ b/monitor.c
@@ -123,7 +123,6 @@  typedef struct mon_cmd_t {
     const char *args_type;
     const char *params;
     const char *help;
-    void (*user_print)(Monitor *mon, const QObject *data);
     union {
         void (*cmd)(Monitor *mon, const QDict *qdict);
         int  (*cmd_new)(Monitor *mon, const QDict *params, QObject **ret_data);
@@ -378,11 +377,6 @@  static int GCC_FMT_ATTR(2, 3) monitor_fprintf(FILE *stream,
     return 0;
 }
 
-static inline int handler_is_qobject(const mon_cmd_t *cmd)
-{
-    return cmd->user_print != NULL;
-}
-
 static inline int monitor_has_error(const Monitor *mon)
 {
     return mon->error != NULL;
@@ -4045,24 +4039,10 @@  static void handle_user_command(Monitor *mon, const char *cmdline)
     qdict = qdict_new();
 
     cmd = monitor_parse_command(mon, cmdline, 0, mon->cmd_table, qdict);
-    if (!cmd)
-        goto out;
-
-    if (handler_is_qobject(cmd)) {
-        QObject *data = NULL;
-
-        /* XXX: ignores the error code */
-        cmd->mhandler.cmd_new(mon, qdict, &data);
-        assert(!monitor_has_error(mon));
-        if (data) {
-            cmd->user_print(mon, data);
-            qobject_decref(data);
-        }
-    } else {
+    if (cmd) {
         cmd->mhandler.cmd(mon, qdict);
     }
 
-out:
     QDECREF(qdict);
 }