public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
* [PATCH V2] qemurunner: Improve qmp module detection PKG_CONFIG_SYSROOT_DIR for qmp module path
@ 2026-01-07 20:25 Tom Geelen
  2026-01-07 20:52 ` Alexander Kanavin
  2026-01-08 11:31 ` [OE-core] " Mathieu Dubois-Briand
  0 siblings, 2 replies; 5+ messages in thread
From: Tom Geelen @ 2026-01-07 20:25 UTC (permalink / raw)
  To: openembedded-core; +Cc: Alex Kanavin, Tom Geelen

Instead of using logfile to detect where qmp is located we can use PKG_CONFIG_SYSROOT_DIR, passed via ENV to the launch function as this will point to the image recipe for which launch is called.

Signed-off-by: Tom Geelen <t.f.g.geelen@gmail.com>
---
 meta/lib/oeqa/utils/qemurunner.py | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py
index c4db0cf038..dd1ff42b0f 100644
--- a/meta/lib/oeqa/utils/qemurunner.py
+++ b/meta/lib/oeqa/utils/qemurunner.py
@@ -186,11 +186,9 @@ class QemuRunner:
         return self.launch(launch_cmd, qemuparams=qemuparams, get_ip=get_ip, extra_bootparams=extra_bootparams, env=env)
 
     def launch(self, launch_cmd, get_ip = True, qemuparams = None, extra_bootparams = None, env = None):
-        # use logfile to determine the recipe-sysroot-native path and
-        # then add in the site-packages path components and add that
-        # to the python sys.path so the qmp module can be found.
-        python_path = os.path.dirname(os.path.dirname(self.logfile))
-        python_path += "/recipe-sysroot-native/usr/lib/qemu-python"
+        # Use PKG_CONFIG_SYSROOT_DIR from env as a starting point for finding qmp module
+        python_path = env.get("PKG_CONFIG_SYSROOT_DIR", "")
+        python_path += "/../recipe-sysroot-native/usr/lib/qemu-python"
         sys.path.append(python_path)
         importlib.invalidate_caches()
         try:
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-01-08 17:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-07 20:25 [PATCH V2] qemurunner: Improve qmp module detection PKG_CONFIG_SYSROOT_DIR for qmp module path Tom Geelen
2026-01-07 20:52 ` Alexander Kanavin
2026-01-08 11:31 ` [OE-core] " Mathieu Dubois-Briand
2026-01-08 14:52   ` Tom Geelen
2026-01-08 17:34     ` Mathieu Dubois-Briand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox