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 <[email protected]>
---
 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

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#229032): 
https://lists.openembedded.org/g/openembedded-core/message/229032
Mute This Topic: https://lists.openembedded.org/mt/117141415/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to