[PATCH v2 00/25] Python: delete synchronous qemu.qmp package

John Snow posted 25 patches 2 years, 4 months ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20211215193939.3768033-1-jsnow@redhat.com
Maintainers: Kevin Wolf <kwolf@redhat.com>, Eduardo Habkost <eduardo@habkost.net>, Hanna Reitz <hreitz@redhat.com>, Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>, Cleber Rosa <crosa@redhat.com>, John Snow <jsnow@redhat.com>, Markus Armbruster <armbru@redhat.com>
There is a newer version of this series
python/qemu/qmp/README.rst                   |   9 -
python/qemu/aqmp/__init__.py                 |  51 ---
python/qemu/aqmp/legacy.py                   | 138 ------
python/qemu/aqmp/py.typed                    |   0
python/qemu/machine/machine.py               |  18 +-
python/qemu/machine/qtest.py                 |   2 +-
python/qemu/qmp/__init__.py                  | 441 ++-----------------
python/qemu/{aqmp => qmp}/aqmp_tui.py        |   2 +-
python/qemu/{aqmp => qmp}/error.py           |  12 +-
python/qemu/{aqmp => qmp}/events.py          |   6 +-
python/qemu/qmp/legacy.py                    | 319 ++++++++++++++
python/qemu/{aqmp => qmp}/message.py         |   0
python/qemu/{aqmp => qmp}/models.py          |   0
python/qemu/{aqmp => qmp}/protocol.py        |  28 +-
python/qemu/{aqmp => qmp}/qmp_client.py      |  32 +-
python/qemu/qmp/qmp_shell.py                 |  31 +-
python/qemu/{aqmp => qmp}/util.py            |   0
python/qemu/{qmp => utils}/qemu_ga_client.py |  24 +-
python/qemu/{qmp => utils}/qom.py            |   5 +-
python/qemu/{qmp => utils}/qom_common.py     |   3 +-
python/qemu/{qmp => utils}/qom_fuse.py       |  11 +-
python/setup.cfg                             |  21 +-
python/tests/protocol.py                     |  14 +-
scripts/cpu-x86-uarch-abi.py                 |   7 +-
scripts/device-crash-test                    |   4 +-
scripts/qmp/qemu-ga-client                   |   2 +-
scripts/qmp/qom-fuse                         |   2 +-
scripts/qmp/qom-get                          |   2 +-
scripts/qmp/qom-list                         |   2 +-
scripts/qmp/qom-set                          |   2 +-
scripts/qmp/qom-tree                         |   2 +-
scripts/render_block_graph.py                |   8 +-
scripts/simplebench/bench_block_job.py       |   5 +-
tests/qemu-iotests/iotests.py                |   2 +-
tests/qemu-iotests/tests/mirror-top-perms    |  13 +-
35 files changed, 490 insertions(+), 728 deletions(-)
delete mode 100644 python/qemu/qmp/README.rst
delete mode 100644 python/qemu/aqmp/__init__.py
delete mode 100644 python/qemu/aqmp/legacy.py
delete mode 100644 python/qemu/aqmp/py.typed
rename python/qemu/{aqmp => qmp}/aqmp_tui.py (99%)
rename python/qemu/{aqmp => qmp}/error.py (87%)
rename python/qemu/{aqmp => qmp}/events.py (99%)
create mode 100644 python/qemu/qmp/legacy.py
rename python/qemu/{aqmp => qmp}/message.py (100%)
rename python/qemu/{aqmp => qmp}/models.py (100%)
rename python/qemu/{aqmp => qmp}/protocol.py (97%)
rename python/qemu/{aqmp => qmp}/qmp_client.py (96%)
rename python/qemu/{aqmp => qmp}/util.py (100%)
rename python/qemu/{qmp => utils}/qemu_ga_client.py (94%)
rename python/qemu/{qmp => utils}/qom.py (99%)
rename python/qemu/{qmp => utils}/qom_common.py (98%)
rename python/qemu/{qmp => utils}/qom_fuse.py (97%)
[PATCH v2 00/25] Python: delete synchronous qemu.qmp package
Posted by John Snow 2 years, 4 months ago
GitLab: https://gitlab.com/jsnow/qemu/-/commits/python-qmp-legacy-switch
CI: https://gitlab.com/jsnow/qemu/-/pipelines/430491195

Hi, this series is part of an effort to publish the qemu.qmp package on
PyPI. It is the first of three series to complete this work:

