Skip to contentSkip to conversation

qapi-schema: Generated doc structure fixes

PATCH Superseded Markus Armbruster 2 participants 8 messages Aug 24, 2017

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover qapi-schema: Generated doc structure fixes

Markus Armbruster (3):
qapi-schema: Document how generated documentation is ordered
qapi-schema: Introspection doc is in the wrong section, fix
qapi-schema: Rocker doc section contains unrelated stuff, fix

 qapi-schema.json     | 21 +++++++--------------
 qapi/introspect.json |  6 ++++--
 2 files changed, 11 insertions(+), 16 deletions(-)
Signature · 1 line
2.7.5
#1 lore raw

PATCH 1/3 qapi-schema: Document how generated documentation is ordered

Documentation generated with qapi2texi.py is in textual order, with included sub-schemas inserted at the first include directive (subsequent include directives have no effect). To get a sane and stable order, it's best to include each sub-schema just once, or include it first in qapi-schema.json. Document that.

While there, drop a few redundant comments.

---
 qapi-schema.json | 17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)
qapi-schema.json +6 -11
index 802ea53..76b5888 100644
@@ -72,22 +72,17 @@
         'q_obj_CpuInfo-base'    # CPU, visible through query-cpu
     ] } }
 
-# QAPI common definitions
+# Documentation generated with qapi2texi.py is in textual order, with
+# included sub-schemas inserted at the first include directive
+# (subsequent include directives have no effect).  To get a sane and
+# stable order, it's best to include each sub-schema just once, or
+# include it first in qapi-schema.json.
+
 { 'include': 'qapi/common.json' }
-
-# QAPI crypto definitions
 { 'include': 'qapi/crypto.json' }
-
-# QAPI block definitions
 { 'include': 'qapi/block.json' }
-
-# QAPI event definitions
 { 'include': 'qapi/event.json' }
-
-# Tracing commands
 { 'include': 'qapi/trace.json' }
-
-# QAPI introspection
 { 'include': 'qapi/introspect.json' }
 
 ##
Signature · 1 line
2.7.5
Reviewed-by on v1 1/3
#2 lore raw

Re: [Qemu-devel] [PATCH 1/3] qapi-schema: Document how generated documentation is ordered

Quoted 9 lines · Markus Armbruster

Documentation generated with qapi2texi.py is in textual order, with included sub-schemas inserted at the first include directive (subsequent include directives have no effect). To get a sane and stable order, it's best to include each sub-schema just once, or include it first in qapi-schema.json. Document that.

While there, drop a few redundant comments.

Quoted 41 lines
---
 qapi-schema.json | 17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)
qapi-schema.json +6 -12
index 802ea53..76b5888 100644
@@ -72,22 +72,17 @@
         'q_obj_CpuInfo-base'    # CPU, visible through query-cpu
     ] } }
 
-# QAPI common definitions
+# Documentation generated with qapi2texi.py is in textual order, with
+# included sub-schemas inserted at the first include directive
+# (subsequent include directives have no effect).  To get a sane and
+# stable order, it's best to include each sub-schema just once, or
+# include it first in qapi-schema.json.
+
 { 'include': 'qapi/common.json' }
-
-# QAPI crypto definitions
 { 'include': 'qapi/crypto.json' }
-
-# QAPI block definitions
 { 'include': 'qapi/block.json' }
-
-# QAPI event definitions
 { 'include': 'qapi/event.json' }
-
-# Tracing commands
 { 'include': 'qapi/trace.json' }
-
-# QAPI introspection
 { 'include': 'qapi/introspect.json' }
 
 ##
--

2.7.5

Signature · 1 line
Marc-André Lureau
#3 lore raw

PATCH 2/3 qapi-schema: Introspection doc is in the wrong section, fix

In reply to Markus Armbruster

Bug: introspection documentation is in section "Tracing commands".

Cause: sub-schema qapi/introspect.json lacks a section header, and therefore goes into whatever section precedes its include.

Fix: add a section header.

---
 qapi/introspect.json | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
qapi/introspect.json +4 -2
index cf77ff0..5b3e6e9 100644
@@ -1,7 +1,5 @@
 # -*- Mode: Python -*-
 #
-# QAPI/QMP introspection
-#
 # Copyright (C) 2015 Red Hat, Inc.
 #
 # Authors:
@@ -11,6 +9,10 @@
 # See the COPYING file in the top-level directory.
 
 ##
+# = QMP introspection
+##
+
+##
 # @query-qmp-schema:
 #
 # Command query-qmp-schema exposes the QMP wire ABI as an array of
Signature · 1 line
2.7.5
Reviewed-by on v1 2/3
#4 lore raw

