From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34518) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YToGt-0000Uk-61 for qemu-devel@nongnu.org; Fri, 06 Mar 2015 04:10:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YToGf-0006RM-Bp for qemu-devel@nongnu.org; Fri, 06 Mar 2015 04:10:15 -0500 From: Markus Armbruster Date: Fri, 6 Mar 2015 10:09:57 +0100 Message-Id: <1425632998-616-2-git-send-email-armbru@redhat.com> In-Reply-To: <1425632998-616-1-git-send-email-armbru@redhat.com> References: <1425632998-616-1-git-send-email-armbru@redhat.com> Subject: [Qemu-devel] [PATCH 1/2] hmp: Fix definition of command quit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-trivial@nongnu.org, lcapitulino@redhat.com The command handler is a union of two function types. If cmd->user_print is set, handle_user_command() calls cmd->mhandler.cmd_new(), else cmd->mhandler.cmd(). Command definitions must therefore either set both user_print() and mhandler.cmd_new(), or only mhandler.cmd(). quit's sets user_print and mhandler.cmd(). handle_user_command() calls hmp_quit() through mhandler.cmd_new() rather than mhandler.cmd(), i.e. through a function pointer with a different type. Broken in commit 7a7f325, v1.0. Works in practice because hmp_quit() doesn't use its arguments, and handle_user_command() ignores its function value. Signed-off-by: Markus Armbruster --- hmp-commands.hx | 1 - 1 file changed, 1 deletion(-) diff --git a/hmp-commands.hx b/hmp-commands.hx index 81f276b..fa5679f 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx @@ -47,7 +47,6 @@ ETEXI .args_type = "", .params = "", .help = "quit the emulator", - .user_print = monitor_user_noop, .mhandler.cmd = hmp_quit, }, -- 1.9.3