summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/utils/qemurunner.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2022-09-09 09:15:55 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-09-09 14:09:01 +0100
commitdf89d59a19f3000d829ee6b18364260a4e5312e8 (patch)
treef83d8cb3a0eefdee7c5592fd213e99f0d568c7b6 /meta/lib/oeqa/utils/qemurunner.py
parent9040d46f59643270695afdb093e8b403b89b898a (diff)
downloadpoky-df89d59a19f3000d829ee6b18364260a4e5312e8.tar.gz
qemurunner: Update to match qmp changes
Upstream made changes to the qmp module. We need to use the legacy one for now since that matches the interface we use, ultimately we likely need to update our code. Also fix the generic exception handler to show the actual exception which helps debugging when something does break. (From OE-Core rev: 6e90b0d909d3c8b1be5cb19f2411cd0e89735c84) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/utils/qemurunner.py')
-rw-r--r--meta/lib/oeqa/utils/qemurunner.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py
index 4c3d2010fb..07018b7de8 100644
--- a/meta/lib/oeqa/utils/qemurunner.py
+++ b/meta/lib/oeqa/utils/qemurunner.py
@@ -188,8 +188,8 @@ class QemuRunner:
188 importlib.invalidate_caches() 188 importlib.invalidate_caches()
189 try: 189 try:
190 qmp = importlib.import_module("qmp") 190 qmp = importlib.import_module("qmp")
191 except: 191 except Exception as e:
192 self.logger.error("qemurunner: qmp.py missing, please ensure it's installed") 192 self.logger.error("qemurunner: qmp.py missing, please ensure it's installed (%s)" % str(e))
193 return False 193 return False
194 # Path relative to tmpdir used as cwd for qemu below to avoid unix socket path length issues 194 # Path relative to tmpdir used as cwd for qemu below to avoid unix socket path length issues
195 qmp_file = "." + next(tempfile._get_candidate_names()) 195 qmp_file = "." + next(tempfile._get_candidate_names())
@@ -325,7 +325,8 @@ class QemuRunner:
325 try: 325 try:
326 os.chdir(os.path.dirname(qmp_port)) 326 os.chdir(os.path.dirname(qmp_port))
327 try: 327 try:
328 self.qmp = qmp.QEMUMonitorProtocol(os.path.basename(qmp_port)) 328 from qmp.legacy import QEMUMonitorProtocol
329 self.qmp = QEMUMonitorProtocol(os.path.basename(qmp_port))
329 except OSError as msg: 330 except OSError as msg:
330 self.logger.warning("Failed to initialize qemu monitor socket: %s File: %s" % (msg, msg.filename)) 331 self.logger.warning("Failed to initialize qemu monitor socket: %s File: %s" % (msg, msg.filename))
331 return False 332 return False