Skip to contentSkip to conversation

qapi: Doc comment cleanups

PATCH In review Markus Armbruster 4 participants 16 messages Jul 11, 2024 – Jul 17, 2024

lore
Share & tools
lore
#0 lore raw

cover qapi: Doc comment cleanups

Markus Armbruster (5):
qapi/pci: Clean up documentation around PciDeviceClass qapi/machine: Clean up documentation around CpuInstanceProperties qapi/machine: Clarify query-uuid value when none has been specified qapi/sockets: Move deprecation note out of SocketAddress doc comment qapi/ui: Drop note on naming of SpiceQueryMouseMode

 qapi/machine.json | 18 ++++++++----------
 qapi/pci.json     |  6 ++----
 qapi/sockets.json |  7 +++----
 qapi/ui.json      |  2 --
 4 files changed, 13 insertions(+), 20 deletions(-)
Signature · 1 line
2.45.0
#1 lore raw

PATCH 1/5 qapi/pci: Clean up documentation around PciDeviceClass

PciDeviceInfo's doc comment has a note on PciDeviceClass member @desc. Since the note applies always, not just within PciDeviceInfo, merge it into PciDeviceClass's description of member @desc.

---
 qapi/pci.json | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
qapi/pci.json +2 -4
index 8287d15dd0..97179920fb 100644
@@ -93,7 +93,8 @@
 #
 # Information about the Class of a PCI device
 #
-# @desc: a string description of the device's class
+# @desc: a string description of the device's class (not stable, and
+#     should only be treated as informational)
 #
 # @class: the class code of the device
 #
@@ -146,9 +147,6 @@
 #
 # @regions: a list of the PCI I/O regions associated with the device
 #
