From patchwork Mon Aug 3 16:57:15 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 30671 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by bilbo.ozlabs.org (Postfix) with ESMTPS id 1DAA1B6F31 for ; Tue, 4 Aug 2009 05:56:23 +1000 (EST) Received: from localhost ([127.0.0.1]:52467 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MY3ds-0002A0-Gm for incoming@patchwork.ozlabs.org; Mon, 03 Aug 2009 15:56:20 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MY0sF-0006Ih-Vg for qemu-devel@nongnu.org; Mon, 03 Aug 2009 12:59:00 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MY0sA-0006Fo-Pt for qemu-devel@nongnu.org; Mon, 03 Aug 2009 12:58:59 -0400 Received: from [199.232.76.173] (port=55291 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MY0sA-0006Fd-K2 for qemu-devel@nongnu.org; Mon, 03 Aug 2009 12:58:54 -0400 Received: from mx2.redhat.com ([66.187.237.31]:56371) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MY0sA-0003D2-13 for qemu-devel@nongnu.org; Mon, 03 Aug 2009 12:58:54 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n73Gwr0v026370; Mon, 3 Aug 2009 12:58:53 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n73GwqhS015459; Mon, 3 Aug 2009 12:58:52 -0400 Received: from localhost (vpn-10-1.bos.redhat.com [10.16.10.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n73GwoM4030160; Mon, 3 Aug 2009 12:58:51 -0400 From: Luiz Capitulino To: qemu-devel@nongnu.org Date: Mon, 3 Aug 2009 13:57:15 -0300 Message-Id: <1249318642-19324-19-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1249318642-19324-1-git-send-email-lcapitulino@redhat.com> References: <1249318642-19324-1-git-send-email-lcapitulino@redhat.com> X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Cc: jan.kiszka@siemens.com, aliguori@us.ibm.com, avi@redhat.com Subject: [Qemu-devel] [PATCH 18/25] monitor: Port handler_10 to use the dictionary X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org This commit ports command handlers that receive ten arguments to use the new monitor's dictionary. Signed-off-by: Luiz Capitulino --- monitor.c | 26 ++++++++++++-------------- 1 files changed, 12 insertions(+), 14 deletions(-) diff --git a/monitor.c b/monitor.c index d2e445f..b20f317 100644 --- a/monitor.c +++ b/monitor.c @@ -1768,14 +1768,19 @@ static void do_acl_remove(Monitor *mon, const QDict *qdict) } #if defined(TARGET_I386) -static void do_inject_mce(Monitor *mon, - int cpu_index, int bank, - unsigned status_hi, unsigned status_lo, - unsigned mcg_status_hi, unsigned mcg_status_lo, - unsigned addr_hi, unsigned addr_lo, - unsigned misc_hi, unsigned misc_lo) +static void do_inject_mce(Monitor *mon, const QDict *qdict) { CPUState *cenv; + int cpu_index = (long) qdict_get(qdict, "cpu_index"); + int bank = (long) qdict_get(qdict, "bank"); + unsigned status_hi = (long) qdict_get(qdict, "status_h"); + unsigned status_lo = (long) qdict_get(qdict, "status_l"); + unsigned mcg_status_hi = (long) qdict_get(qdict, "mcg_status_h"); + unsigned mcg_status_lo = (long) qdict_get(qdict, "mcg_status_l"); + unsigned addr_hi = (long) qdict_get(qdict, "addr_h"); + unsigned addr_lo = (long) qdict_get(qdict, "addr_l"); + unsigned misc_hi = (long) qdict_get(qdict, "misc_h"); + unsigned misc_lo = (long) qdict_get(qdict, "misc_l"); uint64_t status = ((uint64_t)status_hi << 32) | status_lo; uint64_t mcg_status = ((uint64_t)mcg_status_hi << 32) | mcg_status_lo; uint64_t addr = ((uint64_t)addr_hi << 32) | addr_lo; @@ -2700,9 +2705,6 @@ static void monitor_handle_command(Monitor *mon, const char *cmdline) void *args[MAX_ARGS]; QDict *qdict; void (*handler_d)(Monitor *mon, const QDict *qdict); - void (*handler_10)(Monitor *mon, void *arg0, void *arg1, void *arg2, - void *arg3, void *arg4, void *arg5, void *arg6, - void *arg7, void *arg8, void *arg9); #ifdef DEBUG monitor_printf(mon, "command='%s'\n", cmdline); @@ -2991,14 +2993,10 @@ static void monitor_handle_command(Monitor *mon, const char *cmdline) case 5: case 6: case 7: + case 10: handler_d = cmd->handler; handler_d(mon, qdict); break; - case 10: - handler_10 = cmd->handler; - handler_10(mon, args[0], args[1], args[2], args[3], args[4], args[5], - args[6], args[7], args[8], args[9]); - break; default: monitor_printf(mon, "unsupported number of arguments: %d\n", nb_args); goto fail;