From patchwork Mon Aug 7 14:45:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 9885515 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7D4F5603B4 for ; Mon, 7 Aug 2017 14:52:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6EF8728429 for ; Mon, 7 Aug 2017 14:52:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 63A2928671; Mon, 7 Aug 2017 14:52:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id F360F28429 for ; Mon, 7 Aug 2017 14:52:37 +0000 (UTC) Received: from localhost ([::1]:37716 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dejOX-000392-96 for patchwork-qemu-devel@patchwork.kernel.org; Mon, 07 Aug 2017 10:52:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48526) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dejIj-0006ws-Ln for qemu-devel@nongnu.org; Mon, 07 Aug 2017 10:46:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dejIY-0003fo-Pv for qemu-devel@nongnu.org; Mon, 07 Aug 2017 10:46:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49820) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dejIN-0003Ow-Kk; Mon, 07 Aug 2017 10:46:15 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9179AC047B71; Mon, 7 Aug 2017 14:46:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 9179AC047B71 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=armbru@redhat.com Received: from blackfin.pond.sub.org (ovpn-116-254.ams2.redhat.com [10.36.116.254]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B05B98FBE1; Mon, 7 Aug 2017 14:46:01 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 134241138656; Mon, 7 Aug 2017 16:46:00 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Mon, 7 Aug 2017 16:45:07 +0200 Message-Id: <1502117160-24655-4-git-send-email-armbru@redhat.com> In-Reply-To: <1502117160-24655-1-git-send-email-armbru@redhat.com> References: <1502117160-24655-1-git-send-email-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 07 Aug 2017 14:46:11 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [RFC PATCH 03/56] monitor: Rewrite comment describing HMP .args_type X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, famz@redhat.com, qemu-block@nongnu.org, quintela@redhat.com, jcody@redhat.com, dgilbert@redhat.com, mreitz@redhat.com, marcandre.lureau@redhat.com, pbonzini@redhat.com, jsnow@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Markus Armbruster --- monitor.c | 75 +++++++++++++++++++++++++++++++++++++++------------------------ 1 file changed, 47 insertions(+), 28 deletions(-) diff --git a/monitor.c b/monitor.c index e0f8801..8b54ba1 100644 --- a/monitor.c +++ b/monitor.c @@ -85,37 +85,56 @@ #endif /* - * Supported types: + * Command handlers (mon_cmd_t member @cmd) receive actual arguments + * in a QDict, which is built by the HMP core according to mon_cmd_t + * member @args_type. It's a list of NAME:TYPE separated by comma. * - * 'F' filename - * 'B' block device name - * 's' string (accept optional quote) - * 'S' it just appends the rest of the string (accept optional quote) - * 'O' option string of the form NAME=VALUE,... - * parsed according to QemuOptsList given by its name - * Example: 'device:O' uses qemu_device_opts. - * Restriction: only lists with empty desc are supported - * TODO lift the restriction - * 'i' 32 bit integer - * 'l' target long (32 or 64 bit) - * 'M' Non-negative target long (32 or 64 bit), in user mode the - * value is multiplied by 2^20 (think Mebibyte) - * 'o' octets (aka bytes) - * user mode accepts an optional E, e, P, p, T, t, G, g, M, m, - * K, k suffix, which multiplies the value by 2^60 for suffixes E - * and e, 2^50 for suffixes P and p, 2^40 for suffixes T and t, - * 2^30 for suffixes G and g, 2^20 for M and m, 2^10 for K and k - * 'T' double - * user mode accepts an optional ms, us, ns suffix, - * which divides the value by 1e3, 1e6, 1e9, respectively - * '/' optional gdb-like print format (like "/10x") + * TYPEs that put a string value with key NAME into the QDict: + * 's' Argument is enclosed in '"' or delimited by whitespace. In + * the former case, escapes \n \r \\ \' and \" are recognized. + * 'F' File name, like 's' except for completion. + * 'B' BlockBackend name, like 's' except for completion. + * 'S' Argument is the remainder of the line, less leading + * whitespace. + * - * '?' optional type (for all types, except '/') - * '.' other form of optional type (for 'i' and 'l') - * 'b' boolean - * user mode accepts "on" or "off" - * '-' optional parameter (eg. '-f') + * TYPEs that put an int64_t value with key NAME: + * 'l' Argument is an expression (QEMU pocket calculator). + * 'i' Like 'l' except value must fit into 32 bit unsigned. + * 'M' Like 'l' except value must not be negative and is multiplied + * by 2^20 (think "mebibyte"). * + * TYPEs that put an uint64_t value with key NAME: + * 'o' Argument is a size (think "octets"). Without suffix the + * value is multiplied by 2^20 (mebibytes), with suffix E or e + * by 2^60 (exbibytes), with P or p by 2^50 (pebibytes), with T + * or t by 2^40 (tebibytes), with G or g by 2^30 (gibibytes), + * with M or m by 2^10 (mebibytes), with K or k by 2^10 + * (kibibytes). + * + * TYPEs that put a double value with key NAME: + * 'T' Argument is a time in seconds. With optional ms, us, ns + * suffix, the value divided by 1e3, 1e6, 1e9 respectively. + * + * TYPEs that put a bool value with key NAME: + * 'b' Argument is either "on" (true) or "off" (false). + * '-' CHAR + * Argument is either "-CHAR" (true) or absent (false). + * + * TYPEs that put multiple values: + * 'O' Option string of the form NAME=VALUE,... parsed according to + * the QemuOptsList given by its name. + * Example: 'device:O' uses qemu_device_opts. + * Restriction: only lists with empty desc are supported. + * Puts all the NAME=VALUE. + * '/' Gdb-like print format (like "/10x"), always optional. + * Puts keys "count", "format", "size", all int. + * + * Modifier character following the type string: + * '?' Argument is optional, nothing is put when it is absent + * (all types except 'O', '/', 'b'). + * '.' Argument is optional, must be preceded by '.' if present + * (only types 'i', 'l', 'M') */ typedef struct mon_cmd_t {