diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2021-07-01 10:08:05 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2021-07-01 10:08:05 +0100 |
commit | dd62bf14b756821fa293e3465955a41e9d460deb (patch) | |
tree | 86e549043122b513008f317f590d9237454c8159 /python/qemu | |
parent | 1ec2cd0ce2ca94292ce237becc2c21b4eb9edca0 (diff) | |
parent | 5c02c865866fdd2d17e8f5507deb4aa1f74bf59f (diff) | |
download | qemu-dd62bf14b756821fa293e3465955a41e9d460deb.zip qemu-dd62bf14b756821fa293e3465955a41e9d460deb.tar.gz qemu-dd62bf14b756821fa293e3465955a41e9d460deb.tar.bz2 |
Merge remote-tracking branch 'remotes/jsnow-gitlab/tags/python-pull-request' into staging
Pull request
Patch 01/15 fixes the check-python-tox test.
# gpg: Signature made Thu 01 Jul 2021 03:01:20 BST
# gpg: using RSA key F9B7ABDBBCACDF95BE76CBD07DEF8106AAFC390E
# gpg: Good signature from "John Snow (John Huston) <jsnow@redhat.com>" [full]
# Primary key fingerprint: FAEB 9711 A12C F475 812F 18F2 88A9 064D 1835 61EB
# Subkey fingerprint: F9B7 ABDB BCAC DF95 BE76 CBD0 7DEF 8106 AAFC 390E
* remotes/jsnow-gitlab/tags/python-pull-request:
python: Fix broken ReST docstrings
python: remove auto-generated pyproject.toml file
python: Update help text on 'make clean', 'make distclean'
python: Update help text on 'make check', 'make develop'
python: add 'make check-dev' invocation
python: only check qemu/ subdir with flake8
python: Fix .PHONY Make specifiers
python: update help text for check-tox
python: rename 'venv-check' target to 'check-pipenv'
python: Add no-install usage instructions
python: README.rst touchups
python: Re-lock pipenv at *oldest* supported versions
python: Remove global pylint suppressions
python: expose typing information via PEP 561
python/qom: Do not use 'err' name at module scope
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'python/qemu')
-rw-r--r-- | python/qemu/machine/__init__.py | 6 | ||||
-rw-r--r-- | python/qemu/machine/machine.py | 6 | ||||
-rw-r--r-- | python/qemu/machine/py.typed | 0 | ||||
-rw-r--r-- | python/qemu/machine/qtest.py | 2 | ||||
-rw-r--r-- | python/qemu/qmp/__init__.py | 1 | ||||
-rw-r--r-- | python/qemu/qmp/py.typed | 0 | ||||
-rw-r--r-- | python/qemu/qmp/qom.py | 4 | ||||
-rw-r--r-- | python/qemu/qmp/qom_common.py | 2 | ||||
-rw-r--r-- | python/qemu/utils/accel.py | 2 | ||||
-rw-r--r-- | python/qemu/utils/py.typed | 0 |
10 files changed, 15 insertions, 8 deletions
diff --git a/python/qemu/machine/__init__.py b/python/qemu/machine/__init__.py index 728f27a..9ccd58e 100644 --- a/python/qemu/machine/__init__.py +++ b/python/qemu/machine/__init__.py @@ -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. diff --git a/python/qemu/machine/machine.py b/python/qemu/machine/machine.py index b624355..d47ab3d 100644 --- a/python/qemu/machine/machine.py +++ b/python/qemu/machine/machine.py @@ -84,6 +84,7 @@ class QEMUMachine: ... # vm is guaranteed to be shut down here """ + # pylint: disable=too-many-instance-attributes, too-many-public-methods def __init__(self, binary: str, @@ -111,6 +112,8 @@ class QEMUMachine: @param console_log: (optional) path to console log file @note: Qemu process is not started until launch() is used. ''' + # pylint: disable=too-many-arguments + # Direct user configuration self._binary = binary @@ -542,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 diff --git a/python/qemu/machine/py.typed b/python/qemu/machine/py.typed new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/python/qemu/machine/py.typed diff --git a/python/qemu/machine/qtest.py b/python/qemu/machine/qtest.py index 9370068..d6d9c6a 100644 --- a/python/qemu/machine/qtest.py +++ b/python/qemu/machine/qtest.py @@ -116,6 +116,8 @@ class QEMUQtestMachine(QEMUMachine): base_temp_dir: str = "/var/tmp", socket_scm_helper: Optional[str] = None, sock_dir: Optional[str] = None): + # pylint: disable=too-many-arguments + if name is None: name = "qemu-%d" % os.getpid() if sock_dir is None: diff --git a/python/qemu/qmp/__init__.py b/python/qemu/qmp/__init__.py index 376954c..269516a 100644 --- a/python/qemu/qmp/__init__.py +++ b/python/qemu/qmp/__init__.py @@ -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 diff --git a/python/qemu/qmp/py.typed b/python/qemu/qmp/py.typed new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/python/qemu/qmp/py.typed diff --git a/python/qemu/qmp/qom.py b/python/qemu/qmp/qom.py index 7ec7843..8ff28a8 100644 --- a/python/qemu/qmp/qom.py +++ b/python/qemu/qmp/qom.py @@ -38,8 +38,8 @@ from .qom_common import QOMCommand try: from .qom_fuse import QOMFuse -except ModuleNotFoundError as err: - if err.name != 'fuse': +except ModuleNotFoundError as _err: + if _err.name != 'fuse': raise else: assert issubclass(QOMFuse, QOMCommand) diff --git a/python/qemu/qmp/qom_common.py b/python/qemu/qmp/qom_common.py index f82b167..a59ae1a 100644 --- a/python/qemu/qmp/qom_common.py +++ b/python/qemu/qmp/qom_common.py @@ -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) diff --git a/python/qemu/utils/accel.py b/python/qemu/utils/accel.py index 297933d..386ff64 100644 --- a/python/qemu/utils/accel.py +++ b/python/qemu/utils/accel.py @@ -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: diff --git a/python/qemu/utils/py.typed b/python/qemu/utils/py.typed new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/python/qemu/utils/py.typed |