--> (1) Switch the new Async QMP library in to python/qemu/qmp
    (2) Fork python/qemu/qmp out into its own repository,
        with updated GitLab CI/CD targets to build packages.
    (3) Update qemu.git to install qemu.qmp from PyPI,
        and then delete python/qemu/qmp.

This series swaps out qemu.qmp for qemu.aqmp permanently, instead of
hiding it behind an environment variable toggle. This leaves us with
just one QMP library to worry about. It also implements the rename of
"qemu.aqmp" to "qemu.qmp".

Who should review what?
  - iotests/block maintainers (Hanna, Vladimir, and Kevin):
    please look at patches 15-18.
  - Dan, please glance at patches 13-14.
  - Anyone who cares about Python: whatever you're willing to
    stomach. We're recently down Willian and Eduardo, so there's not
    many dedicated Python reviewers...

I suspect the most potential disruption to iotest and avocado
maintainers, as those two subsystems rely on the QMP features the
most. Would appreciate at least an ACK from each of those camps if
you're willing to give benefit-of-the-doubt on the actual Python code.

V2:
 - Integrate the renaming of qemu.aqmp to qemu.qmp in this series
 - Minor bits and pieces.

John Snow (25):
  python/aqmp: add __del__ method to legacy interface
  python/aqmp: handle asyncio.TimeoutError on execute()
  python/aqmp: copy type definitions from qmp
  python/aqmp: add SocketAddrT to package root
  python/aqmp: rename AQMPError to QMPError
  python/qemu-ga-client: update instructions to newer CLI syntax
  python/qmp: switch qemu-ga-client to AQMP
  python/qmp: switch qom tools to AQMP
  python/qmp: switch qmp-shell to AQMP
  python: move qmp utilities to python/qemu/utils
  python: move qmp-shell under the AQMP package
  python/machine: permanently switch to AQMP
  scripts/cpu-x86-uarch-abi: fix CLI parsing
  scripts/cpu-x86-uarch-abi: switch to AQMP
  scripts/render-block-graph: switch to AQMP
  scripts/bench-block-job: switch to AQMP
  iotests/mirror-top-perms: switch to AQMP
  iotests: switch to AQMP
  python: temporarily silence pylint duplicate-code warnings
  python/aqmp: take QMPBadPortError and parse_address from qemu.qmp
  python/aqmp: fully separate from qmp.QEMUMonitorProtocol
  python/aqmp: copy qmp docstrings to qemu.aqmp.legacy
  python: remove the old QMP package
  python: re-enable pylint duplicate-code warnings
  python: rename qemu.aqmp to qemu.qmp

 python/qemu/qmp/README.rst                   |   9 -
 python/qemu/aqmp/__init__.py                 |  51 ---
 python/qemu/aqmp/legacy.py                   | 138 ------
 python/qemu/aqmp/py.typed                    |   0
 python/qemu/machine/machine.py               |  18 +-
 python/qemu/machine/qtest.py                 |   2 +-
 python/qemu/qmp/__init__.py                  | 441 ++-----------------
 python/qemu/{aqmp => qmp}/aqmp_tui.py        |   2 +-
 python/qemu/{aqmp => qmp}/error.py           |  12 +-
 python/qemu/{aqmp => qmp}/events.py          |   6 +-
 python/qemu/qmp/legacy.py                    | 319 ++++++++++++++
 python/qemu/{aqmp => qmp}/message.py         |   0
 python/qemu/{aqmp => qmp}/models.py          |   0
 python/qemu/{aqmp => qmp}/protocol.py        |  28 +-
 python/qemu/{aqmp => qmp}/qmp_client.py      |  32 +-
 python/qemu/qmp/qmp_shell.py                 |  31 +-
 python/qemu/{aqmp => qmp}/util.py            |   0
 python/qemu/{qmp => utils}/qemu_ga_client.py |  24 +-
 python/qemu/{qmp => utils}/qom.py            |   5 +-
 python/qemu/{qmp => utils}/qom_common.py     |   3 +-
 python/qemu/{qmp => utils}/qom_fuse.py       |  11 +-
 python/setup.cfg                             |  21 +-
 python/tests/protocol.py                     |  14 +-
 scripts/cpu-x86-uarch-abi.py                 |   7 +-
 scripts/device-crash-test                    |   4 +-
 scripts/qmp/qemu-ga-client                   |   2 +-
 scripts/qmp/qom-fuse                         |   2 +-
 scripts/qmp/qom-get                          |   2 +-
 scripts/qmp/qom-list                         |   2 +-
 scripts/qmp/qom-set                          |   2 +-
 scripts/qmp/qom-tree                         |   2 +-
 scripts/render_block_graph.py                |   8 +-
 scripts/simplebench/bench_block_job.py       |   5 +-
 tests/qemu-iotests/iotests.py                |   2 +-
 tests/qemu-iotests/tests/mirror-top-perms    |  13 +-
 35 files changed, 490 insertions(+), 728 deletions(-)
 delete mode 100644 python/qemu/qmp/README.rst
 delete mode 100644 python/qemu/aqmp/__init__.py
 delete mode 100644 python/qemu/aqmp/legacy.py
 delete mode 100644 python/qemu/aqmp/py.typed
 rename python/qemu/{aqmp => qmp}/aqmp_tui.py (99%)
 rename python/qemu/{aqmp => qmp}/error.py (87%)
 rename python/qemu/{aqmp => qmp}/events.py (99%)
 create mode 100644 python/qemu/qmp/legacy.py
 rename python/qemu/{aqmp => qmp}/message.py (100%)
 rename python/qemu/{aqmp => qmp}/models.py (100%)
 rename python/qemu/{aqmp => qmp}/protocol.py (97%)
 rename python/qemu/{aqmp => qmp}/qmp_client.py (96%)
 rename python/qemu/{aqmp => qmp}/util.py (100%)
 rename python/qemu/{qmp => utils}/qemu_ga_client.py (94%)
 rename python/qemu/{qmp => utils}/qom.py (99%)
 rename python/qemu/{qmp => utils}/qom_common.py (98%)
 rename python/qemu/{qmp => utils}/qom_fuse.py (97%)

