python, iotests: replace qmp with aqmp

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>
This commit is contained in:
John Snow 2021-10-26 13:56:12 -04:00
parent f122be6093
commit 76cd358671

View file

@ -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__)