Commit 36578add66 for qemu.org

commit 36578add66d83a2e00b2c7678404750b6f261ca3
Author: Alyssa Ross <hi@alyssa.is>
Date:   Mon Mar 23 09:47:39 2026 +0100

    tests/functional: preserve PYTHONPATH entries

    Otherwise, it's not possible to use a packaged qemu.qmp.

    Fixes: 1497377857 ("tests/functional: Prepare the meson build system for the functional tests")
    Signed-off-by: Alyssa Ross <hi@alyssa.is>
    Link: https://lore.kernel.org/r/20260323084739.1013748-1-hi@alyssa.is
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

diff --git a/tests/functional/meson.build b/tests/functional/meson.build
index 3b42299e7c..c158197c4b 100644
--- a/tests/functional/meson.build
+++ b/tests/functional/meson.build
@@ -76,8 +76,10 @@ foreach speed : ['quick', 'thorough']
     endif
     test_env.set('QEMU_TEST_QEMU_BINARY', test_emulator.full_path())
     test_env.set('MESON_BUILD_ROOT', meson.project_build_root())
-    test_env.set('PYTHONPATH', meson.project_source_root() / 'python:' +
-                               meson.current_source_dir())
+    test_env.prepend('PYTHONPATH',
+                     meson.project_source_root() / 'python',
+                     meson.current_source_dir(),
+                     separator : ':')

     # Define the GDB environment variable if gdb is available.
     gdb = get_option('gdb')
@@ -97,8 +99,10 @@ foreach speed : ['quick', 'thorough']
       test_precache_env = environment()
       test_precache_env.set('QEMU_TEST_PRECACHE', meson.current_build_dir() / teststamp)
       test_precache_env.set('MESON_BUILD_ROOT', meson.project_build_root())
-      test_precache_env.set('PYTHONPATH', meson.project_source_root() / 'python:' +
-                                          meson.current_source_dir())
+      test_precache_env.prepend('PYTHONPATH',
+                                meson.project_source_root() / 'python',
+                                meson.current_source_dir(),
+                                separator : ':')
       precache = custom_target('func-precache-' + testname,
                                output: teststamp,
                                command: [python, testpath],