From 220530755ba6c4ed658d283cee903e4956131b99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Benn=C3=A9e?= Date: Fri, 19 Jun 2026 16:56:50 +0100 Subject: [PATCH 1/7] python/qemu: split arg between base and harness lists MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There are argument we add because we want the test harness to control QEMU and arguments we default for handling the display and machine type. Split the obvious ones between base_args and a new list called harness_args. We will leave the complexity of the serial ports for now. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Message-ID: <20260619155657.944220-2-alex.bennee@linaro.org> Signed-off-by: Alex Bennée --- python/qemu/machine/machine.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/python/qemu/machine/machine.py b/python/qemu/machine/machine.py index ebb58d5b68..e8973a8739 100644 --- a/python/qemu/machine/machine.py +++ b/python/qemu/machine/machine.py @@ -292,8 +292,8 @@ class QEMUMachine: self._iolog = iolog.read() @property - def _base_args(self) -> List[str]: - args = ['-display', 'none', '-vga', 'none'] + def _harness_args(self) -> List[str]: + args: List[str] = [] if self._qmp_set: if self._sock_pair: @@ -307,8 +307,6 @@ class QEMUMachine: args.extend(['-chardev', moncdev, '-mon', 'chardev=mon,mode=control']) - if self._machine is not None: - args.extend(['-machine', self._machine]) for _ in range(self._console_index): args.extend(['-serial', 'null']) if self._console_set: @@ -323,6 +321,13 @@ class QEMUMachine: args.extend(['-device', device]) return args + @property + def _base_args(self) -> List[str]: + args: List[str] = ['-display', 'none', '-vga', 'none'] + if self._machine is not None: + args.extend(['-machine', self._machine]) + return args + @property def args(self) -> List[str]: """Returns the list of arguments given to the QEMU binary.""" @@ -366,6 +371,7 @@ class QEMUMachine: self._qemu_full_args = tuple(chain( self._wrapper, [self._binary], + self._harness_args, self._base_args, self._args )) From 1c09090b4891f8d1891a66d625eaeb77d322f45c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Benn=C3=A9e?= Date: Fri, 19 Jun 2026 16:56:51 +0100 Subject: [PATCH 2/7] python/qemu: split console from harness args MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before we mess with the console output lets create a new helper just for that. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Message-ID: <20260619155657.944220-3-alex.bennee@linaro.org> Signed-off-by: Alex Bennée --- python/qemu/machine/machine.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/python/qemu/machine/machine.py b/python/qemu/machine/machine.py index e8973a8739..18ee5ec014 100644 --- a/python/qemu/machine/machine.py +++ b/python/qemu/machine/machine.py @@ -306,7 +306,11 @@ class QEMUMachine: moncdev = f"socket,id=mon,path={self._monitor_address}" args.extend(['-chardev', moncdev, '-mon', 'chardev=mon,mode=control']) + return args + @property + def _console_args(self) -> List[str]: + args: List[str] = [] for _ in range(self._console_index): args.extend(['-serial', 'null']) if self._console_set: @@ -372,6 +376,7 @@ class QEMUMachine: self._wrapper, [self._binary], self._harness_args, + self._console_args, self._base_args, self._args )) From f0e0f4387927a9ab9b99fee47bde1adb6a6cb42a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Benn=C3=A9e?= Date: Fri, 19 Jun 2026 16:56:52 +0100 Subject: [PATCH 3/7] python/qemu: dump a developer friendly version of cmdline to logs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now we have the arguments nicely split up we can make _console_args a function call and present a slightly different version to the logs to save developers manually hacking the command line up. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Message-ID: <20260619155657.944220-4-alex.bennee@linaro.org> Signed-off-by: Alex Bennée --- python/qemu/machine/machine.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/python/qemu/machine/machine.py b/python/qemu/machine/machine.py index 18ee5ec014..3670c8cd39 100644 --- a/python/qemu/machine/machine.py +++ b/python/qemu/machine/machine.py @@ -308,12 +308,15 @@ class QEMUMachine: 'chardev=mon,mode=control']) return args - @property - def _console_args(self) -> List[str]: + def _console_args(self, interactive: bool = False) -> List[str]: args: List[str] = [] + # redirect pre_console_index serials to null for _ in range(self._console_index): args.extend(['-serial', 'null']) - if self._console_set: + + if interactive: + args.extend(['-serial', 'mon:stdio']) + elif self._console_set: assert self._cons_sock_pair is not None fd = self._cons_sock_pair[0].fileno() chardev = f"socket,id=console,fd={fd}" @@ -376,7 +379,7 @@ class QEMUMachine: self._wrapper, [self._binary], self._harness_args, - self._console_args, + self._console_args(), self._base_args, self._args )) @@ -485,6 +488,14 @@ class QEMUMachine: """ self._pre_launch() LOG.debug('VM launch command: %r', ' '.join(self._qemu_full_args)) + # Log a simplified, developer-runnable command: + # Exclude harness-managed infrastructure args (harness_args) + # and wrapper. + debug_cmd = [self._binary] + debug_cmd.extend(self._console_args(interactive=True)) + debug_cmd.extend(self._base_args) + debug_cmd.extend(self._args) + LOG.debug('Developer-runnable command: %r', ' '.join(debug_cmd)) # Cleaning up of this subprocess is guaranteed by _do_shutdown. # pylint: disable=consider-using-with From dd14a21b9dc1ebecd7a4d3135c5e2318a2250adb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Benn=C3=A9e?= Date: Fri, 19 Jun 2026 16:56:53 +0100 Subject: [PATCH 4/7] tests/functional: tell pylint not to check c-modules MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To fix: qemu-test.test_pylint "/home/alex/lsrc/qemu.git/tests/functional/arm/test_integratorcp.py:83: I1101: Module 'cv2' has no 'imread' member, but source is unavailable. Consider adding this module to extension-pkg-allow-list if you want to perform analysis based on run-time introspection of living objects. (c-extension-no-member)" Manually running python3 showed I could indeed import cv2 and call those functions. Rather than allowing pylint to introspect lets just tell it to skip c modules. Reviewed-by: Daniel P. Berrangé Reviewed-by: Thomas Huth Message-ID: <20260619155657.944220-5-alex.bennee@linaro.org> Signed-off-by: Alex Bennée --- tests/functional/pylintrc | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/functional/pylintrc b/tests/functional/pylintrc index 049c3e76f1..949bea611f 100644 --- a/tests/functional/pylintrc +++ b/tests/functional/pylintrc @@ -58,6 +58,7 @@ confidence=HIGH, # no Warning level messages displayed, use "--disable=all --enable=classes # --disable=W". disable=bad-inline-option, + c-extension-no-member, consider-using-f-string, file-ignored, fixme, From 559d834371742589de62d47ad7be3df5857f8e58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Date: Fri, 19 Jun 2026 16:56:54 +0100 Subject: [PATCH 5/7] gitlab: ensure "check-XXX' jobs capture functional test logs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A small subset of functional tests are run by default with 'make check', and so run in the context of 'check-XXX' CI jobs, rather than 'functional-XXX' CI jobs. Thus we need to capture the functional test logs unconditionally for all test jobs. Signed-off-by: Daniel P. Berrangé Reviewed-by: Pierrick Bouvier Message-ID: <20260610121254.2870259-1-berrange@redhat.com> Message-ID: <20260619155657.944220-6-alex.bennee@linaro.org> Signed-off-by: Alex Bennée --- .gitlab-ci.d/buildtest-template.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.gitlab-ci.d/buildtest-template.yml b/.gitlab-ci.d/buildtest-template.yml index 005058625e..3b003abc99 100644 --- a/.gitlab-ci.d/buildtest-template.yml +++ b/.gitlab-ci.d/buildtest-template.yml @@ -78,6 +78,15 @@ extends: .meson_job_template stage: test image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:$QEMU_CI_CONTAINER_TAG + artifacts: + name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG" + when: always + expire_in: 7 days + paths: + - build/meson-logs + - build/tests/functional/*/*/*.log + reports: + junit: build/meson-logs/*.junit.xml script: - source scripts/ci/gitlab-ci-section - section_start buildenv "Setting up to run tests" @@ -111,15 +120,6 @@ paths: - ${CI_PROJECT_DIR}/functional-cache policy: pull-push - artifacts: - name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG" - when: always - expire_in: 7 days - paths: - - build/meson-logs - - build/tests/functional/*/*/*.log - reports: - junit: build/meson-logs/*.junit.xml before_script: - export QEMU_TEST_ALLOW_UNTRUSTED_CODE=1 - export QEMU_TEST_CACHE_DIR=${CI_PROJECT_DIR}/functional-cache From dc4adea14da9885cb1fa168965d9aadb841bd3ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Benn=C3=A9e?= Date: Fri, 19 Jun 2026 16:56:55 +0100 Subject: [PATCH 6/7] gitlab: remove build target hacks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since eef29e060dc (meson: build macOS signed binary as part of the default target) we should be able to do a plain build and everything just work. Reviewed-by: Pierrick Bouvier Message-ID: <20260619155657.944220-7-alex.bennee@linaro.org> Signed-off-by: Alex Bennée --- .gitlab-ci.d/macos.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.d/macos.yml b/.gitlab-ci.d/macos.yml index 8366b4ad56..efa0fb666e 100644 --- a/.gitlab-ci.d/macos.yml +++ b/.gitlab-ci.d/macos.yml @@ -29,7 +29,6 @@ - cd build - ../configure --enable-werror $CONFIGURE_ARGS || { cat config.log meson-logs/meson-log.txt; exit 1; } - $MAKE -j$(sysctl -n hw.ncpu) - - for TARGET in $TEST_BINARIES ; do $MAKE $TARGET ; done - for TARGET in $TEST_TARGETS ; do $MAKE $TARGET ; done aarch64-macos-15-build: @@ -45,8 +44,7 @@ aarch64-macos-15-build: --cross-prefix-i386=i686-elf- --cross-prefix-x86_64=x86_64-elf- --disable-plugins - TEST_BINARIES: qemu-system-aarch64 qemu-system-i386 qemu-system-x86_64 - TEST_TARGETS: check-unit run-tcg-tests-aarch64-softmmu run-tcg-tests-i386-softmmu run-tcg-tests-x86_64-softmmu + TEST_TARGETS: check-unit check-tcg aarch64-macos-26-build: extends: .macos_job_template @@ -62,5 +60,4 @@ aarch64-macos-26-build: --cross-prefix-i386=i686-elf- --cross-prefix-x86_64=x86_64-elf- --disable-plugins - TEST_BINARIES: qemu-system-aarch64 qemu-system-i386 qemu-system-x86_64 - TEST_TARGETS: check-unit run-tcg-tests-aarch64-softmmu run-tcg-tests-i386-softmmu run-tcg-tests-x86_64-softmmu + TEST_TARGETS: check-unit check-tcg From 6aa02798bb517d99988fcf64a0afa0850d850c73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Date: Fri, 19 Jun 2026 16:56:56 +0100 Subject: [PATCH 7/7] gitlab: update bug template for sec issues & tool assistance MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Warn that a security issue must have the "confidential" flag set and that any findings from automated tools must be validated before submission. Signed-off-by: Daniel P. Berrangé Message-ID: <20260619123632.1276476-1-berrange@redhat.com> Reviewed-by: Pierrick Bouvier Message-ID: <20260619155657.944220-8-alex.bennee@linaro.org> Signed-off-by: Alex Bennée --- .gitlab/issue_templates/bug.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.gitlab/issue_templates/bug.md b/.gitlab/issue_templates/bug.md index e20f586008..faeeb00225 100644 --- a/.gitlab/issue_templates/bug.md +++ b/.gitlab/issue_templates/bug.md @@ -13,8 +13,9 @@ older than this should be reported to the distribution instead. See https://www.qemu.org/contribute/report-a-bug/ for additional guidance. -If this is a security issue, please consult -https://www.qemu.org/contribute/security-process/ +If this is a security issue, ensure this ticket is marked 'confidential' +before submission. See https://www.qemu.org/contribute/security-process/ +for additional guidance --> ## Host environment @@ -49,6 +50,12 @@ https://www.qemu.org/contribute/security-process/ 2. 3. + ## Additional information