Skip to contentSkip to conversation

docs: more conversions from txt to rst

PATCH In review Peter Maydell 3 participants 12 messages Aug 1, 2024 – Aug 8, 2024

lore
Share & tools
lore
#0 lore raw

cover docs: more conversions from txt to rst

This patchset converts four files in specs and interop from plain text to rST format. Technically this wouldn't be a bugfix but I think it's probably reasonable to put them in to 9.1 if they get review.

thanks
-- PMM

Peter Maydell (5):
docs/specs/rocker.txt: Convert to rST docs/interop/nbd.txt: Convert to rST docs/interop/parallels.txt: Convert to rST docs/interop/prl-xml.txt: Convert to rST docs/interop/prl-xml.rst: Fix minor grammar nits

 MAINTAINERS                                   |   7 +-
 docs/interop/index.rst                        |   3 +
 docs/interop/nbd.rst                          |  89 ++++++++
 docs/interop/nbd.txt                          |  72 -------
 docs/interop/{parallels.txt => parallels.rst} | 108 +++++-----
 docs/interop/prl-xml.rst                      | 192 ++++++++++++++++++
 docs/interop/prl-xml.txt                      | 158 --------------
 docs/specs/index.rst                          |   1 +
 docs/specs/{rocker.txt => rocker.rst}         | 181 +++++++++--------
 9 files changed, 438 insertions(+), 373 deletions(-)
 create mode 100644 docs/interop/nbd.rst
 delete mode 100644 docs/interop/nbd.txt
 rename docs/interop/{parallels.txt => parallels.rst} (72%)
 create mode 100644 docs/interop/prl-xml.rst
 delete mode 100644 docs/interop/prl-xml.txt
 rename docs/specs/{rocker.txt => rocker.rst} (91%)
Signature · 1 line
2.34.1
#1 lore raw

PATCH 1/5 docs/specs/rocker.txt: Convert to rST

Convert the rocker.txt specification document to rST format. We make extensive use of the :: marker to introduce a literal block for all the tables and ASCII art, rather than trying to convert the tables to rST table syntax. This produces a valid rST document without needing a huge diff.

---
 MAINTAINERS                           |   2 +-
 docs/specs/index.rst                  |   1 +
 docs/specs/{rocker.txt => rocker.rst} | 181 +++++++++++++-------------
 3 files changed, 93 insertions(+), 91 deletions(-)
 rename docs/specs/{rocker.txt => rocker.rst} (91%)
MAINTAINERS +1 -1
index 72b3c673608..2a183fe960b 100644
@@ -2463,7 +2463,7 @@ S: Maintained
 F: hw/net/rocker/
 F: qapi/rocker.json
 F: tests/rocker/
-F: docs/specs/rocker.txt
+F: docs/specs/rocker.rst
 
 e1000x
 M: Dmitry Fleytman <[email protected]>
docs/specs/index.rst +1 -0
index be899b49c28..6495ed5ed9e 100644
@@ -35,3 +35,4 @@ guest hardware that is specific to QEMU.
    vmcoreinfo
    vmgenid
    rapl-msr
+   rocker
docs/specs/rocker.rst renamed from docs/specs/rocker.txt +91 -90

510 lines not on this page · raw message

Signature · 1 line
2.34.1
#2 lore raw

PATCH 2/5 docs/interop/nbd.txt: Convert to rST

In reply to Peter Maydell

Convert nbd.txt to rST format.

---
 MAINTAINERS            |  2 +-
 docs/interop/index.rst |  1 +
 docs/interop/nbd.rst   | 89 ++++++++++++++++++++++++++++++++++++++++++
 docs/interop/nbd.txt   | 72 ----------------------------------
 4 files changed, 91 insertions(+), 73 deletions(-)
 create mode 100644 docs/interop/nbd.rst
 delete mode 100644 docs/interop/nbd.txt
