[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 22/22] python, iotests: replace qmp with aqmp
From: |
John Snow |
Subject: |
[PULL 22/22] python, iotests: replace qmp with aqmp |
Date: |
Mon, 1 Nov 2021 13:30:06 -0400 |
Swap out the synchronous QEMUMonitorProtocol from qemu.qmp with the sync
wrapper from qemu.aqmp instead.
Add an escape hatch in the form of the environment variable
QEMU_PYTHON_LEGACY_QMP which allows you to cajole QEMUMachine into using
the old implementation, proving that both implementations work
concurrently.
Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Message-id: 20211026175612.4127598-9-jsnow@redhat.com
Signed-off-by: John Snow <jsnow@redhat.com>
---
python/qemu/machine/machine.py | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/python/qemu/machine/machine.py b/python/qemu/machine/machine.py
index a0cf69786b4..a487c397459 100644
--- a/python/qemu/machine/machine.py
+++ b/python/qemu/machine/machine.py
@@ -41,7 +41,6 @@
)
from qemu.qmp import ( # pylint: disable=import-error
- QEMUMonitorProtocol,
QMPMessage,
QMPReturnValue,
SocketAddrT,
@@ -50,6 +49,12 @@
from . import console_socket
+if os.environ.get('QEMU_PYTHON_LEGACY_QMP'):
+ from qemu.qmp import QEMUMonitorProtocol
+else:
+ from qemu.aqmp.legacy import QEMUMonitorProtocol
+
+
LOG = logging.getLogger(__name__)
--
2.31.1
- [PULL 12/22] iotests/linters: Add entry point for linting via Python CI, (continued)
- [PULL 12/22] iotests/linters: Add entry point for linting via Python CI, John Snow, 2021/11/01
- [PULL 13/22] iotests/linters: Add workaround for mypy bug #9852, John Snow, 2021/11/01
- [PULL 14/22] python: Add iotest linters to test suite, John Snow, 2021/11/01
- [PULL 15/22] python/machine: remove has_quit argument, John Snow, 2021/11/01
- [PULL 16/22] python/machine: Handle QMP errors on close more meticulously, John Snow, 2021/11/01
- [PULL 17/22] python/aqmp: Remove scary message, John Snow, 2021/11/01
- [PULL 18/22] iotests: Accommodate async QMP Exception classes, John Snow, 2021/11/01
- [PULL 19/22] iotests: Conditionally silence certain AQMP errors, John Snow, 2021/11/01
- [PULL 20/22] iotests/300: avoid abnormal shutdown race condition, John Snow, 2021/11/01
- [PULL 21/22] python/aqmp: Create sync QMP wrapper for iotests, John Snow, 2021/11/01
- [PULL 22/22] python, iotests: replace qmp with aqmp,
John Snow <=
- Re: [PULL 00/22] Python patches, Richard Henderson, 2021/11/02