-# .. note:: The contents of @class_info.desc are not stable and should
-#    only be treated as informational.
-#
 # Since: 0.14
 ##
 { 'struct': 'PciDeviceInfo',
Signature · 1 line
2.45.0
Reviewed-by on v1 1/5
#2 lore raw

Re: [PATCH 1/5] qapi/pci: Clean up documentation around PciDeviceClass

Quoted 6 lines · Markus Armbruster

PciDeviceInfo's doc comment has a note on PciDeviceClass member @desc. Since the note applies always, not just within PciDeviceInfo, merge it into PciDeviceClass's description of member @desc.

---

Quoted 32 lines
 qapi/pci.json | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
qapi/pci.json +2 -5
index 8287d15dd0..97179920fb 100644
@@ -93,7 +93,8 @@
 #
 # Information about the Class of a PCI device
 #
-# @desc: a string description of the device's class
+# @desc: a string description of the device's class (not stable, and
+#     should only be treated as informational)
 #
 # @class: the class code of the device
 #
@@ -146,9 +147,6 @@
 #
 # @regions: a list of the PCI I/O regions associated with the device
 #
-# .. note:: The contents of @class_info.desc are not stable and should
-#    only be treated as informational.
-#
 # Since: 0.14
 ##
 { 'struct': 'PciDeviceInfo',
--

2.45.0

#3 lore raw

PATCH 2/5 qapi/machine: Clean up documentation around CpuInstanceProperties

In reply to Markus Armbruster

CpuInstanceProperties' doc comment describes its members as properties to be passed to device_add when hot-plugging a CPU.

This was in fact the initial use of this type, with
query-hotpluggable-cpus: letting management applications find out what properties need to be passed with device_add to hot-plug a CPU.

We've since added other uses: set-numa-node (commit 419fcdec3c1 and f3be67812c2), and query-cpus-fast (commit ce74ee3dea6). These are not about device-add.

query-hotpluggable-cpus uses CpuInstanceProperties within HotpluggableCPU. Lift the documentation related to device-add from CpuInstanceProperties to HotpluggableCPU.

---
 qapi/machine.json | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)
qapi/machine.json +6 -7
index f15ad1b43e..50ff102d56 100644
@@ -960,9 +960,7 @@
 ##
 # @CpuInstanceProperties:
 #
-# List of properties to be used for hotplugging a CPU instance, it
-# should be passed by management with device_add command when a CPU is
-# being hotplugged.
+# Properties identifying a CPU.
 #
 # Which members are optional and which mandatory depends on the
 # architecture and board.
@@ -996,9 +994,6 @@
 #
 # @thread-id: thread number within the core the CPU  belongs to
 #
-# .. note:: Management should be prepared to pass through additional
-#    properties with device_add.
-#
 # Since: 2.7
 ##
 { 'struct': 'CpuInstanceProperties',
@@ -1020,7 +1015,8 @@
 #
 # @type: CPU object type for usage with device_add command
 #
-# @props: list of properties to be used for hotplugging CPU
+# @props: list of properties to pass for hotplugging a CPU with
+#     device_add
 #
 # @vcpus-count: number of logical VCPU threads @HotpluggableCPU
 #     provides
@@ -1028,6 +1024,9 @@
 # @qom-path: link to existing CPU object if CPU is present or omitted
 #     if CPU is not present.
 #
+# .. note:: Management should be prepared to pass through additional
+#    properties with device_add.
+#
 # Since: 2.7
 ##
 { 'struct': 'HotpluggableCPU',
Signature · 1 line
2.45.0
Reviewed-by on v1 2/5
#4 lore raw

Re: [PATCH 2/5] qapi/machine: Clean up documentation around CpuInstanceProperties

Quoted 11 lines · Markus Armbruster

CpuInstanceProperties' doc comment describes its members as properties to be passed to device_add when hot-plugging a CPU.

This was in fact the initial use of this type, with
query-hotpluggable-cpus: letting management applications find out what properties need to be passed with device_add to hot-plug a CPU.

We've since added other uses: set-numa-node (commit 419fcdec3c1 and f3be67812c2), and query-cpus-fast (commit ce74ee3dea6). These are not about device-add.

Quoted 6 lines

query-hotpluggable-cpus uses CpuInstanceProperties within HotpluggableCPU. Lift the documentation related to device-add from CpuInstanceProperties to HotpluggableCPU.

---

Quoted 52 lines
 qapi/machine.json | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)
qapi/machine.json +6 -8
index f15ad1b43e..50ff102d56 100644
@@ -960,9 +960,7 @@
 ##
 # @CpuInstanceProperties:
 #
-# List of properties to be used for hotplugging a CPU instance, it
-# should be passed by management with device_add command when a CPU is
-# being hotplugged.
+# Properties identifying a CPU.
 #
 # Which members are optional and which mandatory depends on the
 # architecture and board.
@@ -996,9 +994,6 @@
 #
 # @thread-id: thread number within the core the CPU  belongs to
 #
-# .. note:: Management should be prepared to pass through additional
-#    properties with device_add.
-#
 # Since: 2.7
 ##
 { 'struct': 'CpuInstanceProperties',
@@ -1020,7 +1015,8 @@
 #
 # @type: CPU object type for usage with device_add command
 #
-# @props: list of properties to be used for hotplugging CPU
+# @props: list of properties to pass for hotplugging a CPU with
+#     device_add
 #
 # @vcpus-count: number of logical VCPU threads @HotpluggableCPU
 #     provides
@@ -1028,6 +1024,9 @@
 # @qom-path: link to existing CPU object if CPU is present or omitted
 #     if CPU is not present.
 #
+# .. note:: Management should be prepared to pass through additional
+#    properties with device_add.
+#
 # Since: 2.7
 ##
 { 'struct': 'HotpluggableCPU',
--

2.45.0

#5 lore raw

PATCH 3/5 qapi/machine: Clarify query-uuid value when none has been specified

In reply to Markus Armbruster

When no UUID has been specified, query-uuid returns

    {"UUID": "00000000-0000-0000-0000-000000000000"}

The doc comment calls this "a null UUID", which I find less than clear. Change it to "an all-zero UUID".

---
 qapi/machine.json | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
qapi/machine.json +2 -3
index 50ff102d56..f40427f21a 100644
@@ -305,9 +305,8 @@
 #
 # Since: 0.14
 #
-# .. note:: If no UUID was specified for the guest, a null UUID is
-#    returned.
-#
+# .. note:: If no UUID was specified for the guest, an all-zero UUID
+#    is returned.
 ##
 { 'struct': 'UuidInfo', 'data': {'UUID': 'str'} }
 
Signature · 1 line
2.45.0
Reviewed-by on v1 3/5
#6 lore raw

Re: [PATCH 3/5] qapi/machine: Clarify query-uuid value when none has been specified

Quoted 7 lines · Markus Armbruster

When no UUID has been specified, query-uuid returns

    {"UUID": "00000000-0000-0000-0000-000000000000"}

The doc comment calls this "a null UUID", which I find less than clear. Change it to "an all-zero UUID".

Technically it's a "nil UUID";
https://datatracker.ietf.org/doc/html/rfc9562#name-nil-uuid

If you wanted to be pedantic, you could say "the nil UUID (all zeroes) is returned"

but your rephrasing is clear even w/o using the standard name, so I'm fine either way.

Quoted 2 lines

---

Quoted 23 lines
 qapi/machine.json | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
qapi/machine.json +2 -4
index 50ff102d56..f40427f21a 100644
@@ -305,9 +305,8 @@
 #
 # Since: 0.14
 #
-# .. note:: If no UUID was specified for the guest, a null UUID is
-#    returned.
-#
+# .. note:: If no UUID was specified for the guest, an all-zero UUID
+#    is returned.
 ##
 { 'struct': 'UuidInfo', 'data': {'UUID': 'str'} }
 
--

2.45.0

#7 lore raw

Re: [PATCH 3/5] qapi/machine: Clarify query-uuid value when none has been specified

Quoted 10 lines · John Snow
Quoted 7 lines · Markus Armbruster

When no UUID has been specified, query-uuid returns

    {"UUID": "00000000-0000-0000-0000-000000000000"}

The doc comment calls this "a null UUID", which I find less than clear. Change it to "an all-zero UUID".

Quoted 5 lines

Technically it's a "nil UUID";
https://datatracker.ietf.org/doc/html/rfc9562#name-nil-uuid

If you wanted to be pedantic, you could say "the nil UUID (all zeroes) is returned"

Sold!

Quoted 8 lines

but your rephrasing is clear even w/o using the standard name, so I'm fine either way.

Quoted 2 lines

Thank you!

#8 lore raw

Re: [PATCH 3/5] qapi/machine: Clarify query-uuid value when none has been specified

Quoted 12 lines · Markus Armbruster
Quoted 10 lines · John Snow
Quoted 7 lines · Markus Armbruster

When no UUID has been specified, query-uuid returns

     {"UUID": "00000000-0000-0000-0000-000000000000"}

The doc comment calls this "a null UUID", which I find less than clear. Change it to "an all-zero UUID".

Quoted 5 lines
Quoted 5 lines

Technically it's a "nil UUID";
https://datatracker.ietf.org/doc/html/rfc9562#name-nil-uuid

If you wanted to be pedantic, you could say "the nil UUID (all zeroes) is returned"

#9 lore raw

PATCH 4/5 qapi/sockets: Move deprecation note out of SocketAddress doc comment

In reply to Markus Armbruster

Doc comments are reference documentation for users of QMP. SocketAddress's doc comment contains a deprecation note advising developers to use SocketAddress for new code. Irrelevant for users of QMP. Move the note out of the doc comment.

---
 qapi/sockets.json | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
qapi/sockets.json +3 -4
index 4d78d2ccb7..e76fdb9925 100644
@@ -179,10 +179,6 @@
 #
 # @type: Transport type
 #
-# .. note:: This type is deprecated in favor of SocketAddress.  The
-#    difference between SocketAddressLegacy and SocketAddress is that
-#    the latter has fewer ``{}`` on the wire.
-#
 # Since: 1.3
 ##
 { 'union': 'SocketAddressLegacy',
@@ -193,6 +189,9 @@
     'unix': 'UnixSocketAddressWrapper',
     'vsock': 'VsockSocketAddressWrapper',
     'fd': 'FdSocketAddressWrapper' } }
+# Note: This type is deprecated in favor of SocketAddress.  The
+# difference between SocketAddressLegacy and SocketAddress is that the
+# latter has fewer ``{}`` on the wire.
 
 ##
 # @SocketAddressType:
Signature · 1 line
2.45.0
Reviewed-by on v1 4/5
#10 lore raw

Re: [PATCH 4/5] qapi/sockets: Move deprecation note out of SocketAddress doc comment

Quoted 5 lines · Markus Armbruster

Doc comments are reference documentation for users of QMP. SocketAddress's doc comment contains a deprecation note advising developers to use SocketAddress for new code. Irrelevant for users of QMP. Move the note out of the doc comment.

Sure.

Quoted 2 lines

---

Quoted 32 lines
 qapi/sockets.json | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
qapi/sockets.json +3 -5
index 4d78d2ccb7..e76fdb9925 100644
@@ -179,10 +179,6 @@
 #
 # @type: Transport type
 #
-# .. note:: This type is deprecated in favor of SocketAddress.  The
-#    difference between SocketAddressLegacy and SocketAddress is that
-#    the latter has fewer ``{}`` on the wire.
-#
 # Since: 1.3
 ##
 { 'union': 'SocketAddressLegacy',
@@ -193,6 +189,9 @@
     'unix': 'UnixSocketAddressWrapper',
     'vsock': 'VsockSocketAddressWrapper',
     'fd': 'FdSocketAddressWrapper' } }
+# Note: This type is deprecated in favor of SocketAddress.  The
+# difference between SocketAddressLegacy and SocketAddress is that the
+# latter has fewer ``{}`` on the wire.
 
 ##
 # @SocketAddressType:
--

2.45.0

Reviewed-by on v1 4/5
#11 lore raw

Re: [PATCH 4/5] qapi/sockets: Move deprecation note out of SocketAddress doc comment

In reply to Markus Armbruster
Quoted 9 lines · Markus Armbruster

Doc comments are reference documentation for users of QMP. SocketAddress's doc comment contains a deprecation note advising developers to use SocketAddress for new code. Irrelevant for users of QMP. Move the note out of the doc comment.

---
  qapi/sockets.json | 7 +++----
  1 file changed, 3 insertions(+), 4 deletions(-)
#12 lore raw

PATCH 5/5 qapi/ui: Drop note on naming of SpiceQueryMouseMode

In reply to Markus Armbruster

Doc comments are reference documentation for users of QMP. SpiceQueryMouseMode's doc comment contains a note explaining why it's not named SpiceMouseMode: spice/enums.h has it already. Irrelevant for users of QMP; delete the note.

---
 qapi/ui.json | 2 --
 1 file changed, 2 deletions(-)
qapi/ui.json +0 -2
index 5bcccbfc93..df089869a5 100644
@@ -273,8 +273,6 @@
 # @unknown: No information is available about mouse mode used by the
 #     spice server.
 #
-# .. note:: spice/enums.h has a SpiceMouseMode already, hence the name.
-#
 # Since: 1.1
 ##
 { 'enum': 'SpiceQueryMouseMode',
Signature · 1 line
2.45.0
Reviewed-by on v1 5/5
#13 lore raw

Re: [PATCH 5/5] qapi/ui: Drop note on naming of SpiceQueryMouseMode

Quoted 5 lines · Markus Armbruster

Doc comments are reference documentation for users of QMP. SpiceQueryMouseMode's doc comment contains a note explaining why it's not named SpiceMouseMode: spice/enums.h has it already. Irrelevant for users of QMP; delete the note.

Hmmm, yeah, alright. I feel like this one's sorta borderline but I don't feel strongly enough about it to argue to keep it :)

Quoted 2 lines

---

Quoted 20 lines
 qapi/ui.json | 2 --
 1 file changed, 2 deletions(-)
qapi/ui.json +0 -3
index 5bcccbfc93..df089869a5 100644
@@ -273,8 +273,6 @@
 # @unknown: No information is available about mouse mode used by the
 #     spice server.
 #
-# .. note:: spice/enums.h has a SpiceMouseMode already, hence the name.
-#
 # Since: 1.1
 ##
 { 'enum': 'SpiceQueryMouseMode',
--

2.45.0

Reviewed-by on the v1 series
#14 lore raw
In reply to Markus Armbruster
Quoted 6 lines · Markus Armbruster

Markus Armbruster (5):
qapi/pci: Clean up documentation around PciDeviceClass qapi/machine: Clean up documentation around CpuInstanceProperties qapi/machine: Clarify query-uuid value when none has been specified qapi/sockets: Move deprecation note out of SocketAddress doc comment qapi/ui: Drop note on naming of SpiceQueryMouseMode

pci/machine bits:

Quoted 8 lines
 qapi/machine.json | 18 ++++++++----------
 qapi/pci.json     |  6 ++----
 qapi/sockets.json |  7 +++----
 qapi/ui.json      |  2 --
 4 files changed, 13 insertions(+), 20 deletions(-)
Signature · 1 line
2.45.0