MAINTAINERS +1 -1
index 2a183fe960b..dd159053dbd 100644
@@ -3869,7 +3869,7 @@ F: nbd/
 F: include/block/nbd*
 F: qemu-nbd.*
 F: blockdev-nbd.c
-F: docs/interop/nbd.txt
+F: docs/interop/nbd.rst
 F: docs/tools/qemu-nbd.rst
 F: tests/qemu-iotests/tests/*nbd*
 T: git https://repo.or.cz/qemu/ericb.git nbd
docs/interop/index.rst +1 -0
index ed65395bfb2..b9ceaabc648 100644
@@ -14,6 +14,7 @@ are useful for making QEMU interoperate with other software.
    dbus-vmstate
    dbus-display
    live-block-operations
+   nbd
    pr-helper
    qmp-spec
    qemu-ga
docs/interop/nbd.rst new file +89 -0

89 lines not on this page · raw message

docs/interop/nbd.txt deleted +0 -72

72 lines not on this page · raw message

Signature · 1 line
2.34.1
Reviewed-by on v1 2/5
#3 lore raw

Re: [PATCH 2/5] docs/interop/nbd.txt: Convert to rST

Quoted 17 lines · Peter Maydell

Convert nbd.txt to rST format.

---
 MAINTAINERS            |  2 +-
 docs/interop/index.rst |  1 +
 docs/interop/nbd.rst   | 89 ++++++++++++++++++++++++++++++++++++++++++
 docs/interop/nbd.txt   | 72 ----------------------------------
 4 files changed, 91 insertions(+), 73 deletions(-)
 create mode 100644 docs/interop/nbd.rst
 delete mode 100644 docs/interop/nbd.txt
MAINTAINERS +0 -0
index 2a183fe960b..dd159053dbd 100644

MAINTAINERS F: nbd/ · line 3872

Quoted 5 lines
MAINTAINERS +1 -1
@@ -3869,7 +3869,7 @@ F: nbd/
 F: include/block/nbd*
 F: qemu-nbd.*
 F: blockdev-nbd.c
-F: docs/interop/nbd.txt
+F: docs/interop/nbd.rst

Upstream NBD has a link to the nbd.txt page; I'll have to update that link to the new name. Is it worth creating a git symlink so the old name remains a stable point to link to (even though it is no longer purely text)?

Quoted 21 lines
MAINTAINERS +0 -0
 F: docs/tools/qemu-nbd.rst
 F: tests/qemu-iotests/tests/*nbd*
 T: git https://repo.or.cz/qemu/ericb.git nbd
docs/interop/index.rst +1 -0
index ed65395bfb2..b9ceaabc648 100644
@@ -14,6 +14,7 @@ are useful for making QEMU interoperate with other software.
    dbus-vmstate
    dbus-display
    live-block-operations
+   nbd
    pr-helper
    qmp-spec
    qemu-ga
docs/interop/nbd.rst new file +0 -0
new file mode 100644
index 00000000000..de079d31fd8

docs/interop/nbd.rst line 7

Quoted 7 lines
docs/interop/nbd.rst new file +7 -0
@@ -0,0 +1,89 @@
+QEMU NBD protocol support
+=========================
+
+QEMU supports the NBD protocol, and has an internal NBD client (see
+``block/nbd.c``), an internal NBD server (see ``blockdev-nbd.c``), and an
+external NBD server tool (see ``qemu-nbd.c``). The common code is placed
+in ``nbd/*``.

Accurate translation, and accurate information although incomplete - maybe I should do a followup patch to mention that qemu-storage-daemon can also expose an NBD server? Doesn't affect review of this patch.

Quoted 22 lines
docs/interop/nbd.rst new file +22 -0
+
+The NBD protocol is specified here:
+https://github.com/NetworkBlockDevice/nbd/blob/master/doc/proto.md
+
+The following paragraphs describe some specific properties of NBD
+protocol realization in QEMU.
+
+Metadata namespaces
+-------------------
+
+QEMU supports the ``base:allocation`` metadata context as defined in the
+NBD protocol specification, and also defines an additional metadata
+namespace ``qemu``.
+
+``qemu`` namespace
+------------------
+
+The ``qemu`` namespace currently contains two available metadata context
+types.  The first is related to exposing the contents of a dirty
+bitmap alongside the associated disk contents.  That metadata context
+is named with the following form::
+

docs/interop/nbd.rst line 39

Quoted 10 lines
docs/interop/nbd.rst new file +10 -0
+    qemu:dirty-bitmap:<dirty-bitmap-export-name>
+
+Each dirty-bitmap metadata context defines only one flag for extents
+in reply for ``NBD_CMD_BLOCK_STATUS``:
+
+bit 0:
+  ``NBD_STATE_DIRTY``, set when the extent is "dirty"
+
+The second is related to exposing the source of various extents within
+the image, with a single metadata context named::

I'm not an rst expert, so I'm assuming the difference between ending a line in : vs :: is intentional and affects the rendering; but as far as I can tell, the rendered result worked, so I don't see any problems with the patch.

Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.
Virtualization:  qemu.org | libguestfs.org
#4 lore raw

Re: [PATCH 2/5] docs/interop/nbd.txt: Convert to rST

Quoted 14 lines · Eric Blake
Quoted 12 lines · Peter Maydell

Convert nbd.txt to rST format.

---
 MAINTAINERS            |  2 +-
 docs/interop/index.rst |  1 +
 docs/interop/nbd.rst   | 89 ++++++++++++++++++++++++++++++++++++++++++
 docs/interop/nbd.txt   | 72 ----------------------------------
 4 files changed, 91 insertions(+), 73 deletions(-)
 create mode 100644 docs/interop/nbd.rst
 delete mode 100644 docs/interop/nbd.txt
Quoted 15 lines

MAINTAINERS F: nbd/ · line 3872

Quoted 10 lines
MAINTAINERS +1 -1
index 2a183fe960b..dd159053dbd 100644
@@ -3869,7 +3869,7 @@ F: nbd/
 F: include/block/nbd*
 F: qemu-nbd.*
 F: blockdev-nbd.c
-F: docs/interop/nbd.txt
+F: docs/interop/nbd.rst

Upstream NBD has a link to the nbd.txt page; I'll have to update that link to the new name. Is it worth creating a git symlink so the old name remains a stable point to link to (even though it is no longer purely text)?

I'm not super enthusiastic about doing that -- we haven't created symlinks for any of the other document conversions we've done.

Quoted 7 lines

MAINTAINERS F: nbd/ · line 3874

Quoted 2 lines
MAINTAINERS +2 -0
+The second is related to exposing the source of various extents within
+the image, with a single metadata context named::

I'm not an rst expert, so I'm assuming the difference between ending a line in : vs :: is intentional and affects the rendering; but as far as I can tell, the rendered result worked, so I don't see any problems with the patch.

Ending with double-colon is a shorthand for "display a single colon, and then the following text is a literal block". It has the same effect as if you used a single colon and then the normal double-colon-on-its-own-line to mark the literal block.

Some sentence ending in a colon:

::
This is a literal block, so it's monospaced

-- PMM

#5 lore raw

Re: [PATCH 2/5] docs/interop/nbd.txt: Convert to rST

Quoted 13 lines · Peter Maydell
Quoted 11 lines · Eric Blake

MAINTAINERS F: nbd/ · line 3872

Quoted 4 lines · Peter Maydell

Convert nbd.txt to rST format.

MAINTAINERS +1 -1
-F: docs/interop/nbd.txt
+F: docs/interop/nbd.rst

Upstream NBD has a link to the nbd.txt page; I'll have to update that link to the new name. Is it worth creating a git symlink so the old name remains a stable point to link to (even though it is no longer purely text)?

Quoted 2 lines

I'm not super enthusiastic about doing that -- we haven't created symlinks for any of the other document conversions we've done.

Okay, a stability symlink is not necessary. Currently, the NBD spec points to the raw qemu.txt because nothing is rendered into our online pages; but I plan to instead point it into the rendered version reachable from https://www.qemu.org/docs/master/interop/index.html
once your patch lands. I also found a typo in that page (right next to where nbd will appear), so I'm submitting that patch as a followup to this thread, if that's okay.

Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.
Virtualization:  qemu.org | libguestfs.org
#6 lore raw

PATCH 3/5 docs/interop/parallels.txt: Convert to rST

In reply to Peter Maydell

Convert parallels.txt to rST format.

---
 MAINTAINERS                                   |   2 +-
 docs/interop/index.rst                        |   1 +
 docs/interop/{parallels.txt => parallels.rst} | 108 ++++++++++--------
 3 files changed, 60 insertions(+), 51 deletions(-)
 rename docs/interop/{parallels.txt => parallels.rst} (72%)
MAINTAINERS +1 -1
index dd159053dbd..37cfe16fd09 100644
@@ -3962,7 +3962,7 @@ L: [email protected]
 S: Supported
 F: block/parallels.c
 F: block/parallels-ext.c
-F: docs/interop/parallels.txt
+F: docs/interop/parallels.rst
 T: git https://src.openvz.org/scm/~den/qemu.git parallels
 
 qed
docs/interop/index.rst +1 -0
index b9ceaabc648..70bba62d907 100644
@@ -15,6 +15,7 @@ are useful for making QEMU interoperate with other software.
    dbus-display
    live-block-operations
    nbd
+   parallels
    pr-helper
    qmp-spec
    qemu-ga
docs/interop/parallels.rst renamed from docs/interop/parallels.txt +58 -50

182 lines not on this page · raw message

Signature · 1 line
2.34.1
#7 lore raw

PATCH 4/5 docs/interop/prl-xml.txt: Convert to rST

In reply to Peter Maydell

Convert prl-xml.txt to rST format.

---
 MAINTAINERS              |   1 +
 docs/interop/index.rst   |   1 +
 docs/interop/prl-xml.rst | 187 +++++++++++++++++++++++++++++++++++++++
 docs/interop/prl-xml.txt | 158 ---------------------------------
 4 files changed, 189 insertions(+), 158 deletions(-)
 create mode 100644 docs/interop/prl-xml.rst
 delete mode 100644 docs/interop/prl-xml.txt
MAINTAINERS +1 -0
index 37cfe16fd09..5758509edb4 100644
@@ -3963,6 +3963,7 @@ S: Supported
 F: block/parallels.c
 F: block/parallels-ext.c
 F: docs/interop/parallels.rst
+F: docs/interop/prl-xml.rst
 T: git https://src.openvz.org/scm/~den/qemu.git parallels
 
 qed
docs/interop/index.rst +1 -0
index 70bba62d907..999e44eae19 100644
@@ -16,6 +16,7 @@ are useful for making QEMU interoperate with other software.
    live-block-operations
    nbd
    parallels
+   prl-xml
    pr-helper
    qmp-spec
    qemu-ga
docs/interop/prl-xml.rst new file +187 -0

187 lines not on this page · raw message

docs/interop/prl-xml.txt deleted +0 -158

158 lines not on this page · raw message

Signature · 1 line
2.34.1
#8 lore raw

PATCH 5/5 docs/interop/prl-xml.rst: Fix minor grammar nits

In reply to Peter Maydell

Fix some minor grammar nits in the prl-xml documentation.

---
 docs/interop/prl-xml.rst | 73 +++++++++++++++++++++-------------------
 1 file changed, 39 insertions(+), 34 deletions(-)
docs/interop/prl-xml.rst +39 -34
index aacf11f4c44..5bb63bb93a4 100644
@@ -13,15 +13,15 @@ Parallels Disk Format
    See the COPYING file in the top-level directory.
 
 This specification contains minimal information about Parallels Disk Format,
-which is enough to proper work with QEMU. Nevertheless, Parallels Cloud Server
-and Parallels Desktop are able to add some unspecified nodes to xml and use
+which is enough to properly work with QEMU. Nevertheless, Parallels Cloud Server
+and Parallels Desktop are able to add some unspecified nodes to the xml and use
 them, but they are for internal work and don't affect functionality. Also it
-uses auxiliary xml ``Snapshot.xml``, which allows to store optional snapshot
-information, but it doesn't influence open/read/write functionality. QEMU and
-other software should not use fields not covered in this document and
-``Snapshot.xml`` file and must leave them as is.
+uses auxiliary xml ``Snapshot.xml``, which allows storage of optional snapshot
+information, but this doesn't influence open/read/write functionality. QEMU and
+other software should not use fields not covered in this document or the
+``Snapshot.xml`` file, and must leave them as is.
 
-Parallels disk consists of two parts: the set of snapshots and the disk
+A Parallels disk consists of two parts: the set of snapshots and the disk
 descriptor file, which stores information about all files and snapshots.
 
 Definitions
@@ -29,7 +29,7 @@ Definitions
 
 Snapshot
   a record of the contents captured at a particular time, capable
-  of storing current state. A snapshot has UUID and parent UUID.
+  of storing current state. A snapshot has a UUID and a parent UUID.
 
 Snapshot image
   an overlay representing the difference between this
@@ -39,13 +39,13 @@ Overlay
   an image storing the different sectors between two captured states.
 
 Root image
-  snapshot image with no parent, the root of snapshot tree.
+  a snapshot image with no parent, the root of the snapshot tree.
 
 Storage
   the backing storage for a subset of the virtual disk. When
   there is more than one storage in a Parallels disk then that
   is referred to as a split image. In this case every storage
-  covers specific address space area of the disk and has its
+  covers a specific address space area of the disk and has its
   particular root image. Split images are not considered here
   and are not supported. Each storage consists of disk
   parameters and a list of images. The list of images always
@@ -55,7 +55,7 @@ Storage
 
 Description file
   ``DiskDescriptor.xml`` stores information about disk parameters,
-  snapshots, storages.
+  snapshots, and storages.
 
 Top Snapshot
   The overlay between actual state and some previous snapshot.
@@ -70,9 +70,9 @@ Description file
 
 All information is placed in a single XML element
 ``Parallels_disk_image``.
-The element has only one attribute ``Version``, that must be ``1.0``.
+The element has only one attribute, ``Version``, which must be ``1.0``.
 
-Schema of ``DiskDescriptor.xml``::
+The schema of ``DiskDescriptor.xml``::
 
  <Parallels_disk_image Version="1.0">
     <Disk_Parameters>
@@ -100,11 +100,11 @@ The ``Disk_Parameters`` element MUST contain the following child elements:
 * ``Heads``     - number of the disk heads.
 * ``Sectors``   - number of the disk sectors per cylinder
   (sector size is 512 bytes)
-  Limitation: Product of the ``Heads``, ``Sectors`` and ``Cylinders``
+  Limitation: The product of the ``Heads``, ``Sectors`` and ``Cylinders``
   values MUST be equal to the value of the Disk_size parameter.
 * ``Padding``   - must be 0. Parallels Cloud Server and Parallels Desktop may
-  use padding set to 1, however this case is not covered
-  by this spec, QEMU and other software should not open
+  use padding set to 1; however this case is not covered
+  by this specification. QEMU and other software should not open
   such disks and should not create them.
 
 ``StorageData`` element
@@ -121,20 +121,20 @@ as shown below::
     </Storage>
  </StorageData>
 
-A ``Storage`` element has following child elements:
+A ``Storage`` element has the following child elements:
 
 * ``Start``     - start sector of the storage, in case of non split storage
   equals to 0.
 * ``End``       - number of sector following the last sector, in case of non
   split storage equals to ``Disk_size``.
 * ``Blocksize`` - storage cluster size, number of sectors per one cluster.
-  Cluster size for each "Compressed" (see below) image in
-  parallels disk must be equal to this field. Note: cluster
-  size for Parallels Expandable Image is in ``tracks`` field of
+  The cluster size for each "Compressed" (see below) image in
+  a parallels disk must be equal to this field. Note: the cluster
+  size for a Parallels Expandable Image is in the ``tracks`` field of
   its header (see :doc:`parallels`).
 * Several ``Image`` child elements.
 
-Each ``Image`` element has following child elements:
+Each ``Image`` element has the following child elements:
 
 * ``GUID`` - image identifier, UUID in curly brackets.
   For instance, ``{12345678-9abc-def1-2345-6789abcdef12}.``
@@ -145,7 +145,7 @@ Each ``Image`` element has following child elements:
   * ``Plain`` for raw files.
   * ``Compressed`` for expanding disks.
 
-* ``File`` - path to image file. Path can be relative to
+* ``File`` - path to image file. The path can be relative to
   ``DiskDescriptor.xml`` or absolute.
 
 ``Snapshots`` element
@@ -171,17 +171,22 @@ Each ``Shot`` element contains the following child elements:
 * ``GUID``       - an image GUID.
 * ``ParentGUID`` - GUID of the image of the parent snapshot.
 
-The software may traverse snapshots from child to parent using ``<ParentGUID>``
-field as reference. ``ParentGUID`` of root snapshot is
-``{00000000-0000-0000-0000-000000000000}``. There should be only one root
-snapshot. Top snapshot could be described via two ways: via ``TopGUID`` child
-element of the ``Snapshots`` element or via predefined GUID
+The software may traverse snapshots from child to parent using the
+``<ParentGUID>`` field as reference. The ``ParentGUID`` of the root
+snapshot is ``{00000000-0000-0000-0000-000000000000}``.
+There should be only one root snapshot.
+
+The Top snapshot could be
+described via two ways: via the ``TopGUID`` child
+element of the ``Snapshots`` element, or via the predefined GUID
 ``{5fbaabe3-6958-40ff-92a7-860e329aab41}``. If ``TopGUID`` is defined,
-predefined GUID is interpreted as usual GUID. All snapshot images
-(except Top Snapshot) should be
-opened read-only. There is another predefined GUID,
+the predefined GUID is interpreted as a normal GUID. All snapshot images
+(except the Top Snapshot) should be
+opened read-only.
+
+There is another predefined GUID,
 ``BackupID = {704718e1-2314-44c8-9087-d78ed36b0f4e}``, which is used by
-original and some third-party software for backup, QEMU and other
-software may operate with images with ``GUID = BackupID`` as usual,
-however, it is not recommended to use this
-GUID for new disks. Top snapshot cannot have this GUID.
+original and some third-party software for backup. QEMU and other
+software may operate with images with ``GUID = BackupID`` as usual.
+However, it is not recommended to use this
+GUID for new disks. The Top snapshot cannot have this GUID.
Signature · 1 line
2.34.1
#10 lore raw
Quoted 10 lines · Richard Henderson
Quoted 6 lines · Peter Maydell

Peter Maydell (5):
docs/specs/rocker.txt: Convert to rST docs/interop/nbd.txt: Convert to rST docs/interop/parallels.txt: Convert to rST docs/interop/prl-xml.txt: Convert to rST docs/interop/prl-xml.rst: Fix minor grammar nits

Thanks. As docs changes I think these are reasonable to put into rc2, so I'm going to apply them to my target-arm.next branch, unless anybody would prefer not.

-- PMM

#11 lore raw

Re: [PATCH 6/5] docs: Typo fix in live disk backup

In reply to Peter Maydell
Quoted 4 lines · Eric Blake

Add in the missing space in the section header.

Fixes 1084159b31 ("qapi: deprecate drive-backup", v6.2.0)

Regarding the subject line using [PATCH 6/5]: I meant to send the patch in-reply-to <[email protected]> rather than as a standalone thread. Time to see if my attempt to rectify that mid-thread messes up anyone's mailer threading :)

Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.
Virtualization:  qemu.org | libguestfs.org