qemurunner.py: Support fallback to older QEMU qmp library
Ping, any comments on this?
Quoted 44 lines · Mark Hatle
From: Mark Hatle <[email protected]>
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 <[email protected]>Signed-off-by Mark Hatle <[email protected]>--- meta/lib/oeqa/utils/qemurunner.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)meta/lib/oeqa/utils/qemurunner.py +7
-2@@ -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 -=-=-=-=-=-=-=-=-=-=-=-Links: You receive all messages sent to this group.
View/Reply Online (#173661): https://lists.openembedded.org/g/openembedded-core/message/173661
Mute This Topic: https://lists.openembedded.org/mt/95180018/3616948
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-