From mboxrd@z Thu Jan 1 00:00:00 1970 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 From: Luiz Capitulino 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> Subject: [Qemu-devel] [PATCH 6/7] monitor: Introduce 'M' argument type List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aliguori@us.ibm.com 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; -- 1.6.6.rc3