-- 
2.31.1



Re: [PATCH v2 00/25] Python: delete synchronous qemu.qmp package
Posted by Daniel P. Berrangé 2 years, 4 months ago
On Wed, Dec 15, 2021 at 02:39:14PM -0500, John Snow wrote:
> GitLab: https://gitlab.com/jsnow/qemu/-/commits/python-qmp-legacy-switch
> CI: https://gitlab.com/jsnow/qemu/-/pipelines/430491195
> 
> Hi, this series is part of an effort to publish the qemu.qmp package on
> PyPI. It is the first of three series to complete this work:
> 
> --> (1) Switch the new Async QMP library in to python/qemu/qmp
>     (2) Fork python/qemu/qmp out into its own repository,
>         with updated GitLab CI/CD targets to build packages.
>     (3) Update qemu.git to install qemu.qmp from PyPI,
>         and then delete python/qemu/qmp.

What timeframe are you suggesting step (3) for ?

In the series for (2) you're calling it version 0.0.1 indicating
it is liable to  have API incompatible changes.

For step (3), either we're going to have to fetch a precise
version number to avoid risk of API breakage, or we're going
to have to call it stable in (2) and commit to the API.


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|


Re: [PATCH v2 00/25] Python: delete synchronous qemu.qmp package
Posted by John Snow 2 years, 4 months ago
On Thu, Dec 16, 2021 at 5:51 AM Daniel P. Berrangé <berrange@redhat.com>
wrote:

> On Wed, Dec 15, 2021 at 02:39:14PM -0500, John Snow wrote:
> > GitLab: https://gitlab.com/jsnow/qemu/-/commits/python-qmp-legacy-switch
> > CI: https://gitlab.com/jsnow/qemu/-/pipelines/430491195
> >
> > Hi, this series is part of an effort to publish the qemu.qmp package on
> > PyPI. It is the first of three series to complete this work:
> >
> > --> (1) Switch the new Async QMP library in to python/qemu/qmp
> >     (2) Fork python/qemu/qmp out into its own repository,
> >         with updated GitLab CI/CD targets to build packages.
> >     (3) Update qemu.git to install qemu.qmp from PyPI,
> >         and then delete python/qemu/qmp.
>
> What timeframe are you suggesting step (3) for ?
>
>
Roughly around when (2) happens; I don't want to maintain the same code in
two different places.


> In the series for (2) you're calling it version 0.0.1 indicating
> it is liable to  have API incompatible changes.
>

Yes. (We can pin to version 0.0.1 in-tree and bump it manually when
required.)


> For step (3), either we're going to have to fetch a precise
> version number to avoid risk of API breakage, or we're going
> to have to call it stable in (2) and commit to the API.
>

Pinning is what I'd prefer, I have some changes in mind that may require
some API changes, so I'd rather not call it stable yet.