python: Fix broken ReST docstrings
authorJohn Snow <jsnow@redhat.com>
Tue, 29 Jun 2021 21:43:23 +0000 (17:43 -0400)
committerJohn Snow <jsnow@redhat.com>
Thu, 1 Jul 2021 01:57:08 +0000 (21:57 -0400)
This patch *doesn't* update all of the docstring standards across the
QEMU package directory to make our docstring usage consistent. It
*doesn't* fix the formatting to make it look pretty or reasonable in
generated output. It *does* fix a few small instances where Sphinx would
emit a build warning because of malformed ReST -- If we built our Python
docs with Sphinx.

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Willian Rampazzo <willianr@redhat.com>
Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
Message-id: 20210629214323.1329806-16-jsnow@redhat.com
Signed-off-by: John Snow <jsnow@redhat.com>
python/qemu/machine/__init__.py
python/qemu/machine/machine.py
python/qemu/qmp/__init__.py
python/qemu/qmp/qom_common.py
python/qemu/utils/accel.py

index 728f27adbedced174ecfee7ea70f32a1c94da02e..9ccd58ef14763bbd0db9f80cd330853444d9ee1b 100644 (file)
@@ -4,10 +4,10 @@ QEMU development and testing library.
 This library provides a few high-level classes for driving QEMU from a
 test suite, not intended for production use.
 
-- QEMUMachine: Configure and Boot a QEMU VM
- - QEMUQtestMachine: VM class, with a qtest socket.
+ | QEMUQtestProtocol: send/receive qtest messages.
+ | QEMUMachine: Configure and Boot a QEMU VM
+ | +-- QEMUQtestMachine: VM class, with a qtest socket.
 
-- QEMUQtestProtocol: Connect to, send/receive qtest messages.
 """
 
 # Copyright (C) 2020-2021 John Snow for Red Hat Inc.
index e3345dfa1bc835d0bc10a91b6098eeb118ff56a8..d47ab3d8965bd415921b137a1e1c9967b492081d 100644 (file)
@@ -545,7 +545,8 @@ class QEMUMachine:
         @param enabled: if False, qmp monitor options will be removed from
                         the base arguments of the resulting QEMU command
                         line. Default is True.
-        @note: call this function before launch().
+
+        .. note:: Call this function before launch().
         """
         self._qmp_set = enabled
 
index 376954cb6d275ad4cb8c5f3bf4dbd01de472d9bf..269516a79b90aa6ced483a192de5927a803ed942 100644 (file)
@@ -279,6 +279,7 @@ class QEMUMonitorProtocol:
                         None). The value passed will set the behavior of the
                         underneath QMP socket as described in [1].
                         Default value is set to 15.0.
+
         @return QMP greeting dict
         @raise OSError on socket connection errors
         @raise QMPConnectError if the greeting is not received
index f82b16772dfa2fb27b23a4b7f8dddd6515ab61b0..a59ae1a2a1883cb4d89b0e44507c5001f44357a0 100644 (file)
@@ -156,7 +156,7 @@ class QOMCommand:
         """
         Run a fully-parsed subcommand, with error-handling for the CLI.
 
-        :return: The return code from `.run()`.
+        :return: The return code from `run()`.
         """
         try:
             cmd = cls(args)
index 297933df2a316475f49bdf320c88d535d96ce945..386ff640ca81b6d3aeb096ca1a491931cf34f23e 100644 (file)
@@ -36,7 +36,7 @@ def list_accel(qemu_bin: str) -> List[str]:
     List accelerators enabled in the QEMU binary.
 
     @param qemu_bin (str): path to the QEMU binary.
-    @raise Exception: if failed to run `qemu -accel help`
+    @raise Exception: if failed to run ``qemu -accel help``
     @return a list of accelerator names.
     """
     if not qemu_bin: