From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39995) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YxGfB-0001U4-Mf for qemu-devel@nongnu.org; Tue, 26 May 2015 11:21:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YxGf7-0006k6-0e for qemu-devel@nongnu.org; Tue, 26 May 2015 11:21:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37573) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YxGf6-0006jm-Rt for qemu-devel@nongnu.org; Tue, 26 May 2015 11:21:00 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 8E36AB599E for ; Tue, 26 May 2015 15:21:00 +0000 (UTC) From: Markus Armbruster Date: Tue, 26 May 2015 17:20:43 +0200 Message-Id: <1432653655-30745-9-git-send-email-armbru@redhat.com> In-Reply-To: <1432653655-30745-1-git-send-email-armbru@redhat.com> References: <1432653655-30745-1-git-send-email-armbru@redhat.com> Subject: [Qemu-devel] [PATCH v2 08/20] monitor: Drop unused "new" HMP command interface List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: lcapitulino@redhat.com Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake --- monitor.c | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/monitor.c b/monitor.c index 85bb71e..9403c2c 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); } -- 1.9.3