]> Git Repo - qemu.git/commitdiff
python, iotests: replace qmp with aqmp
authorJohn Snow <[email protected]>
Tue, 26 Oct 2021 17:56:12 +0000 (13:56 -0400)
committerJohn Snow <[email protected]>
Mon, 1 Nov 2021 15:54:59 +0000 (11:54 -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 <[email protected]>
Reviewed-by: Kevin Wolf <[email protected]>
Reviewed-by: Hanna Reitz <[email protected]>
Message-id: 20211026175612.4127598[email protected]
Signed-off-by: John Snow <[email protected]>
python/qemu/machine/machine.py

index a0cf69786b4bb7e851b5eeb2517b67036ddb3be1..a487c397459a1fa6889276ab25381a877df07637 100644 (file)
@@ -41,7 +41,6 @@ from typing import (
 )
 
 from qemu.qmp import (  # pylint: disable=import-error
-    QEMUMonitorProtocol,
     QMPMessage,
     QMPReturnValue,
     SocketAddrT,
@@ -50,6 +49,12 @@ from qemu.qmp import (  # pylint: disable=import-error
 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__)
 
 
This page took 0.032295 seconds and 4 git commands to generate.