From patchwork Thu Mar 19 09:05:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 451934 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id AE57D140083 for ; Thu, 19 Mar 2015 21:24:41 +1100 (AEDT) Received: from localhost ([::1]:38271 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYXd1-0006wQ-Tk for incoming@patchwork.ozlabs.org; Thu, 19 Mar 2015 06:24:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54259) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYXbK-0004D0-0o for qemu-devel@nongnu.org; Thu, 19 Mar 2015 06:22:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YYXb4-0006wh-H7 for qemu-devel@nongnu.org; Thu, 19 Mar 2015 06:22:53 -0400 Received: from isrv.corpit.ru ([86.62.121.231]:49068) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYXb4-0006wS-4V; Thu, 19 Mar 2015 06:22:38 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 1E2F741E5C; Thu, 19 Mar 2015 13:22:37 +0300 (MSK) Received: from tls.msk.ru (mjt.vpn.tls.msk.ru [192.168.177.99]) by tsrv.corpit.ru (Postfix) with SMTP id 1AE4092B; Thu, 19 Mar 2015 12:05:46 +0300 (MSK) Received: (nullmailer pid 345 invoked by uid 1000); Thu, 19 Mar 2015 09:05:44 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Date: Thu, 19 Mar 2015 12:05:29 +0300 Message-Id: <46db7b862ab66d14679bb96563092e7ef76f1cfb.1426755483.git.mjt@msgid.tls.msk.ru> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 86.62.121.231 Cc: qemu-trivial@nongnu.org, Michael Tokarev , Markus Armbruster Subject: [Qemu-devel] [PULL 11/24] hmp: Fix definition of command quit X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Markus Armbruster 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 Reviewed-by: Eric Blake Signed-off-by: Michael Tokarev --- hmp-commands.hx | 1 - 1 file changed, 1 deletion(-) diff --git a/hmp-commands.hx b/hmp-commands.hx index 328709d..6fd5336 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, },