From: John Snow <jsnow@redhat.com>
To: qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
Eduardo Habkost <ehabkost@redhat.com>,
qemu-block@nongnu.org, Hanna Reitz <hreitz@redhat.com>,
Cleber Rosa <crosa@redhat.com>, John Snow <jsnow@redhat.com>
Subject: [PATCH v3 7/7] python, iotests: replace qmp with aqmp
Date: Tue, 12 Oct 2021 18:34:45 -0400 [thread overview]
Message-ID: <20211012223445.1051101-8-jsnow@redhat.com> (raw)
In-Reply-To: <20211012223445.1051101-1-jsnow@redhat.com>
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 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
next prev parent reply other threads:[~2021-10-12 22:40 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-12 22:34 [PATCH v3 0/7] Switch iotests to using Async QMP John Snow
2021-10-12 22:34 ` [PATCH v3 1/7] python/machine: remove has_quit argument John Snow
2021-10-12 22:34 ` [PATCH v3 2/7] python/machine: Handle QMP errors on close more meticulously John Snow
2021-10-13 7:33 ` Hanna Reitz
2021-10-12 22:34 ` [PATCH v3 3/7] python/aqmp: Remove scary message John Snow
2021-10-13 7:35 ` Hanna Reitz
2021-10-12 22:34 ` [PATCH v3 4/7] iotests: Accommodate async QMP Exception classes John Snow
2021-10-13 7:38 ` Hanna Reitz
2021-10-12 22:34 ` [PATCH v3 5/7] iotests: Conditionally silence certain AQMP errors John Snow
2021-10-13 8:20 ` Hanna Reitz
2021-10-12 22:34 ` [PATCH v3 6/7] python/aqmp: Create sync QMP wrapper for iotests John Snow
2021-10-13 8:24 ` Hanna Reitz
2021-10-12 22:34 ` John Snow [this message]
2021-10-13 14:21 ` [PATCH v3 7/7] python, iotests: replace qmp with aqmp Eric Blake
2021-10-13 8:45 ` [PATCH v3 0/7] Switch iotests to using Async QMP Hanna Reitz
2021-10-13 12:51 ` John Snow
2021-10-13 14:00 ` John Snow
2021-10-13 14:49 ` Hanna Reitz
2021-10-13 16:35 ` John Snow
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211012223445.1051101-8-jsnow@redhat.com \
--to=jsnow@redhat.com \
--cc=crosa@redhat.com \
--cc=ehabkost@redhat.com \
--cc=hreitz@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=vsementsov@virtuozzo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).