From 18bcccc8f8dbf3541e7c7c4dec38b5fe9e2c7f20 Mon Sep 17 00:00:00 2001 From: Mikko Rapeli Date: Thu, 9 Feb 2023 10:09:34 +0200 Subject: oeqa qemurunner.py: add timeout to QMP calls When a qemu machine hangs, the QMP calls can hang for ever too, and when this happens any failing test commands from ssh runner may be followed by dump_monitor() calls which then also hang. Hangs followed by hangs. Use runqemutime at setup and run_monitor() specific timeout for later calls. (From OE-Core rev: 3a07bdf77dc6ecbf4c620b051dd032abaaf1e4ff) Signed-off-by: Mikko Rapeli Signed-off-by: Luca Ceresoli Signed-off-by: Richard Purdie --- meta/lib/oeqa/utils/qemurunner.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'meta') diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py index 2e054447fc..bce00c696a 100644 --- a/meta/lib/oeqa/utils/qemurunner.py +++ b/meta/lib/oeqa/utils/qemurunner.py @@ -350,6 +350,8 @@ class QemuRunner: return False try: + # set timeout value for all QMP calls + self.qmp.settimeout(self.runqemutime) self.qmp.connect() connect_time = time.time() self.logger.info("QMP connected to QEMU at %s and took %s seconds" % @@ -628,6 +630,7 @@ class QemuRunner: def run_monitor(self, command, args=None, timeout=60): if hasattr(self, 'qmp') and self.qmp: + self.qmp.settimeout(timeout) if args is not None: return self.qmp.cmd(command, args) else: -- cgit v1.2.3-54-g00ecf