From nobody Mon Apr 29 12:23:11 2024 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 (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1531904827811991.7437833763775; Wed, 18 Jul 2018 02:07:07 -0700 (PDT) Received: from localhost ([::1]:35491 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ffiQD-0004Pn-Ql for importer@patchew.org; Wed, 18 Jul 2018 05:06:58 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43799) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ffiPN-00045k-4t for qemu-devel@nongnu.org; Wed, 18 Jul 2018 05:06:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ffiPJ-0003ID-VH for qemu-devel@nongnu.org; Wed, 18 Jul 2018 05:06:05 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:33814 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 1ffiPJ-0003Hb-Qb for qemu-devel@nongnu.org; Wed, 18 Jul 2018 05:06:01 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A53A540214E2 for ; Wed, 18 Jul 2018 09:06:00 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-125.ams2.redhat.com [10.36.116.125]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CC8EA178BC; Wed, 18 Jul 2018 09:05:58 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 872EB11385D6; Wed, 18 Jul 2018 11:05:57 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Wed, 18 Jul 2018 11:05:57 +0200 Message-Id: <20180718090557.17248-1-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Wed, 18 Jul 2018 09:06:00 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Wed, 18 Jul 2018 09:06:00 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.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] [PATCH for-3.0] 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: , Cc: peterx@redhat.com 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 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