From patchwork Fri Dec 18 15:25:04 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 41411 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 ozlabs.org (Postfix) with ESMTPS id 3110BB6F0A for ; Sat, 19 Dec 2009 02:35:48 +1100 (EST) Received: from localhost ([127.0.0.1]:39663 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NLerp-0004o8-DA for incoming@patchwork.ozlabs.org; Fri, 18 Dec 2009 10:35:45 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NLehv-00018Y-Vw for qemu-devel@nongnu.org; Fri, 18 Dec 2009 10:25:32 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NLehr-00014P-Ff for qemu-devel@nongnu.org; Fri, 18 Dec 2009 10:25:31 -0500 Received: from [199.232.76.173] (port=57999 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NLehr-00014E-3n for qemu-devel@nongnu.org; Fri, 18 Dec 2009 10:25:27 -0500 Received: from mx1.redhat.com ([209.132.183.28]:26558) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NLehq-0006HS-P3 for qemu-devel@nongnu.org; Fri, 18 Dec 2009 10:25:27 -0500 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nBIFPP1f020468 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 18 Dec 2009 10:25:26 -0500 Received: from localhost (vpn-10-146.rdu.redhat.com [10.11.10.146]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nBIFPObR028526; Fri, 18 Dec 2009 10:25:25 -0500 From: Luiz Capitulino To: qemu-devel@nongnu.org Date: Fri, 18 Dec 2009 13:25:04 -0200 Message-Id: <1261149905-7622-7-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1261149905-7622-1-git-send-email-lcapitulino@redhat.com> References: <1261149905-7622-1-git-send-email-lcapitulino@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.18 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: aliguori@us.ibm.com Subject: [Qemu-devel] [PATCH 6/7] monitor: Introduce 'M' argument type 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 is a target long value in megabytes which should be converted to bytes. It will be used by handlers which accept a megabyte value when in "user mode". Signed-off-by: Luiz Capitulino --- monitor.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/monitor.c b/monitor.c index 8ef1582..f779680 100644 --- a/monitor.c +++ b/monitor.c @@ -3501,6 +3501,7 @@ static const mon_cmd_t *monitor_parse_command(Monitor *mon, break; case 'i': case 'l': + case 'M': { int64_t val; @@ -3531,6 +3532,8 @@ static const mon_cmd_t *monitor_parse_command(Monitor *mon, monitor_printf(mon, "\'%s\' has failed: ", cmdname); monitor_printf(mon, "integer is for 32-bit values\n"); goto fail; + } else if (c == 'M') { + val <<= 20; } qdict_put(qdict, key, qint_from_int(val)); } @@ -3935,6 +3938,7 @@ static int check_arg(const CmdArgs *cmd_args, QDict *args) } case 'i': case 'l': + case 'M': if (qobject_type(value) != QTYPE_QINT) { qemu_error_new(QERR_INVALID_PARAMETER_TYPE, name, "int"); return -1;