* [master,langdale][PATCH] qemurunner.py: Support fallback to older QEMU qmp library
@ 2022-11-21 19:20 Mark Hatle
0 siblings, 0 replies; only message in thread
From: Mark Hatle @ 2022-11-21 19:20 UTC (permalink / raw)
To: openembedded-core
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2022-11-21 19:20 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-21 19:20 [master,langdale][PATCH] qemurunner.py: Support fallback to older QEMU qmp library Mark Hatle
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox