All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Snow <jsnow@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Peter Xu" <peterx@redhat.com>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Stefan Berger" <stefanb@linux.vnet.ibm.com>,
	"Fabiano Rosas" <farosas@suse.de>,
	"Hanna Reitz" <hreitz@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Zhao Liu" <zhao1.liu@intel.com>, "Kevin Wolf" <kwolf@redhat.com>,
	"Ani Sinha" <anisinha@redhat.com>,
	"Pierrick Bouvier" <pierrick.bouvier@oss.qualcomm.com>,
	"Jiri Pirko" <jiri@resnulli.us>,
	"Alex Williamson" <alex@shazbot.org>,
	"Markus Armbruster" <armbru@redhat.com>,
	"Kashyap Chamarthy" <kchamart@redhat.com>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Kostiantyn Kostiuk" <kkostiuk@redhat.com>,
	"Stefan Hajnoczi" <stefanha@redhat.com>,
	"John Snow" <jsnow@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>,
	"Michael Roth" <michael.roth@amd.com>,
	"Mauro Carvalho Chehab" <mchehab+huawei@kernel.org>,
	"Vladimir Sementsov-Ogievskiy" <vsementsov@yandex-team.ru>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	qemu-block@nongnu.org, "Cédric Le Goater" <clg@redhat.com>,
	"Stefano Garzarella" <sgarzare@redhat.com>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Igor Mammedov" <imammedo@redhat.com>,
	"Jason Wang" <jasowangio@gmail.com>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Eric Blake" <eblake@redhat.com>
Subject: [PATCH 01/14] qapi: rename "plain" sections to "details"
Date: Mon, 28 Sep 2026 18:36:44 -0400	[thread overview]
Message-ID: <20260928223657.2303684-2-jsnow@redhat.com> (raw)
In-Reply-To: <20260928223657.2303684-1-jsnow@redhat.com>

With this change, we no longer have "plaintext" sections at all: they
are all now either "Intro" or "Details". This patch does not enforce
where those details sections must occur; that change occurs in a later
patch.

Signed-off-by: John Snow <jsnow@redhat.com>
---
 docs/sphinx/qapidoc.py         |  2 +-
 scripts/qapi/parser.py         | 18 +++++++++++-------
 tests/qapi-schema/doc-good.out | 18 +++++++++---------
 3 files changed, 21 insertions(+), 17 deletions(-)

diff --git a/docs/sphinx/qapidoc.py b/docs/sphinx/qapidoc.py
index 54a32e45f7e..ae57056a393 100644
--- a/docs/sphinx/qapidoc.py
+++ b/docs/sphinx/qapidoc.py
@@ -383,7 +383,7 @@ def visit_sections(self, ent: QAPISchemaDefinition) -> None:
         for section in sections:
             section.text = self.reformat_arobase(section.text)
 
-            if section.kind.name in ("PLAIN", "INTRO"):
+            if section.kind.name in ("INTRO", "DETAILS"):
                 self.visit_plaintext(section)
             elif section.kind == QAPIDoc.Kind.MEMBER:
                 assert isinstance(section, QAPIDoc.ArgSection)
diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py
index dcc04b2663e..fe284a3f866 100644
--- a/scripts/qapi/parser.py
+++ b/scripts/qapi/parser.py
@@ -674,7 +674,7 @@ class QAPIDoc:
     """
 
     class Kind(enum.Enum):
-        PLAIN = 0
+        DETAILS = 0
         MEMBER = 1
         FEATURE = 2
         RETURNS = 3
@@ -747,12 +747,16 @@ def has_features(self) -> bool:
     def end(self) -> None:
         for section in self.all_sections:
             section.text = section.text.strip('\n')
-            if not (section.kind.name in ("INTRO", "PLAIN") or section.text):
+            if (
+                    section.kind not in (
+                        QAPIDoc.Kind.INTRO, QAPIDoc.Kind.DETAILS
+                    ) and section.text == ''
+            ):
                 raise QAPISemError(
                     section.info, "text required after '%s:'" % section.kind)
 
     def ensure_untagged_section(self, info: QAPISourceInfo) -> None:
-        kind = QAPIDoc.Kind.PLAIN
+        kind = QAPIDoc.Kind.DETAILS
 
         if self.all_sections and self.all_sections[-1].kind == kind:
             # extend current section
@@ -837,8 +841,8 @@ def _insert_after_intro(
         """
         Insert a section immediately after the intro section.
 
-        While we convert PLAIN sections to INTRO sections, all
-        contiguous INTRO/PLAIN sections at the start of a QAPIDoc
+        While we convert DETAILS sections to INTRO sections, all
+        contiguous INTRO/DETAILS sections at the start of a QAPIDoc
         section list are treated as "the intro".
 
         Once INTRO conversion is complete, this helper will no longer be
