[PATCH v4 0/8] Switch iotests to using Async QMP

John Snow posted 8 patches 1 week, 3 days ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20211013215748.2154908-1-jsnow@redhat.com
Maintainers: John Snow <jsnow@redhat.com>, Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>, Cleber Rosa <crosa@redhat.com>, Eduardo Habkost <ehabkost@redhat.com>
python/qemu/aqmp/__init__.py              |  12 --
python/qemu/aqmp/legacy.py                | 138 ++++++++++++++++++++++
python/qemu/machine/machine.py            |  85 +++++++++----
scripts/simplebench/bench_block_job.py    |   3 +-
tests/qemu-iotests/040                    |   7 +-
tests/qemu-iotests/218                    |   2 +-
tests/qemu-iotests/255                    |   2 +-
tests/qemu-iotests/300                    |  12 +-
tests/qemu-iotests/iotests.py             |  20 +++-
tests/qemu-iotests/tests/mirror-top-perms |  17 ++-
10 files changed, 242 insertions(+), 56 deletions(-)
create mode 100644 python/qemu/aqmp/legacy.py

[PATCH v4 0/8] Switch iotests to using Async QMP

Posted by John Snow 1 week, 3 days ago
GitLab: https://gitlab.com/jsnow/qemu/-/commits/python-aqmp-iotest-wrapper
CI: https://gitlab.com/jsnow/qemu/-/pipelines/387972757

Hiya,

This series continues where the last two AQMP series left off and adds a
synchronous 'legacy' wrapper around the new AQMP interface, then drops
it straight into iotests to prove that AQMP is functional and totally
cool and fine. The disruption and churn to iotests is pretty minimal.

In the event that a regression happens and I am not physically proximate
to inflict damage upon, one may set the QEMU_PYTHON_LEGACY_QMP variable
to any non-empty string as it pleases you to engage the QMP machinery
you are used to.

I'd like to try and get this committed early in the 6.2 development
cycle to give ample time to smooth over any possible regressions. I've
tested it locally and via gitlab CI, across Python versions 3.6 through
3.10, and "worksforme". If something bad happens, we can revert the
actual switch-flip very trivially.

V4:

001/8:[----] [--] 'python/machine: remove has_quit argument'
002/8:[----] [--] 'python/machine: Handle QMP errors on close more meticulously'
003/8:[----] [--] 'python/aqmp: Remove scary message'
004/8:[----] [--] 'iotests: Accommodate async QMP Exception classes'
005/8:[----] [--] 'iotests: Conditionally silence certain AQMP errors'
006/8:[down] 'iotests/300: avoid abnormal shutdown race condition'
007/8:[----] [--] 'python/aqmp: Create sync QMP wrapper for iotests'
008/8:[----] [--] 'python, iotests: replace qmp with aqmp'

006: Added to address a race condition in iotest 300.
     (Thanks for the repro, Hanna)

V3:

001/7:[----] [--] 'python/machine: remove has_quit argument'
002/7:[0002] [FC] 'python/machine: Handle QMP errors on close more meticulously'
003/7:[----] [--] 'python/aqmp: Remove scary message'
004/7:[0006] [FC] 'iotests: Accommodate async QMP Exception classes'
005/7:[0003] [FC] 'iotests: Conditionally silence certain AQMP errors'
006/7:[0009] [FC] 'python/aqmp: Create sync QMP wrapper for iotests'
007/7:[----] [--] 'python, iotests: replace qmp with aqmp'

002: Account for force-kill cases, too.
003: Shuffled earlier into the series to prevent a mid-series regression.
004: Rewrite the imports to be less "heterogeneous" ;)
005: Add in a TODO for me to trip over in the future.
006: Fix a bug surfaced by a new iotest where waiting with pull_event for a
     timeout of 0.0 will cause a timeout exception to be raised even if there
     was an event ready to be read.

V2: A distant dream, half-remembered.
V1: Apocrypha.

John Snow (8):
  python/machine: remove has_quit argument
  python/machine: Handle QMP errors on close more meticulously
  python/aqmp: Remove scary message
  iotests: Accommodate async QMP Exception classes
  iotests: Conditionally silence certain AQMP errors
  iotests/300: avoid abnormal shutdown race condition
  python/aqmp: Create sync QMP wrapper for iotests
  python, iotests: replace qmp with aqmp

 python/qemu/aqmp/__init__.py              |  12 --
 python/qemu/aqmp/legacy.py                | 138 ++++++++++++++++++++++
 python/qemu/machine/machine.py            |  85 +++++++++----
 scripts/simplebench/bench_block_job.py    |   3 +-
 tests/qemu-iotests/040                    |   7 +-
 tests/qemu-iotests/218                    |   2 +-
 tests/qemu-iotests/255                    |   2 +-
 tests/qemu-iotests/300                    |  12 +-
 tests/qemu-iotests/iotests.py             |  20 +++-
 tests/qemu-iotests/tests/mirror-top-perms |  17 ++-
 10 files changed, 242 insertions(+), 56 deletions(-)
 create mode 100644 python/qemu/aqmp/legacy.py

-- 
2.31.1