From nobody Mon Apr 29 01:53:47 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1513796705866924.652105459668; Wed, 20 Dec 2017 11:05:05 -0800 (PST) Received: from localhost ([::1]:36514 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRjfb-0006OQ-Mb for importer@patchew.org; Wed, 20 Dec 2017 14:04:47 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55664) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRjaX-00029c-1b for qemu-devel@nongnu.org; Wed, 20 Dec 2017 13:59:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRjaR-00060D-B3 for qemu-devel@nongnu.org; Wed, 20 Dec 2017 13:59:33 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42830) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eRjaR-0005zG-2L for qemu-devel@nongnu.org; Wed, 20 Dec 2017 13:59:27 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0C18C883BA for ; Wed, 20 Dec 2017 18:59:26 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-74.ams2.redhat.com [10.36.116.74]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CB7BD18E3E for ; Wed, 20 Dec 2017 18:59:25 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 56E411138646; Wed, 20 Dec 2017 19:59:24 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Wed, 20 Dec 2017 19:59:12 +0100 Message-Id: <20171220185924.32756-2-armbru@redhat.com> In-Reply-To: <20171220185924.32756-1-armbru@redhat.com> References: <20171220185924.32756-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 20 Dec 2017 18:59:26 +0000 (UTC) Content-Transfer-Encoding: quoted-printable 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] [PULL 01/13] qapi-schema: Fix query-vm-generation-id's doc comment markup 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-Type: text/plain; charset="utf-8" Reported-by: Daniel P. Berrange Signed-off-by: Markus Armbruster Message-Id: <20171002141341.24616-2-armbru@redhat.com> Reviewed-by: Marc-Andr=C3=A9 Lureau --- qapi-schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qapi-schema.json b/qapi-schema.json index 18457954a8..ea3723f903 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -3188,7 +3188,7 @@ # # Show Virtual Machine Generation ID # -# Since 2.9 +# Since: 2.9 ## { 'command': 'query-vm-generation-id', 'returns': 'GuidInfo' } =20 --=20 2.13.6 From nobody Mon Apr 29 01:53:47 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 Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1513796844845458.50201541806723; Wed, 20 Dec 2017 11:07:24 -0800 (PST) Received: from localhost ([::1]:36614 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRjhz-0008RF-DZ for importer@patchew.org; Wed, 20 Dec 2017 14:07:15 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55662) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRjaX-00029V-1I for qemu-devel@nongnu.org; Wed, 20 Dec 2017 13:59:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRjaR-00060P-Co for qemu-devel@nongnu.org; Wed, 20 Dec 2017 13:59:33 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52050) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eRjaR-0005zF-1o for qemu-devel@nongnu.org; Wed, 20 Dec 2017 13:59:27 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0B4304E341 for ; Wed, 20 Dec 2017 18:59:26 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-74.ams2.redhat.com [10.36.116.74]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CE3B617571 for ; Wed, 20 Dec 2017 18:59:25 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 594681138648; Wed, 20 Dec 2017 19:59:24 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Wed, 20 Dec 2017 19:59:13 +0100 Message-Id: <20171220185924.32756-3-armbru@redhat.com> In-Reply-To: <20171220185924.32756-1-armbru@redhat.com> References: <20171220185924.32756-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 20 Dec 2017 18:59:26 +0000 (UTC) Content-Transfer-Encoding: quoted-printable 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] [PULL 02/13] qapi: Stop rejecting #optional 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-Type: text/plain; charset="utf-8" Commit 1d8bda1 got rid of #optional tags, and added a check to keep them from getting added back, to make sure patches then in flight don't add them back. It's been six months, time to drop that check. Signed-off-by: Markus Armbruster Message-Id: <20171002141341.24616-3-armbru@redhat.com> Reviewed-by: Marc-Andr=C3=A9 Lureau --- scripts/qapi.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/scripts/qapi.py b/scripts/qapi.py index 62dc52ed6e..dc92bca620 100644 --- a/scripts/qapi.py +++ b/scripts/qapi.py @@ -234,10 +234,6 @@ class QAPIDoc(object): raise QAPIParseError(self.parser, "'%s' not allowed in free-form documentat= ion" % match.group(1)) - # TODO Drop this once the dust has settled - if (isinstance(self.section, QAPIDoc.ArgSection) - and '#optional' in line): - raise QAPISemError(self.info, "Please drop the #optional tag") self.section.append(line) =20 def connect_member(self, member): --=20 2.13.6 From nobody Mon Apr 29 01:53:47 2024 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) 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=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1513796801233366.08273558275584; Wed, 20 Dec 2017 11:06:41 -0800 (PST) Received: from localhost ([::1]:36589 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRjhA-0007kc-73 for importer@patchew.org; Wed, 20 Dec 2017 14:06:24 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55658) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRjaX-00029P-0S for qemu-devel@nongnu.org; Wed, 20 Dec 2017 13:59:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRjaR-00060X-DH for qemu-devel@nongnu.org; Wed, 20 Dec 2017 13:59:33 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57042) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eRjaR-0005zO-4T for qemu-devel@nongnu.org; Wed, 20 Dec 2017 13:59:27 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 170EB13AB3 for ; Wed, 20 Dec 2017 18:59:26 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-74.ams2.redhat.com [10.36.116.74]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D1B8419219 for ; Wed, 20 Dec 2017 18:59:25 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 5C022113864A; Wed, 20 Dec 2017 19:59:24 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Wed, 20 Dec 2017 19:59:14 +0100 Message-Id: <20171220185924.32756-4-armbru@redhat.com> In-Reply-To: <20171220185924.32756-1-armbru@redhat.com> References: <20171220185924.32756-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Wed, 20 Dec 2017 18:59:26 +0000 (UTC) Content-Transfer-Encoding: quoted-printable 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] [PULL 03/13] qapi: Eliminate QAPISchemaParser.__init__()'s local fname 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_6 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Markus Armbruster Message-Id: <20171002141341.24616-4-armbru@redhat.com> Reviewed-by: Marc-Andr=C3=A9 Lureau --- scripts/qapi.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/qapi.py b/scripts/qapi.py index dc92bca620..6c8001e96d 100644 --- a/scripts/qapi.py +++ b/scripts/qapi.py @@ -261,8 +261,7 @@ class QAPISchemaParser(object): =20 def __init__(self, fp, previously_included=3D[], incl_info=3DNone): abs_fname =3D os.path.abspath(fp.name) - fname =3D fp.name - self.fname =3D fname + self.fname =3D fp.name previously_included.append(abs_fname) self.incl_info =3D incl_info self.src =3D fp.read() @@ -277,7 +276,7 @@ class QAPISchemaParser(object): self.accept() =20 while self.tok is not None: - info =3D {'file': fname, 'line': self.line, + info =3D {'file': self.fname, 'line': self.line, 'parent': self.incl_info} if self.tok =3D=3D '#': self.reject_expr_doc() --=20 2.13.6 From nobody Mon Apr 29 01:53:47 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 Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 151379650769661.82466809609389; Wed, 20 Dec 2017 11:01:47 -0800 (PST) Received: from localhost ([::1]:36099 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRjcY-0003Wb-LR for importer@patchew.org; Wed, 20 Dec 2017 14:01:38 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55660) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRjaX-00029T-11 for qemu-devel@nongnu.org; Wed, 20 Dec 2017 13:59:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRjaR-00060o-Iu for qemu-devel@nongnu.org; Wed, 20 Dec 2017 13:59:33 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57044) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eRjaR-0005zb-8a for qemu-devel@nongnu.org; Wed, 20 Dec 2017 13:59:27 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3B7FE13AA3 for ; Wed, 20 Dec 2017 18:59:26 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-74.ams2.redhat.com [10.36.116.74]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D4D881757A for ; Wed, 20 Dec 2017 18:59:25 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 5F082113864E; Wed, 20 Dec 2017 19:59:24 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Wed, 20 Dec 2017 19:59:15 +0100 Message-Id: <20171220185924.32756-5-armbru@redhat.com> In-Reply-To: <20171220185924.32756-1-armbru@redhat.com> References: <20171220185924.32756-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Wed, 20 Dec 2017 18:59:26 +0000 (UTC) Content-Transfer-Encoding: quoted-printable 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] [PULL 04/13] qapi: Make cur_doc local to QAPISchemaParser.__init__() 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-Type: text/plain; charset="utf-8" QAPISchemaParser.cur_doc is used only by .__init__() and its helper .reject_expr_doc(). Make it local to __init__() and pass it to .reject_expr_doc() explicitly. Signed-off-by: Markus Armbruster Message-Id: <20171002141341.24616-5-armbru@redhat.com> Reviewed-by: Marc-Andr=C3=A9 Lureau --- scripts/qapi.py | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/scripts/qapi.py b/scripts/qapi.py index 6c8001e96d..2f2738f562 100644 --- a/scripts/qapi.py +++ b/scripts/qapi.py @@ -272,21 +272,21 @@ class QAPISchemaParser(object): self.line_pos =3D 0 self.exprs =3D [] self.docs =3D [] - self.cur_doc =3D None self.accept() + cur_doc =3D None =20 while self.tok is not None: info =3D {'file': self.fname, 'line': self.line, 'parent': self.incl_info} if self.tok =3D=3D '#': - self.reject_expr_doc() - self.cur_doc =3D self.get_doc(info) - self.docs.append(self.cur_doc) + self.reject_expr_doc(cur_doc) + cur_doc =3D self.get_doc(info) + self.docs.append(cur_doc) continue =20 expr =3D self.get_expr(False) if 'include' in expr: - self.reject_expr_doc() + self.reject_expr_doc(cur_doc) if len(expr) !=3D 1: raise QAPISemError(info, "Invalid 'include' directive") include =3D expr['include'] @@ -296,7 +296,7 @@ class QAPISchemaParser(object): self._include(include, info, os.path.dirname(abs_fname), previously_included) elif "pragma" in expr: - self.reject_expr_doc() + self.reject_expr_doc(cur_doc) if len(expr) !=3D 1: raise QAPISemError(info, "Invalid 'pragma' directive") pragma =3D expr['pragma'] @@ -308,22 +308,22 @@ class QAPISchemaParser(object): else: expr_elem =3D {'expr': expr, 'info': info} - if self.cur_doc: - if not self.cur_doc.symbol: + if cur_doc: + if not cur_doc.symbol: raise QAPISemError( - self.cur_doc.info, - "Expression documentation required") - expr_elem['doc'] =3D self.cur_doc + cur_doc.info, "Expression documentation requir= ed") + expr_elem['doc'] =3D cur_doc self.exprs.append(expr_elem) - self.cur_doc =3D None - self.reject_expr_doc() + cur_doc =3D None + self.reject_expr_doc(cur_doc) =20 - def reject_expr_doc(self): - if self.cur_doc and self.cur_doc.symbol: + @staticmethod + def reject_expr_doc(doc): + if doc and doc.symbol: raise QAPISemError( - self.cur_doc.info, + doc.info, "Documentation for '%s' is not followed by the definition" - % self.cur_doc.symbol) + % doc.symbol) =20 def _include(self, include, info, base_dir, previously_included): incl_abs_fname =3D os.path.join(base_dir, include) --=20 2.13.6 From nobody Mon Apr 29 01:53:47 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1513796945192893.0161513903291; Wed, 20 Dec 2017 11:09:05 -0800 (PST) Received: from localhost ([::1]:36656 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRjjT-0001QE-Te for importer@patchew.org; Wed, 20 Dec 2017 14:08:47 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55713) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRjaX-0002AP-TE for qemu-devel@nongnu.org; Wed, 20 Dec 2017 13:59:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRjaT-000634-1B for qemu-devel@nongnu.org; Wed, 20 Dec 2017 13:59:33 -0500 Received: from mx1.redhat.com ([209.132.183.28]:53882) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eRjaS-00061X-Lz for qemu-devel@nongnu.org; Wed, 20 Dec 2017 13:59:28 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AB159356D1 for ; Wed, 20 Dec 2017 18:59:27 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-74.ams2.redhat.com [10.36.116.74]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 51A8A196AE for ; Wed, 20 Dec 2017 18:59:27 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 6364A113864F; Wed, 20 Dec 2017 19:59:24 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Wed, 20 Dec 2017 19:59:16 +0100 Message-Id: <20171220185924.32756-6-armbru@redhat.com> In-Reply-To: <20171220185924.32756-1-armbru@redhat.com> References: <20171220185924.32756-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Wed, 20 Dec 2017 18:59:27 +0000 (UTC) Content-Transfer-Encoding: quoted-printable 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] [PULL 05/13] tests/qapi-schema/doc-bad-section: New, factored out of doc-good 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-Type: text/plain; charset="utf-8" A negative test case crept into doc-good.json: invalid use of section markup we currently fail to reject. Move this into its own doc-bad-section.json. Signed-off-by: Markus Armbruster Message-Id: <20171002141341.24616-6-armbru@redhat.com> Reviewed-by: Marc-Andr=C3=A9 Lureau --- tests/Makefile.include | 3 ++- tests/qapi-schema/doc-bad-section.err | 0 tests/qapi-schema/doc-bad-section.exit | 1 + tests/qapi-schema/doc-bad-section.json | 11 +++++++++++ tests/qapi-schema/doc-bad-section.out | 13 +++++++++++++ tests/qapi-schema/doc-good.json | 1 - tests/qapi-schema/doc-good.out | 2 +- tests/qapi-schema/doc-good.texi | 2 +- 8 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 tests/qapi-schema/doc-bad-section.err create mode 100644 tests/qapi-schema/doc-bad-section.exit create mode 100644 tests/qapi-schema/doc-bad-section.json create mode 100644 tests/qapi-schema/doc-bad-section.out diff --git a/tests/Makefile.include b/tests/Makefile.include index b4bcc872f2..f8e20d9f5d 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -416,6 +416,7 @@ qapi-schema +=3D command-int.json qapi-schema +=3D comments.json qapi-schema +=3D doc-bad-alternate-member.json qapi-schema +=3D doc-bad-command-arg.json +qapi-schema +=3D doc-bad-section.json qapi-schema +=3D doc-bad-symbol.json qapi-schema +=3D doc-bad-union-member.json qapi-schema +=3D doc-before-include.json @@ -433,10 +434,10 @@ qapi-schema +=3D doc-invalid-end2.json qapi-schema +=3D doc-invalid-return.json qapi-schema +=3D doc-invalid-section.json qapi-schema +=3D doc-invalid-start.json -qapi-schema +=3D doc-missing.json qapi-schema +=3D doc-missing-colon.json qapi-schema +=3D doc-missing-expr.json qapi-schema +=3D doc-missing-space.json +qapi-schema +=3D doc-missing.json qapi-schema +=3D doc-no-symbol.json qapi-schema +=3D double-data.json qapi-schema +=3D double-type.json diff --git a/tests/qapi-schema/doc-bad-section.err b/tests/qapi-schema/doc-= bad-section.err new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/qapi-schema/doc-bad-section.exit b/tests/qapi-schema/doc= -bad-section.exit new file mode 100644 index 0000000000..573541ac97 --- /dev/null +++ b/tests/qapi-schema/doc-bad-section.exit @@ -0,0 +1 @@ +0 diff --git a/tests/qapi-schema/doc-bad-section.json b/tests/qapi-schema/doc= -bad-section.json new file mode 100644 index 0000000000..560df4b087 --- /dev/null +++ b/tests/qapi-schema/doc-bad-section.json @@ -0,0 +1,11 @@ +# =3D section within an expression comment +# BUG: not rejected + +## +# @Enum: +# =3D=3D Produces *invalid* texinfo +# @one: The _one_ {and only} +# +# @two is undocumented +## +{ 'enum': 'Enum', 'data': [ 'one', 'two' ] } diff --git a/tests/qapi-schema/doc-bad-section.out b/tests/qapi-schema/doc-= bad-section.out new file mode 100644 index 0000000000..6fce84dd34 --- /dev/null +++ b/tests/qapi-schema/doc-bad-section.out @@ -0,0 +1,13 @@ +enum Enum ['one', 'two'] +enum QType ['none', 'qnull', 'qnum', 'qstring', 'qdict', 'qlist', 'qbool'] + prefix QTYPE +object q_empty +doc symbol=3DEnum + body=3D +=3D=3D Produces *invalid* texinfo + arg=3Done +The _one_ {and only} + arg=3Dtwo + + section=3D +@two is undocumented diff --git a/tests/qapi-schema/doc-good.json b/tests/qapi-schema/doc-good.j= son index cfdc0a8a81..97ab4625ff 100644 --- a/tests/qapi-schema/doc-good.json +++ b/tests/qapi-schema/doc-good.json @@ -51,7 +51,6 @@ =20 ## # @Enum: -# =3D=3D Produces *invalid* texinfo # @one: The _one_ {and only} # # @two is undocumented diff --git a/tests/qapi-schema/doc-good.out b/tests/qapi-schema/doc-good.out index 63ca25a8b9..c55e394e8a 100644 --- a/tests/qapi-schema/doc-good.out +++ b/tests/qapi-schema/doc-good.out @@ -77,7 +77,7 @@ Examples: - {braces} doc symbol=3DEnum body=3D -=3D=3D Produces *invalid* texinfo + arg=3Done The _one_ {and only} arg=3Dtwo diff --git a/tests/qapi-schema/doc-good.texi b/tests/qapi-schema/doc-good.t= exi index c410626e4a..a331349756 100644 --- a/tests/qapi-schema/doc-good.texi +++ b/tests/qapi-schema/doc-good.texi @@ -76,7 +76,7 @@ Examples: =20 @deftp {Enum} Enum =20 -@subsection Produces @strong{invalid} texinfo + =20 @b{Values:} @table @asis --=20 2.13.6 From nobody Mon Apr 29 01:53:47 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 Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1513796519796794.3618038569178; Wed, 20 Dec 2017 11:01:59 -0800 (PST) Received: from localhost ([::1]:36100 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRjca-0003X6-KN for importer@patchew.org; Wed, 20 Dec 2017 14:01:40 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55659) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRjaX-00029Q-00 for qemu-devel@nongnu.org; Wed, 20 Dec 2017 13:59:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRjaS-00062c-Ub for qemu-devel@nongnu.org; Wed, 20 Dec 2017 13:59:33 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34482) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eRjaS-00061E-KS for qemu-devel@nongnu.org; Wed, 20 Dec 2017 13:59:28 -0500 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 80BB0624A8 for ; Wed, 20 Dec 2017 18:59:27 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-74.ams2.redhat.com [10.36.116.74]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 50CCD5B809 for ; Wed, 20 Dec 2017 18:59:27 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 64F661138650; Wed, 20 Dec 2017 19:59:24 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Wed, 20 Dec 2017 19:59:17 +0100 Message-Id: <20171220185924.32756-7-armbru@redhat.com> In-Reply-To: <20171220185924.32756-1-armbru@redhat.com> References: <20171220185924.32756-1-armbru@redhat.com> MIME-Version: 1.0 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.39]); Wed, 20 Dec 2017 18:59:27 +0000 (UTC) Content-Transfer-Encoding: quoted-printable 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] [PULL 06/13] qapi2texi: Clean up texi_sections() 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-Type: text/plain; charset="utf-8" Repurposing the function parameter doc for stepping through doc.sections.__str__() is not nice. Use new variable @text instead. While there, eliminate variables name and func. Signed-off-by: Markus Armbruster Message-Id: <20171002141341.24616-7-armbru@redhat.com> Reviewed-by: Marc-Andr=C3=A9 Lureau --- scripts/qapi2texi.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/scripts/qapi2texi.py b/scripts/qapi2texi.py index a317526e51..f876d9a174 100755 --- a/scripts/qapi2texi.py +++ b/scripts/qapi2texi.py @@ -180,16 +180,14 @@ def texi_sections(doc): """Format additional sections following arguments""" body =3D '' for section in doc.sections: - name, doc =3D (section.name, str(section)) - func =3D texi_format - if name.startswith('Example'): - func =3D texi_example - - if name: + if section.name: # prefer @b over @strong, so txt doesn't translate it to *Foo:* - body +=3D '\n\n@b{%s:}\n' % name - - body +=3D func(doc) + body +=3D '\n\n@b{%s:}\n' % section.name + text =3D str(section) + if section.name.startswith('Example'): + body +=3D texi_example(text) + else: + body +=3D texi_format(text) return body =20 =20 --=20 2.13.6 From nobody Mon Apr 29 01:53:47 2024 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) 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=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1513797112166201.72457125504786; Wed, 20 Dec 2017 11:11:52 -0800 (PST) Received: from localhost ([::1]:36760 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRjm3-0003d2-Sw for importer@patchew.org; Wed, 20 Dec 2017 14:11:27 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55708) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRjaX-0002AM-RM for qemu-devel@nongnu.org; Wed, 20 Dec 2017 13:59:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRjaT-00063S-8x for qemu-devel@nongnu.org; Wed, 20 Dec 2017 13:59:33 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52084) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eRjaT-00061w-1w for qemu-devel@nongnu.org; Wed, 20 Dec 2017 13:59:29 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 134614DD7C for ; Wed, 20 Dec 2017 18:59:28 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-74.ams2.redhat.com [10.36.116.74]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D8DB91B46E for ; Wed, 20 Dec 2017 18:59:27 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 67EDE1138651; Wed, 20 Dec 2017 19:59:24 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Wed, 20 Dec 2017 19:59:18 +0100 Message-Id: <20171220185924.32756-8-armbru@redhat.com> In-Reply-To: <20171220185924.32756-1-armbru@redhat.com> References: <20171220185924.32756-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 20 Dec 2017 18:59:28 +0000 (UTC) Content-Transfer-Encoding: quoted-printable 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] [PULL 07/13] qapi: Unify representation of doc section without name 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_6 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" We have two representations of sections without a name: the main section uses name=3DNone, the others name=3D''. Standardize on name=3DNone. Signed-off-by: Markus Armbruster Message-Id: <20171002141341.24616-8-armbru@redhat.com> Reviewed-by: Marc-Andr=C3=A9 Lureau --- scripts/qapi.py | 2 +- scripts/qapi2texi.py | 2 +- tests/qapi-schema/doc-bad-section.out | 2 +- tests/qapi-schema/doc-good.out | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/qapi.py b/scripts/qapi.py index 2f2738f562..2137067b48 100644 --- a/scripts/qapi.py +++ b/scripts/qapi.py @@ -204,7 +204,7 @@ class QAPIDoc(object): self.section =3D QAPIDoc.ArgSection(name) self.args[name] =3D self.section =20 - def _start_section(self, name=3D''): + def _start_section(self, name=3DNone): if name in ('Returns', 'Since') and self.has_section(name): raise QAPIParseError(self.parser, "Duplicated '%s' section" % name) diff --git a/scripts/qapi2texi.py b/scripts/qapi2texi.py index f876d9a174..f16fa1ba53 100755 --- a/scripts/qapi2texi.py +++ b/scripts/qapi2texi.py @@ -184,7 +184,7 @@ def texi_sections(doc): # prefer @b over @strong, so txt doesn't translate it to *Foo:* body +=3D '\n\n@b{%s:}\n' % section.name text =3D str(section) - if section.name.startswith('Example'): + if section.name and section.name.startswith('Example'): body +=3D texi_example(text) else: body +=3D texi_format(text) diff --git a/tests/qapi-schema/doc-bad-section.out b/tests/qapi-schema/doc-= bad-section.out index 6fce84dd34..089bde1381 100644 --- a/tests/qapi-schema/doc-bad-section.out +++ b/tests/qapi-schema/doc-bad-section.out @@ -9,5 +9,5 @@ doc symbol=3DEnum The _one_ {and only} arg=3Dtwo =20 - section=3D + section=3DNone @two is undocumented diff --git a/tests/qapi-schema/doc-good.out b/tests/qapi-schema/doc-good.out index c55e394e8a..1d2c250527 100644 --- a/tests/qapi-schema/doc-good.out +++ b/tests/qapi-schema/doc-good.out @@ -82,7 +82,7 @@ doc symbol=3DEnum The _one_ {and only} arg=3Dtwo =20 - section=3D + section=3DNone @two is undocumented doc symbol=3DBase body=3D --=20 2.13.6 From nobody Mon Apr 29 01:53:47 2024 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) 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=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1513797299459701.0108387368671; Wed, 20 Dec 2017 11:14:59 -0800 (PST) Received: from localhost ([::1]:36845 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRjpC-00068B-Vg for importer@patchew.org; Wed, 20 Dec 2017 14:14:43 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55758) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRjaY-0002BM-SW for qemu-devel@nongnu.org; Wed, 20 Dec 2017 13:59:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRjaT-00063D-46 for qemu-devel@nongnu.org; Wed, 20 Dec 2017 13:59:34 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34484) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eRjaS-00061V-OY for qemu-devel@nongnu.org; Wed, 20 Dec 2017 13:59:28 -0500 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 A7F0B624DF for ; Wed, 20 Dec 2017 18:59:27 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-74.ams2.redhat.com [10.36.116.74]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 510875B816 for ; Wed, 20 Dec 2017 18:59:27 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 6AC241138656; Wed, 20 Dec 2017 19:59:24 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Wed, 20 Dec 2017 19:59:19 +0100 Message-Id: <20171220185924.32756-9-armbru@redhat.com> In-Reply-To: <20171220185924.32756-1-armbru@redhat.com> References: <20171220185924.32756-1-armbru@redhat.com> MIME-Version: 1.0 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.39]); Wed, 20 Dec 2017 18:59:27 +0000 (UTC) Content-Transfer-Encoding: quoted-printable 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] [PULL 08/13] qapi: Simplify representation of QAPIDoc section text 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_6 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Use a string instead of a list of strings. This makes qapi2texi.py generate additional blank lines. They're harmless, and the next commit will get rid of them again. Signed-off-by: Markus Armbruster Message-Id: <20171002141341.24616-9-armbru@redhat.com> Reviewed-by: Marc-Andr=C3=A9 Lureau --- scripts/qapi.py | 16 ++++++---------- scripts/qapi2texi.py | 14 +++++++------- tests/qapi-schema/doc-good.texi | 1 + tests/qapi-schema/test-qapi.py | 6 +++--- 4 files changed, 17 insertions(+), 20 deletions(-) diff --git a/scripts/qapi.py b/scripts/qapi.py index 2137067b48..e338868a52 100644 --- a/scripts/qapi.py +++ b/scripts/qapi.py @@ -106,13 +106,10 @@ class QAPIDoc(object): # optional section name (argument/member or section name) self.name =3D name # the list of lines for this section - self.content =3D [] + self.text =3D '' =20 def append(self, line): - self.content.append(line) - - def __repr__(self): - return '\n'.join(self.content).strip() + self.text +=3D line.rstrip() + '\n' =20 class ArgSection(Section): def __init__(self, name): @@ -160,7 +157,7 @@ class QAPIDoc(object): # recognized, and get silently treated as ordinary text if self.symbol: self._append_symbol_line(line) - elif not self.body.content and line.startswith('@'): + elif not self.body.text and line.startswith('@'): if not line.endswith(':'): raise QAPIParseError(self.parser, "Line should end with :") self.symbol =3D line[1:-1] @@ -214,16 +211,15 @@ class QAPIDoc(object): =20 def _end_section(self): if self.section: - contents =3D str(self.section) - if self.section.name and (not contents or contents.isspace()): + text =3D self.section.text =3D self.section.text.strip() + if self.section.name and (not text or text.isspace()): raise QAPIParseError(self.parser, "Empty doc section '%s'" % self.section.name) self.section =3D None =20 def _append_freeform(self, line): in_arg =3D isinstance(self.section, QAPIDoc.ArgSection) - if (in_arg and self.section.content - and not self.section.content[-1] + if (in_arg and self.section.text.endswith('\n\n') and line and not line[0].isspace()): self._start_section() if (in_arg or not self.section.name diff --git a/scripts/qapi2texi.py b/scripts/qapi2texi.py index f16fa1ba53..379d27643d 100755 --- a/scripts/qapi2texi.py +++ b/scripts/qapi2texi.py @@ -125,7 +125,7 @@ def texi_format(doc): =20 def texi_body(doc): """Format the main documentation body""" - return texi_format(str(doc.body)) + '\n' + return texi_format(doc.body.text) + '\n' =20 =20 def texi_enum_value(value): @@ -149,8 +149,8 @@ def texi_members(doc, what, base, variants, member_func= ): items =3D '' for section in doc.args.itervalues(): # TODO Drop fallbacks when undocumented members are outlawed - if section.content: - desc =3D texi_format(str(section)) + if section.text: + desc =3D texi_format(section.text) elif (variants and variants.tag_member =3D=3D section.member and not section.member.type.doc_type()): values =3D section.member.type.member_names() @@ -183,11 +183,10 @@ def texi_sections(doc): if section.name: # prefer @b over @strong, so txt doesn't translate it to *Foo:* body +=3D '\n\n@b{%s:}\n' % section.name - text =3D str(section) if section.name and section.name.startswith('Example'): - body +=3D texi_example(text) + body +=3D texi_example(section.text) else: - body +=3D texi_format(text) + body +=3D texi_format(section.text) return body =20 =20 @@ -240,7 +239,8 @@ class QAPISchemaGenDocVisitor(qapi.QAPISchemaVisitor): self.out +=3D '\n' if boxed: body =3D texi_body(doc) - body +=3D '\n@b{Arguments:} the members of @code{%s}' % arg_ty= pe.name + body +=3D ('\n@b{Arguments:} the members of @code{%s}\n' + % arg_type.name) body +=3D texi_sections(doc) else: body =3D texi_entity(doc, 'Arguments') diff --git a/tests/qapi-schema/doc-good.texi b/tests/qapi-schema/doc-good.t= exi index a331349756..c032f23fc1 100644 --- a/tests/qapi-schema/doc-good.texi +++ b/tests/qapi-schema/doc-good.texi @@ -230,6 +230,7 @@ If you're bored enough to read this, go see a video of = boxed cats =20 @b{Arguments:} the members of @code{Object} =20 + @b{Example:} @example -> in diff --git a/tests/qapi-schema/test-qapi.py b/tests/qapi-schema/test-qapi.py index c7724d3437..fe0ca08d78 100644 --- a/tests/qapi-schema/test-qapi.py +++ b/tests/qapi-schema/test-qapi.py @@ -61,8 +61,8 @@ for doc in schema.docs: print 'doc symbol=3D%s' % doc.symbol else: print 'doc freeform' - print ' body=3D\n%s' % doc.body + print ' body=3D\n%s' % doc.body.text for arg, section in doc.args.iteritems(): - print ' arg=3D%s\n%s' % (arg, section) + print ' arg=3D%s\n%s' % (arg, section.text) for section in doc.sections: - print ' section=3D%s\n%s' % (section.name, section) + print ' section=3D%s\n%s' % (section.name, section.text) --=20 2.13.6 From nobody Mon Apr 29 01:53:47 2024 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) 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=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1513797069663766.3462580313733; Wed, 20 Dec 2017 11:11:09 -0800 (PST) Received: from localhost ([::1]:36751 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRjlU-0003C2-GG for importer@patchew.org; Wed, 20 Dec 2017 14:10:52 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55728) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRjaY-0002An-9z for qemu-devel@nongnu.org; Wed, 20 Dec 2017 13:59:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRjaT-000639-2w for qemu-devel@nongnu.org; Wed, 20 Dec 2017 13:59:34 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57064) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eRjaS-00061e-Mj for qemu-devel@nongnu.org; Wed, 20 Dec 2017 13:59:28 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id ADB6E13AA3 for ; Wed, 20 Dec 2017 18:59:27 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-74.ams2.redhat.com [10.36.116.74]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 54CD75278F for ; Wed, 20 Dec 2017 18:59:27 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 6DA691138657; Wed, 20 Dec 2017 19:59:24 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Wed, 20 Dec 2017 19:59:20 +0100 Message-Id: <20171220185924.32756-10-armbru@redhat.com> In-Reply-To: <20171220185924.32756-1-armbru@redhat.com> References: <20171220185924.32756-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Wed, 20 Dec 2017 18:59:27 +0000 (UTC) Content-Transfer-Encoding: quoted-printable 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] [PULL 09/13] qapi2texi: Simplify representation of section text 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_6 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Use a string instead of a list of strings. While there, generate fewer superfluous blank lines. Signed-off-by: Markus Armbruster Message-Id: <20171002141341.24616-10-armbru@redhat.com> Reviewed-by: Marc-Andr=C3=A9 Lureau --- scripts/qapi2texi.py | 33 ++++++++++++++++----------------- tests/qapi-schema/doc-good.texi | 10 ---------- 2 files changed, 16 insertions(+), 27 deletions(-) diff --git a/scripts/qapi2texi.py b/scripts/qapi2texi.py index 379d27643d..58add26c11 100755 --- a/scripts/qapi2texi.py +++ b/scripts/qapi2texi.py @@ -13,7 +13,6 @@ MSG_FMT =3D """ @deftypefn {type} {{}} {name} =20 {body} - @end deftypefn =20 """.format @@ -22,7 +21,6 @@ TYPE_FMT =3D """ @deftp {{{type}}} {name} =20 {body} - @end deftp =20 """.format @@ -74,7 +72,7 @@ def texi_format(doc): - 1. or 1): generates an @enumerate @item - */-: generates an @itemize list """ - lines =3D [] + ret =3D '' doc =3D subst_braces(doc) doc =3D subst_vars(doc) doc =3D subst_emph(doc) @@ -100,32 +98,32 @@ def texi_format(doc): line =3D '@subsection ' + line[3:] elif re.match(r'^([0-9]*\.) ', line): if not inlist: - lines.append('@enumerate') + ret +=3D '@enumerate\n' inlist =3D 'enumerate' + ret +=3D '@item\n' line =3D line[line.find(' ')+1:] - lines.append('@item') elif re.match(r'^[*-] ', line): if not inlist: - lines.append('@itemize %s' % {'*': '@bullet', - '-': '@minus'}[line[0]]) + ret +=3D '@itemize %s\n' % {'*': '@bullet', + '-': '@minus'}[line[0]] inlist =3D 'itemize' - lines.append('@item') + ret +=3D '@item\n' line =3D line[2:] elif lastempty and inlist: - lines.append('@end %s\n' % inlist) + ret +=3D '@end %s\n\n' % inlist inlist =3D '' =20 lastempty =3D empty - lines.append(line) + ret +=3D line + '\n' =20 if inlist: - lines.append('@end %s\n' % inlist) - return '\n'.join(lines) + ret +=3D '@end %s\n\n' % inlist + return ret =20 =20 def texi_body(doc): """Format the main documentation body""" - return texi_format(doc.body.text) + '\n' + return texi_format(doc.body.text) =20 =20 def texi_enum_value(value): @@ -154,10 +152,11 @@ def texi_members(doc, what, base, variants, member_fu= nc): elif (variants and variants.tag_member =3D=3D section.member and not section.member.type.doc_type()): values =3D section.member.type.member_names() - desc =3D 'One of ' + ', '.join(['@t{"%s"}' % v for v in values= ]) + members_text =3D ', '.join(['@t{"%s"}' % v for v in values]) + desc =3D 'One of ' + members_text + '\n' else: - desc =3D 'Not documented' - items +=3D member_func(section.member) + desc + '\n' + desc =3D 'Not documented\n' + items +=3D member_func(section.member) + desc if base: items +=3D '@item The members of @code{%s}\n' % base.doc_type() if variants: @@ -182,7 +181,7 @@ def texi_sections(doc): for section in doc.sections: if section.name: # prefer @b over @strong, so txt doesn't translate it to *Foo:* - body +=3D '\n\n@b{%s:}\n' % section.name + body +=3D '\n@b{%s:}\n' % section.name if section.name and section.name.startswith('Example'): body +=3D texi_example(section.text) else: diff --git a/tests/qapi-schema/doc-good.texi b/tests/qapi-schema/doc-good.t= exi index c032f23fc1..1778312581 100644 --- a/tests/qapi-schema/doc-good.texi +++ b/tests/qapi-schema/doc-good.texi @@ -101,7 +101,6 @@ Not documented the first member @end table =20 - @end deftp =20 =20 @@ -118,7 +117,6 @@ Another paragraph (but no @code{var}: line) Not documented @end table =20 - @end deftp =20 =20 @@ -127,7 +125,6 @@ Not documented =20 =20 =20 - @end deftp =20 =20 @@ -143,7 +140,6 @@ Not documented @item The members of @code{Variant2} when @code{base1} is @t{"two"} @end table =20 - @end deftp =20 =20 @@ -160,7 +156,6 @@ One of @t{"one"}, @t{"two"} @item @code{data: Variant2} when @code{type} is @t{"two"} @end table =20 - @end deftp =20 =20 @@ -182,7 +177,6 @@ argument Not documented @end table =20 - @b{Note:} @code{arg3} is undocumented =20 @@ -209,14 +203,12 @@ Duis aute irure dolor <- out @end example =20 - @b{Examples:} @example - *verbatim* - @{braces@} @end example =20 - @b{Since:} 2.10 =20 @@ -230,7 +222,6 @@ If you're bored enough to read this, go see a video of = boxed cats =20 @b{Arguments:} the members of @code{Object} =20 - @b{Example:} @example -> in @@ -238,7 +229,6 @@ If you're bored enough to read this, go see a video of = boxed cats <- out @end example =20 - @end deftypefn =20 =20 --=20 2.13.6 From nobody Mon Apr 29 01:53:47 2024 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) 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=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1513797215926233.51664313892718; Wed, 20 Dec 2017 11:13:35 -0800 (PST) Received: from localhost ([::1]:36794 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRjnj-00052x-Pp for importer@patchew.org; Wed, 20 Dec 2017 14:13:11 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55749) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRjaY-0002BI-Oi for qemu-devel@nongnu.org; Wed, 20 Dec 2017 13:59:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRjaT-00063l-MP for qemu-devel@nongnu.org; Wed, 20 Dec 2017 13:59:34 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52086) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eRjaT-00062A-8e for qemu-devel@nongnu.org; Wed, 20 Dec 2017 13:59:29 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 426214E919 for ; Wed, 20 Dec 2017 18:59:28 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-74.ams2.redhat.com [10.36.116.74]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E01A21B476 for ; Wed, 20 Dec 2017 18:59:27 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 7089D1138662; Wed, 20 Dec 2017 19:59:24 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Wed, 20 Dec 2017 19:59:21 +0100 Message-Id: <20171220185924.32756-11-armbru@redhat.com> In-Reply-To: <20171220185924.32756-1-armbru@redhat.com> References: <20171220185924.32756-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 20 Dec 2017 18:59:28 +0000 (UTC) Content-Transfer-Encoding: quoted-printable 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] [PULL 10/13] qapi: Rename QAPIDoc.parser, .section to ._parser, ._section 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_6 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Markus Armbruster Message-Id: <20171002141341.24616-11-armbru@redhat.com> Reviewed-by: Marc-Andr=C3=A9 Lureau --- scripts/qapi.py | 52 ++++++++++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/scripts/qapi.py b/scripts/qapi.py index e338868a52..43a54bf40f 100644 --- a/scripts/qapi.py +++ b/scripts/qapi.py @@ -120,11 +120,11 @@ class QAPIDoc(object): self.member =3D member =20 def __init__(self, parser, info): - # self.parser is used to report errors with QAPIParseError. The + # self._parser is used to report errors with QAPIParseError. The # resulting error position depends on the state of the parser. # It happens to be the beginning of the comment. More or less # servicable, but action at a distance. - self.parser =3D parser + self._parser =3D parser self.info =3D info self.symbol =3D None self.body =3D QAPIDoc.Section() @@ -133,7 +133,7 @@ class QAPIDoc(object): # a list of Section self.sections =3D [] # the current section - self.section =3D self.body + self._section =3D self.body =20 def has_section(self, name): """Return True if we have a section with this name.""" @@ -150,7 +150,7 @@ class QAPIDoc(object): return =20 if line[0] !=3D ' ': - raise QAPIParseError(self.parser, "Missing space after #") + raise QAPIParseError(self._parser, "Missing space after #") line =3D line[1:] =20 # FIXME not nice: things like '# @foo:' and '# @foo: ' aren't @@ -159,11 +159,11 @@ class QAPIDoc(object): self._append_symbol_line(line) elif not self.body.text and line.startswith('@'): if not line.endswith(':'): - raise QAPIParseError(self.parser, "Line should end with :") + raise QAPIParseError(self._parser, "Line should end with := ") self.symbol =3D line[1:-1] # FIXME invalid names other than the empty string aren't flagg= ed if not self.symbol: - raise QAPIParseError(self.parser, "Invalid name") + raise QAPIParseError(self._parser, "Invalid name") else: self._append_freeform(line) =20 @@ -189,48 +189,48 @@ class QAPIDoc(object): def _start_args_section(self, name): # FIXME invalid names other than the empty string aren't flagged if not name: - raise QAPIParseError(self.parser, "Invalid parameter name") + raise QAPIParseError(self._parser, "Invalid parameter name") if name in self.args: - raise QAPIParseError(self.parser, + raise QAPIParseError(self._parser, "'%s' parameter name duplicated" % name) if self.sections: - raise QAPIParseError(self.parser, + raise QAPIParseError(self._parser, "'@%s:' can't follow '%s' section" % (name, self.sections[0].name)) self._end_section() - self.section =3D QAPIDoc.ArgSection(name) - self.args[name] =3D self.section + self._section =3D QAPIDoc.ArgSection(name) + self.args[name] =3D self._section =20 def _start_section(self, name=3DNone): if name in ('Returns', 'Since') and self.has_section(name): - raise QAPIParseError(self.parser, + raise QAPIParseError(self._parser, "Duplicated '%s' section" % name) self._end_section() - self.section =3D QAPIDoc.Section(name) - self.sections.append(self.section) + self._section =3D QAPIDoc.Section(name) + self.sections.append(self._section) =20 def _end_section(self): - if self.section: - text =3D self.section.text =3D self.section.text.strip() - if self.section.name and (not text or text.isspace()): - raise QAPIParseError(self.parser, "Empty doc section '%s'" - % self.section.name) - self.section =3D None + if self._section: + text =3D self._section.text =3D self._section.text.strip() + if self._section.name and (not text or text.isspace()): + raise QAPIParseError(self._parser, "Empty doc section '%s'" + % self._section.name) + self._section =3D None =20 def _append_freeform(self, line): - in_arg =3D isinstance(self.section, QAPIDoc.ArgSection) - if (in_arg and self.section.text.endswith('\n\n') + in_arg =3D isinstance(self._section, QAPIDoc.ArgSection) + if (in_arg and self._section.text.endswith('\n\n') and line and not line[0].isspace()): self._start_section() - if (in_arg or not self.section.name - or not self.section.name.startswith('Example')): + if (in_arg or not self._section.name + or not self._section.name.startswith('Example')): line =3D line.strip() match =3D re.match(r'(@\S+:)', line) if match: - raise QAPIParseError(self.parser, + raise QAPIParseError(self._parser, "'%s' not allowed in free-form documentat= ion" % match.group(1)) - self.section.append(line) + self._section.append(line) =20 def connect_member(self, member): if member.name not in self.args: --=20 2.13.6 From nobody Mon Apr 29 01:53:47 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 Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1513796994531592.8018564594437; Wed, 20 Dec 2017 11:09:54 -0800 (PST) Received: from localhost ([::1]:36665 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRjkI-00023x-Cm for importer@patchew.org; Wed, 20 Dec 2017 14:09:38 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55666) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRjaX-00029d-2t for qemu-devel@nongnu.org; Wed, 20 Dec 2017 13:59:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRjaS-00062Q-Ra for qemu-devel@nongnu.org; Wed, 20 Dec 2017 13:59:32 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34352) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eRjaS-00061F-KR for qemu-devel@nongnu.org; Wed, 20 Dec 2017 13:59:28 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8B24B7C830 for ; Wed, 20 Dec 2017 18:59:27 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-74.ams2.redhat.com [10.36.116.74]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 58794619AF for ; Wed, 20 Dec 2017 18:59:27 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 737D41138663; Wed, 20 Dec 2017 19:59:24 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Wed, 20 Dec 2017 19:59:22 +0100 Message-Id: <20171220185924.32756-12-armbru@redhat.com> In-Reply-To: <20171220185924.32756-1-armbru@redhat.com> References: <20171220185924.32756-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Wed, 20 Dec 2017 18:59:27 +0000 (UTC) Content-Transfer-Encoding: quoted-printable 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] [PULL 11/13] qapi2texi: De-duplicate code to add blank line before symbol 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-Type: text/plain; charset="utf-8" Signed-off-by: Markus Armbruster Message-Id: <20171002141341.24616-12-armbru@redhat.com> Reviewed-by: Marc-Andr=C3=A9 Lureau --- scripts/qapi2texi.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/scripts/qapi2texi.py b/scripts/qapi2texi.py index 58add26c11..92e2af2cd6 100755 --- a/scripts/qapi2texi.py +++ b/scripts/qapi2texi.py @@ -206,8 +206,6 @@ class QAPISchemaGenDocVisitor(qapi.QAPISchemaVisitor): =20 def visit_enum_type(self, name, info, values, prefix): doc =3D self.cur_doc - if self.out: - self.out +=3D '\n' self.out +=3D TYPE_FMT(type=3D'Enum', name=3Ddoc.symbol, body=3Dtexi_entity(doc, 'Values', @@ -217,16 +215,12 @@ class QAPISchemaGenDocVisitor(qapi.QAPISchemaVisitor): doc =3D self.cur_doc if base and base.is_implicit(): base =3D None - if self.out: - self.out +=3D '\n' self.out +=3D TYPE_FMT(type=3D'Object', name=3Ddoc.symbol, body=3Dtexi_entity(doc, 'Members', base, vari= ants)) =20 def visit_alternate_type(self, name, info, variants): doc =3D self.cur_doc - if self.out: - self.out +=3D '\n' self.out +=3D TYPE_FMT(type=3D'Alternate', name=3Ddoc.symbol, body=3Dtexi_entity(doc, 'Members')) @@ -234,8 +228,6 @@ class QAPISchemaGenDocVisitor(qapi.QAPISchemaVisitor): def visit_command(self, name, info, arg_type, ret_type, gen, success_response, boxed): doc =3D self.cur_doc - if self.out: - self.out +=3D '\n' if boxed: body =3D texi_body(doc) body +=3D ('\n@b{Arguments:} the members of @code{%s}\n' @@ -249,13 +241,13 @@ class QAPISchemaGenDocVisitor(qapi.QAPISchemaVisitor): =20 def visit_event(self, name, info, arg_type, boxed): doc =3D self.cur_doc - if self.out: - self.out +=3D '\n' self.out +=3D MSG_FMT(type=3D'Event', name=3Ddoc.symbol, body=3Dtexi_entity(doc, 'Arguments')) =20 def symbol(self, doc, entity): + if self.out: + self.out +=3D '\n' self.cur_doc =3D doc entity.visit(self) self.cur_doc =3D None --=20 2.13.6 From nobody Mon Apr 29 01:53:47 2024 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) 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=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1513796702779691.2824104023153; Wed, 20 Dec 2017 11:05:02 -0800 (PST) Received: from localhost ([::1]:36515 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRjfc-0006Pc-3U for importer@patchew.org; Wed, 20 Dec 2017 14:04:48 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55667) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRjaX-00029g-2P for qemu-devel@nongnu.org; Wed, 20 Dec 2017 13:59:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRjaS-00062q-Vz for qemu-devel@nongnu.org; Wed, 20 Dec 2017 13:59:33 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34076) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eRjaS-00061Q-M3 for qemu-devel@nongnu.org; Wed, 20 Dec 2017 13:59:28 -0500 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 89D8C81DF7; Wed, 20 Dec 2017 18:59:27 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-74.ams2.redhat.com [10.36.116.74]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5817D5B818; Wed, 20 Dec 2017 18:59:27 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 76BA31138664; Wed, 20 Dec 2017 19:59:24 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Wed, 20 Dec 2017 19:59:23 +0100 Message-Id: <20171220185924.32756-13-armbru@redhat.com> In-Reply-To: <20171220185924.32756-1-armbru@redhat.com> References: <20171220185924.32756-1-armbru@redhat.com> MIME-Version: 1.0 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.25]); Wed, 20 Dec 2017 18:59:27 +0000 (UTC) Content-Transfer-Encoding: quoted-printable 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] [PULL 12/13] qapi-docs: fix a comment typo 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: Chen Hanxiao Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_6 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Chen Hanxiao s/Subection/Subsection Signed-off-by: Chen Hanxiao Message-Id: <20171012064448.20276-1-chen_han_xiao@126.com> Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster --- docs/devel/qapi-code-gen.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/devel/qapi-code-gen.txt b/docs/devel/qapi-code-gen.txt index f04c63fe82..06ab699066 100644 --- a/docs/devel/qapi-code-gen.txt +++ b/docs/devel/qapi-code-gen.txt @@ -63,7 +63,7 @@ Comment text starting with '=3D' is a section title: =20 Double the '=3D' for a subsection title: =20 - # =3D=3D Subection title + # =3D=3D Subsection title =20 '|' denotes examples: =20 --=20 2.13.6 From nobody Mon Apr 29 01:53:47 2024 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) 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=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1513797181212932.2038503889416; Wed, 20 Dec 2017 11:13:01 -0800 (PST) Received: from localhost ([::1]:36785 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRjnA-0004St-P8 for importer@patchew.org; Wed, 20 Dec 2017 14:12:36 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55766) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRjaY-0002BT-VL for qemu-devel@nongnu.org; Wed, 20 Dec 2017 13:59:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRjaU-00064t-99 for qemu-devel@nongnu.org; Wed, 20 Dec 2017 13:59:35 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57104) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eRjaU-00063Z-2F for qemu-devel@nongnu.org; Wed, 20 Dec 2017 13:59:30 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0A9FB2CE928; Wed, 20 Dec 2017 18:59:29 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-74.ams2.redhat.com [10.36.116.74]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8125317577; Wed, 20 Dec 2017 18:59:27 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 79B561138668; Wed, 20 Dec 2017 19:59:24 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Wed, 20 Dec 2017 19:59:24 +0100 Message-Id: <20171220185924.32756-14-armbru@redhat.com> In-Reply-To: <20171220185924.32756-1-armbru@redhat.com> References: <20171220185924.32756-1-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Wed, 20 Dec 2017 18:59:29 +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] [PULL 13/13] qmp: remove qmp_cpu 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: Daniel Henrique Barboza Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_6 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Daniel Henrique Barboza 'qmp_cpu' was implemented in commit 755f196898 ("qapi: Convert the cpu command") as a functional no-op, a QMP call that does nothing and return success. The idea, apparently, was to provide a counterpart for the HMP 'hmp_cpu' command, introduced in the same commit. After 6 years of its creation, qmp_cpu remains a functional no-op that does nothing, having no value for any caller/user. A proposal was sent to implement qmp_cpu like hmp_cpu works, but it was denied [1]. The reason is that QMP must be as stateless as possible and a function that changes its state (the current CPU monitor in the case of qmp_cpu) goes against it. Any QMP command that needs a specific monitor CPU setup must provide it in its arguments, instead of relying in the current QMP monitor state. After discussions that happened in [2] it was decided that a command that does nothing since its birth, no one uses for anything and will not be implemented, should be deprecated and erased. Given that we will *not* provide any replacement for qmp_cpu and we believe that there is no user relying on it, there is no point in adding a deprecation delay for it. So, this patch nukes qmp_cpu from QEMU code, removing both its blank implementation in qmp.c and its doc in qapi-schema.json. [1] https://lists.gnu.org/archive/html/qemu-devel/2017-12/msg02283.html [2] https://lists.gnu.org/archive/html/qemu-devel/2017-12/msg03696.html Signed-off-by: Daniel Henrique Barboza CC: Markus Armbruster CC: Eric Blake CC: Daniel P. Berrange Message-Id: <20171220102304.8288-1-danielhb@linux.vnet.ibm.com> Reviewed-by: Daniel P. Berrange Signed-off-by: Markus Armbruster --- qapi-schema.json | 11 ----------- qmp.c | 5 ----- 2 files changed, 16 deletions(-) diff --git a/qapi-schema.json b/qapi-schema.json index ea3723f903..5c06745c79 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -1046,17 +1046,6 @@ { 'command': 'system_powerdown' } =20 ## -# @cpu: -# -# This command is a nop that is only provided for the purposes of compatib= ility. -# -# Since: 0.14.0 -# -# Notes: Do not use this command. -## -{ 'command': 'cpu', 'data': {'index': 'int'} } - -## # @cpu-add: # # Adds CPU with specified ID diff --git a/qmp.c b/qmp.c index e8c303116a..52cfd2d81c 100644 --- a/qmp.c +++ b/qmp.c @@ -113,11 +113,6 @@ void qmp_system_powerdown(Error **erp) qemu_system_powerdown_request(); } =20 -void qmp_cpu(int64_t index, Error **errp) -{ - /* Just do nothing */ -} - void qmp_cpu_add(int64_t id, Error **errp) { MachineClass *mc; --=20 2.13.6