@@ -855,7 +859,7 @@ def _insert_after_intro(
 
         index = 0
         for index, ref_section in enumerate(self.all_sections):
-            if ref_section.kind.name in ("PLAIN", "INTRO"):
+            if ref_section.kind.name in ("INTRO", "DETAILS"):
                 continue
             break
         else:
@@ -871,7 +875,7 @@ def append_member_stub(self, stub: 'QAPIDoc.Section') -> None:
         if self._insert_near_kind(QAPIDoc.Kind.MEMBER, stub, True):
             return
 
-        # No MEMBER sections present. Insert after INTRO/PLAIN sections.
+        # No MEMBER sections present. Insert after INTRO/DETAILS sections.
         self._insert_after_intro(stub)
 
     def connect_member(self, member: 'QAPISchemaMember') -> None:
diff --git a/tests/qapi-schema/doc-good.out b/tests/qapi-schema/doc-good.out
index eaaf119dea8..1d4fbd3762a 100644
--- a/tests/qapi-schema/doc-good.out
+++ b/tests/qapi-schema/doc-good.out
@@ -54,15 +54,15 @@ event EVT_BOXED Object
     boxed=True
     feature feat3
 doc freeform
-    Plain
+    Details
 *******
 Section
 *******
 doc freeform
-    Plain
+    Details
 Just text, no heading.
 doc freeform
-    Plain
+    Details
 Subsection
 ==========
 
@@ -116,7 +116,7 @@ The _one_ {and only}, description on the same line
 Also _one_ {and only}
     Feature=enum-member-feat
 a member feature
-    Plain
+    Details
 @two is undocumented
 doc symbol=Base
     Intro
@@ -131,7 +131,7 @@ doc symbol=Variant1
     Another paragraph
     Member=var1
 
-    Plain
+    Details
 @var1 is undocumented
     Feature=variant1-feat
 a feature
@@ -157,7 +157,7 @@ description starts on the same line
     Feature=alt-feat
 a feature
 doc freeform
-    Plain
+    Details
 Another subsection
 ==================
 doc symbol=cmd
@@ -175,7 +175,7 @@ description starts on the same line
 a feature
     Feature=cmd-feat2
 another feature
-    Plain
+    Details
 .. note:: @arg3 is undocumented
     Returns
 @Object
@@ -183,7 +183,7 @@ another feature
 some
     Todo
 frobnicate
-    Plain
+    Details
 .. admonition:: Notes
 
  - Lorem ipsum dolor sit amet
@@ -217,7 +217,7 @@ doc symbol=cmd-boxed
 a feature
     Feature=cmd-feat2
 another feature
-    Plain
+    Details
 .. qmp-example::
 
    -> "this example"
-- 
2.55.0



  reply	other threads:[~2026-09-28 22:38 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-28 22:36 [PATCH 00/14] qapi: enforce section ordering John Snow
2026-09-28 22:36 ` John Snow [this message]
2026-09-29 11:49   ` [PATCH 01/14] qapi: rename "plain" sections to "details" Markus Armbruster
2026-09-29 14:36     ` John Snow
2026-09-28 22:36 ` [PATCH 02/14] docs/qapi-code-gen: expand each section's syntax into a mini-section John Snow
2026-09-28 22:36 ` [PATCH 03/14] qapi: re-order QAPI doc block sections John Snow
2026-09-29 12:10   ` Markus Armbruster
2026-09-29 14:32     ` John Snow
2026-09-28 22:36 ` [PATCH 04/14] qapi/parser: enforce doc block section ordering John Snow
2026-09-29 12:36   ` Markus Armbruster
2026-09-29 14:31     ` John Snow
2026-09-29 15:00       ` Markus Armbruster
2026-09-28 22:36 ` [PATCH 05/14] qapi: move 'details' sections to the bottom of doc blocks John Snow
2026-10-01 11:14   ` Markus Armbruster
2026-09-28 22:36 ` [PATCH 06/14] qapi/parser: enforce 'details' sections' relative position John Snow
2026-09-28 22:36 ` [PATCH 07/14] qapi: re-order 'since' sections to always be last John Snow
2026-09-28 22:36 ` [PATCH 08/14] qapi/parser: enforce strict positioning for "Since:" section John Snow
2026-09-29 12:53   ` Markus Armbruster
2026-09-29 14:25     ` John Snow
2026-09-29 15:04       ` Markus Armbruster
2026-09-28 22:36 ` [PATCH 09/14] qapi/parser: remove _insert_after_intro() helper John Snow
2026-09-29 13:09   ` Markus Armbruster
2026-09-29 14:19     ` John Snow
2026-09-29 15:08       ` Markus Armbruster
2026-09-28 22:36 ` [PATCH 10/14] qapi/parser: add _append() method John Snow
2026-09-29 13:28   ` Markus Armbruster
2026-09-29 14:14     ` John Snow
2026-09-29 15:09       ` Markus Armbruster
2026-09-28 22:36 ` [PATCH 11/14] qapi/parser: privatize "all_sections" field as "_sections" John Snow
2026-10-02  8:51   ` Markus Armbruster
2026-09-28 22:36 ` [PATCH 12/14] qapi/parser: add _active_section private member John Snow
2026-09-28 22:36 ` [PATCH 13/14] qapi/parser: add new _sections mapping John Snow
2026-10-02  7:24   ` Markus Armbruster
2026-09-28 22:36 ` [PATCH 14/14] qapi/parser: convert single-section properties to getter properties John Snow
2026-10-02  9:44   ` Markus Armbruster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260928223657.2303684-2-jsnow@redhat.com \
    --to=jsnow@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=alex@shazbot.org \
    --cc=anisinha@redhat.com \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=clg@redhat.com \
    --cc=eblake@redhat.com \
    --cc=farosas@suse.de \
    --cc=hreitz@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=jasowangio@gmail.com \
    --cc=jiri@resnulli.us \
    --cc=kchamart@redhat.com \
    --cc=kkostiuk@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=mchehab+huawei@kernel.org \
    --cc=michael.roth@amd.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=peterx@redhat.com \
    --cc=philmd@oss.qualcomm.com \
    --cc=pierrick.bouvier@oss.qualcomm.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=sgarzare@redhat.com \
    --cc=stefanb@linux.vnet.ibm.com \
    --cc=stefanha@redhat.com \
    --cc=vsementsov@yandex-team.ru \
    --cc=zhao1.liu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.