Skip to content

Python: move /scripts/qmp/qom* to /python/qemu/qmp/qom*

John Snow qemu-devel 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest19 patches 5 repliesIn review
  2. v272 patches 0 repliesSuperseded
  3. v115 patches 8 repliesSuperseded

Changes in v3 from the cover letter

- Technically, I sent two versions of this before, a long time ago. This has been cleaned up and based on the latest origin/master.

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/19python/pipenv: Update Pipfile.lockpython/Pipfile.lock+88 -30 replies
2/19python/qmp: Fix type of SocketAddrTpython/qemu/qmp/__init__.py+1 -11 reply
3/19python/qmp: add parse_address classmethodpython/qemu/qmp/__init__.py scripts/qmp/qmp-shell+28 -190 replies
4/19python/qmp: Add qom script rewritespython/qemu/qmp/qom.py python/qemu/qmp/qom_common.py+440 -00 replies
5/19python/qmp: add qom script entry pointspython/setup.cfg+8 -00 replies
6/19scripts/qmp: redirect qom-xxx scripts to python/qemu/qmp/scripts/qmp/qom-get scripts/qmp/qom-list scripts/qmp/qom-set +1 more+16 -2500 replies
7/19scripts/qom-fuse: apply isort rulesscripts/qmp/qom-fuse+9 -30 replies
8/19scripts/qom-fuse: apply flake8 rulesscripts/qmp/qom-fuse+43 -381 reply
9/19python: Add 'fh' to known-good variable namespython/setup.cfg+4 -30 replies
10/19scripts/qom-fuse: Apply pylint rulesscripts/qmp/qom-fuse+8 -80 replies
11/19scripts/qom-fuse: Add docstringsscripts/qmp/qom-fuse+19 -20 replies
12/19scripts/qom-fuse: Convert to QOMCommandscripts/qmp/qom-fuse+46 -130 replies
13/19scripts/qom-fuse: use QOMCommand.qom_list()scripts/qmp/qom-fuse+8 -101 reply
14/19scripts/qom-fuse: ensure QOMFuse.read always returns bytesscripts/qmp/qom-fuse+3 -30 replies
15/19scripts/qom-fuse: add static type hintspython/setup.cfg scripts/qmp/qom-fuse+25 -90 replies
16/19python: add optional FUSE dependenciespython/Pipfile.lock python/setup.cfg+14 -10 replies
17/19scripts/qom-fuse: move to python/qemu/qmp/qom_fuse.pypython/qemu/qmp/qom_fuse.py+2 -100 replies
18/19scripts/qom-fuse: add redirection shim to python/qemu/qmp/qom-fuse.pyscripts/qmp/qom-fuse+11 -00 replies
19/19python/qmp: add fuse command to 'qom' toolspython/qemu/qmp/qom.py python/setup.cfg+13 -21 reply

Reviews trailers per patch

10 of 19 patches have a Reviewed-by or Acked-by.

PatchPhilippe Mathieu-Daudé
1/19
2/19R-b
3/19
4/19
5/19R-b
6/19R-b
7/19R-b
8/19R-b
9/19
10/19R-b
11/19
12/19
13/19R-b
14/19R-b
15/19
16/19
17/19
18/19R-b
19/19R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 00/19] Python: move /scripts/qmp/qom* to /python/qemu/qmp/qom*

GitLab: https://gitlab.com/jsnow/qemu/-/commits/python-package-qom
CI: https://gitlab.com/jsnow/qemu/-/pipelines/313932818

Hello!
------

This series applies the usual linting cleanups to modernize the qom tools and then integrates them into the python packaging hierarchy.

This will help prevent further bitrot of these tools.

I don't expect or need a detailed review of the QOM tools themselves -- these tools are not used during build OR testing, and some are fairly bitrotted in places.

However, some details of how the python packaging system is being utilized here may attract your attention and could be worth a look. (Patches 5-6 and 16-19 are the interesting ones.)

Since these scripts aren't critical, I'm OK with sending a fairly hasty PR to merge these sooner rather than later.

Overview:
---------

Patch 1: Update Pipfile.lock (See the commit as for why ...)

Patches 2-3: Correct some existing typing issues in qemu.qmp

Patch 4: Combine qom-set, qom-get, (etc) into one, newly written script that makes all of the command invocations, help text, etc. consistent. (I ask that review for this patch should be limited to critical
mistakes: I have no interest in developing the QOM tools further.)

Patches 5-6: Integrate the qom tools into the python package.

Patches 7-15: Delinting of the qom_fuse script. Similarly, I am not terribly interested in further improvements here, personally.

Patches 16-19: Integrating qom-fuse into the Python packaging directory; additional care is taken to ensure that "optional" dependencies like fusepy are handled well.

Changelog
---------

V3:
- Technically, I sent two versions of this before, a long time ago. This has been cleaned up and based on the latest origin/master.

John Snow (19):
python/pipenv: Update Pipfile.lock
python/qmp: Fix type of SocketAddrT
python/qmp: add parse_address classmethod
python/qmp: Add qom script rewrites
python/qmp: add qom script entry points
scripts/qmp: redirect qom-xxx scripts to python/qemu/qmp/ scripts/qom-fuse: apply isort rules
scripts/qom-fuse: apply flake8 rules
python: Add 'fh' to known-good variable names scripts/qom-fuse: Apply pylint rules
scripts/qom-fuse: Add docstrings
scripts/qom-fuse: Convert to QOMCommand
scripts/qom-fuse: use QOMCommand.qom_list() scripts/qom-fuse: ensure QOMFuse.read always returns bytes scripts/qom-fuse: add static type hints
python: add optional FUSE dependencies
scripts/qom-fuse: move to python/qemu/qmp/qom_fuse.py scripts/qom-fuse: add redirection shim to python/qemu/qmp/qom-fuse.py python/qmp: add fuse command to 'qom' tools

 python/Pipfile.lock           |  97 +++++++++++-
 python/qemu/qmp/__init__.py   |  28 +++-
 python/qemu/qmp/qom.py        | 272 ++++++++++++++++++++++++++++++++++
 python/qemu/qmp/qom_common.py | 178 ++++++++++++++++++++++
 python/qemu/qmp/qom_fuse.py   | 206 +++++++++++++++++++++++++
 python/setup.cfg              |  33 ++++-
 scripts/qmp/qmp-shell         |  21 +--
 scripts/qmp/qom-fuse          | 144 +-----------------
 scripts/qmp/qom-get           |  66 +--------
 scripts/qmp/qom-list          |  63 +-------
 scripts/qmp/qom-set           |  63 +-------
 scripts/qmp/qom-tree          |  74 +--------
 12 files changed, 828 insertions(+), 417 deletions(-)
 create mode 100644 python/qemu/qmp/qom.py
 create mode 100644 python/qemu/qmp/qom_common.py
 create mode 100644 python/qemu/qmp/qom_fuse.py
Signature · 1 line
2.31.1