[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 17/17] python, iotests: replace qmp with aqmp
From: |
John Snow |
Subject: |
[PATCH v2 17/17] python, iotests: replace qmp with aqmp |
Date: |
Wed, 22 Sep 2021 20:49:38 -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 implementatin, proving that both implementations work
concurrently.
Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Tested-by: Hanna Reitz <hreitz@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 c33a78a2d9f..32879faeb40 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
- [PATCH v2 06/17] python/aqmp: Reduce severity of EOFError-caused loop terminations, (continued)
- [PATCH v2 06/17] python/aqmp: Reduce severity of EOFError-caused loop terminations, John Snow, 2021/09/22
- [PATCH v2 08/17] python/qmp: clear events on get_events() call, John Snow, 2021/09/22
- [PATCH v2 09/17] python/qmp: add send_fd_scm directly to QEMUMonitorProtocol, John Snow, 2021/09/22
- [PATCH v2 10/17] python, iotests: remove socket_scm_helper, John Snow, 2021/09/22
- [PATCH v2 11/17] python/machine: remove has_quit argument, John Snow, 2021/09/22
- [PATCH v2 12/17] python/machine: Handle QMP errors on close more meticulously, John Snow, 2021/09/22
- [PATCH v2 15/17] python/aqmp: Create sync QMP wrapper for iotests, John Snow, 2021/09/22
- [PATCH v2 16/17] python/aqmp: Remove scary message, John Snow, 2021/09/22
- [PATCH v2 13/17] iotests: Accommodate async QMP Exception classes, John Snow, 2021/09/22
- [PATCH v2 14/17] iotests: Conditionally silence certain AQMP errors, John Snow, 2021/09/22
- [PATCH v2 17/17] python, iotests: replace qmp with aqmp,
John Snow <=