Re: [Qemu-devel] [PATCH 2/3] qapi-schema: Introspection doc is in the wrong section, fix

Quoted 8 lines · Markus Armbruster

Bug: introspection documentation is in section "Tracing commands".

Cause: sub-schema qapi/introspect.json lacks a section header, and therefore goes into whatever section precedes its include.

Fix: add a section header.

Quoted 31 lines
---
 qapi/introspect.json | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
qapi/introspect.json +4 -3
index cf77ff0..5b3e6e9 100644
@@ -1,7 +1,5 @@
 # -*- Mode: Python -*-
 #
-# QAPI/QMP introspection
-#
 # Copyright (C) 2015 Red Hat, Inc.
 #
 # Authors:
@@ -11,6 +9,10 @@
 # See the COPYING file in the top-level directory.
 
 ##
+# = QMP introspection
+##
+
+##
 # @query-qmp-schema:
 #
 # Command query-qmp-schema exposes the QMP wire ABI as an array of
--

2.7.5

Signature · 1 line
Marc-André Lureau
#5 lore raw

PATCH 3/3 qapi-schema: Rocker doc section contains unrelated stuff, fix

In reply to Markus Armbruster

Bug: section "Rocker switch device" starts with the rocker stuff, but then has unrelated stuff, like ReplayMode, xen-load-devices-state, ...

Cause: rocker.json is included in the middle of section "QMP commands".

Fix: include it in a sane place, namely next to the other sub-schemas.

---
 qapi-schema.json | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
qapi-schema.json +1 -3
index 76b5888..81cef23 100644
@@ -82,6 +82,7 @@
 { 'include': 'qapi/crypto.json' }
 { 'include': 'qapi/block.json' }
 { 'include': 'qapi/event.json' }
+{ 'include': 'qapi/rocker.json' }
 { 'include': 'qapi/trace.json' }
 { 'include': 'qapi/introspect.json' }
 
@@ -6273,9 +6274,6 @@
 ##
 { 'command': 'rtc-reset-reinjection' }
 
-# Rocker ethernet network switch
-{ 'include': 'qapi/rocker.json' }
-
 ##
 # @ReplayMode:
 #
Signature · 1 line
2.7.5
#6 lore raw

Re: [Qemu-devel] [PATCH 3/3] qapi-schema: Rocker doc section contains unrelated stuff, fix

Quoted 39 lines · Markus Armbruster

Bug: section "Rocker switch device" starts with the rocker stuff, but then has unrelated stuff, like ReplayMode, xen-load-devices-state, ...

Cause: rocker.json is included in the middle of section "QMP commands".

Fix: include it in a sane place, namely next to the other sub-schemas.

---
 qapi-schema.json | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
qapi-schema.json +1 -4
index 76b5888..81cef23 100644
@@ -82,6 +82,7 @@
 { 'include': 'qapi/crypto.json' }
 { 'include': 'qapi/block.json' }
 { 'include': 'qapi/event.json' }
+{ 'include': 'qapi/rocker.json' }
 { 'include': 'qapi/trace.json' }
 { 'include': 'qapi/introspect.json' }
 
@@ -6273,9 +6274,6 @@
 ##
 { 'command': 'rtc-reset-reinjection' }
 
-# Rocker ethernet network switch
-{ 'include': 'qapi/rocker.json' }
-
 ##
 # @ReplayMode:
 #
--

2.7.5

Signature · 1 line
Marc-André Lureau
Reviewed-by on v1 3/3
#7 lore raw

Re: [Qemu-devel] [PATCH 3/3] qapi-schema: Rocker doc section contains unrelated stuff, fix

In reply to Markus Armbruster
Quoted 8 lines · Markus Armbruster

Bug: section "Rocker switch device" starts with the rocker stuff, but then has unrelated stuff, like ReplayMode, xen-load-devices-state, ...

Cause: rocker.json is included in the middle of section "QMP commands".

Fix: include it in a sane place, namely next to the other sub-schemas.

Quoted 30 lines
---
 qapi-schema.json | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
qapi-schema.json +1 -4
index 76b5888..81cef23 100644
@@ -82,6 +82,7 @@
 { 'include': 'qapi/crypto.json' }
 { 'include': 'qapi/block.json' }
 { 'include': 'qapi/event.json' }
+{ 'include': 'qapi/rocker.json' }
 { 'include': 'qapi/trace.json' }
 { 'include': 'qapi/introspect.json' }
 
@@ -6273,9 +6274,6 @@
 ##
 { 'command': 'rtc-reset-reinjection' }
 
-# Rocker ethernet network switch
-{ 'include': 'qapi/rocker.json' }
-
 ##
 # @ReplayMode:
 #
--

2.7.5

Signature · 1 line
Marc-André Lureau