From nobody Wed Nov 5 02:07:36 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1532351779690875.5815263438803; Mon, 23 Jul 2018 06:16:19 -0700 (PDT) Received: from localhost ([::1]:34592 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fhahB-0004Da-L0 for importer@patchew.org; Mon, 23 Jul 2018 09:16:13 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48801) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fhaf5-0002lw-7n for qemu-devel@nongnu.org; Mon, 23 Jul 2018 09:14:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fhaf0-00051v-9Y for qemu-devel@nongnu.org; Mon, 23 Jul 2018 09:14:03 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:50376 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fhaf0-00051g-3e for qemu-devel@nongnu.org; Mon, 23 Jul 2018 09:13:58 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C1BA140201D5 for ; Mon, 23 Jul 2018 13:13:57 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-135.ams2.redhat.com [10.36.116.135]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9BE722026D65 for ; Mon, 23 Jul 2018 13:13:57 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 6225111386C5; Mon, 23 Jul 2018 15:13:56 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Mon, 23 Jul 2018 15:13:55 +0200 Message-Id: <20180723131356.27466-2-armbru@redhat.com> In-Reply-To: <20180723131356.27466-1-armbru@redhat.com> References: <20180723131356.27466-1-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Mon, 23 Jul 2018 13:13:57 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Mon, 23 Jul 2018 13:13:57 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'armbru@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 1/2] qapi: Make 'allow-oob' optional in SchemaInfoCommand 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Making 'allow-oob' optional in SchemaInfoCommand permits omitting it in the common case. Shrinks query-qmp-schema's output from 122.1KiB to 118.6KiB for me. Note that out-of-band execution is still experimental (you have to configure the monitor with x-oob=3Don to use it). Signed-off-by: Markus Armbruster Message-Id: <20180718090557.17248-1-armbru@redhat.com> Reviewed-by: Peter Xu --- qapi/introspect.json | 6 +++--- scripts/qapi/introspect.py | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/qapi/introspect.json b/qapi/introspect.json index c7f67b7d78..137b39b992 100644 --- a/qapi/introspect.json +++ b/qapi/introspect.json @@ -259,8 +259,8 @@ # # @ret-type: the name of the command's result type. # -# @allow-oob: whether the command allows out-of-band execution. -# (Since: 2.12) +# @allow-oob: whether the command allows out-of-band execution, +# defaults to false (Since: 2.12) # # TODO: @success-response (currently irrelevant, because it's QGA, not QMP) # @@ -268,7 +268,7 @@ ## { 'struct': 'SchemaInfoCommand', 'data': { 'arg-type': 'str', 'ret-type': 'str', - 'allow-oob': 'bool' } } + '*allow-oob': 'bool' } } =20 ## # @SchemaInfoEvent: diff --git a/scripts/qapi/introspect.py b/scripts/qapi/introspect.py index 70ca5dd876..189a4edaba 100644 --- a/scripts/qapi/introspect.py +++ b/scripts/qapi/introspect.py @@ -184,11 +184,11 @@ const QLitObject %(c_name)s =3D %(c_string)s; success_response, boxed, allow_oob, allow_preconfig): arg_type =3D arg_type or self._schema.the_empty_object_type ret_type =3D ret_type or self._schema.the_empty_object_type - self._gen_qlit(name, 'command', - {'arg-type': self._use_type(arg_type), - 'ret-type': self._use_type(ret_type), - 'allow-oob': allow_oob}, - ifcond) + obj =3D {'arg-type': self._use_type(arg_type), + 'ret-type': self._use_type(ret_type) } + if allow_oob: + obj['allow-oob'] =3D allow_oob + self._gen_qlit(name, 'command', obj, ifcond) =20 def visit_event(self, name, info, ifcond, arg_type, boxed): arg_type =3D arg_type or self._schema.the_empty_object_type --=20 2.17.1