From: Mark Hatle <mark.hatle@kernel.crashing.org>
To: openembedded-core@lists.openembedded.org
Subject: [master,langdale][PATCH] qemurunner.py: Support fallback to older QEMU qmp library
Date: Mon, 21 Nov 2022 13:20:25 -0600 [thread overview]
Message-ID: <20221121192025.926659-1-mark.hatle@kernel.crashing.org> (raw)
From: Mark Hatle <mark.hatle@amd.com>
Some vendor versions of QEMU may be on older versions that do not have
qmp.legacy, but instead of qmp. Default to the integrated library
versions, fall back to the older one and then if neither is available
catch the exception and provide a more human readable error.
Signed-off-by: Mark Hatle <mark.hatle@amd.com>
Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
---
meta/lib/oeqa/utils/qemurunner.py | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py
index f175f8a1de..436caef273 100644
--- a/meta/lib/oeqa/utils/qemurunner.py
+++ b/meta/lib/oeqa/utils/qemurunner.py
@@ -328,8 +328,14 @@ class QemuRunner:
try:
os.chdir(os.path.dirname(qmp_port))
try:
- from qmp.legacy import QEMUMonitorProtocol
+ try:
+ from qmp.legacy import QEMUMonitorProtocol
+ except ModuleNotFoundError:
+ from qmp import QEMUMonitorProtocol
self.qmp = QEMUMonitorProtocol(os.path.basename(qmp_port))
+ except ModuleNotFoundError as msg:
+ self.logger.warning("Failed to load QEMUMonitorProtocol from qmp.legacy or qmp: %s" % (msg))
+ return False
except OSError as msg:
self.logger.warning("Failed to initialize qemu monitor socket: %s File: %s" % (msg, msg.filename))
return False
--
2.25.1
reply other threads:[~2022-11-21 19:20 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20221121192025.926659-1-mark.hatle@kernel.crashing.org \
--to=mark.hatle@kernel.crashing.org \
--cc=openembedded-core@lists.openembedded.org \
/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