maintainer omnibus: testing, fuzz, plugins, documentation
v2 cover maintainer omnibus: testing, fuzz, plugins, documentation
As softfreeze is fast approaching I thought it would be work combining my various trees into an omnibus series to ease the review and merging.
The testing updates exposed a number of latent leaks that confused the oss-fuzz jobs (hence the test-fuzz addition to help debug that). This also includes some minor plugin updates and finally some documentation updates that clean-up and expose the QOM and QDEV APIs which are so core to emulating anything in QEMU.
v2
- applied a bunch of review tags
- added missing doc suggestions from Paolo
- tweaked the plugin fix for CI
The following patches need review:
- qemu-keymap: properly check return from xkb_keymap_mod_get_index
Alex Bennée (3):
gitlab: reduce testing scope of check-gcov
tests/tcg: add mechanism to handle plugin arguments
qemu-keymap: properly check return from xkb_keymap_mod_get_index
Ani Sinha (1):
docs/devel: remind developers to run CI container pipeline when
updating images
Daniel P. Berrangé (2):
gitlab: explicit set artifacts publishing criteria
gitlab: ensure coverage job also publishes meson log
docs/devel/testing.rst | 6 ++++++ qemu-keymap.c | 24 ++++++++++++++++-------- .gitlab-ci.d/buildtest-template.yml | 4 +++- .gitlab-ci.d/buildtest.yml | 7 ++++++- .gitlab-ci.d/crossbuild-template.yml | 1 + .gitlab-ci.d/crossbuilds.yml | 2 ++ .gitlab-ci.d/opensbi.yml | 1 + tests/tcg/Makefile.target | 8 ++++++-- 8 files changed, 41 insertions(+), 12 deletions(-)
Signature · 1 line
2.39.2
PATCH v2 1/6 gitlab: explicit set artifacts publishing criteria
From: Daniel P. Berrangé <[email protected]>
If not set explicitly, gitlab assumes 'when: on_success" as the publishing criteria for artifacts. This is reasonable if the artifact is an output deliverable of the job. This is useless if the artifact is a log file to be used for debugging job failures.
This change makes the desired criteria explicit for every job that publishes artifacts.
Message-Id: <[email protected]>
Message-Id: <[email protected]>
--- .gitlab-ci.d/buildtest-template.yml | 4 +++- .gitlab-ci.d/buildtest.yml | 2 ++ .gitlab-ci.d/crossbuild-template.yml | 1 + .gitlab-ci.d/crossbuilds.yml | 2 ++ .gitlab-ci.d/opensbi.yml | 1 + 5 files changed, 9 insertions(+), 1 deletion(-)
.gitlab-ci.d/buildtest-template.yml +3 -1
@@ -25,6 +25,7 @@ # rebuilding all the object files we skip in the artifacts .native_build_artifact_template: artifacts: + when: on_success expire_in: 2 days paths: - build
@@ -53,6 +54,7 @@ extends: .common_test_job_template artifacts: name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG" + when: always expire_in: 7 days paths: - build/meson-logs/testlog.txt
@@ -68,7 +70,7 @@ policy: pull-push artifacts: name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG" - when: on_failure + when: always expire_in: 7 days paths: - build/tests/results/latest/results.xml
.gitlab-ci.d/buildtest.yml +2 -0
@@ -462,6 +462,7 @@ gcov: coverage: /^\s*lines:\s*\d+.\d+\%/ artifacts: name: ${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHA} + when: on_success expire_in: 2 days reports: coverage_report:
@@ -587,6 +588,7 @@ pages: - make -C build install DESTDIR=$(pwd)/temp-install - mv temp-install/usr/local/share/doc/qemu/* public/ artifacts: + when: on_success paths: - public variables:
.gitlab-ci.d/crossbuild-template.yml +1 -0
@@ -55,6 +55,7 @@ .cross_test_artifacts: artifacts: name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG" + when: always expire_in: 7 days paths: - build/meson-logs/testlog.txt
.gitlab-ci.d/crossbuilds.yml +2 -0
@@ -169,6 +169,7 @@ cross-win32-system: CROSS_SKIP_TARGETS: alpha-softmmu avr-softmmu hppa-softmmu m68k-softmmu microblazeel-softmmu mips64el-softmmu nios2-softmmu artifacts: + when: on_success paths: - build/qemu-setup*.exe
@@ -184,6 +185,7 @@ cross-win64-system: or1k-softmmu rx-softmmu sh4eb-softmmu sparc64-softmmu tricore-softmmu xtensaeb-softmmu artifacts: + when: on_success paths: - build/qemu-setup*.exe
.gitlab-ci.d/opensbi.yml +1 -0
@@ -63,6 +63,7 @@ build-opensbi: stage: build needs: ['docker-opensbi'] artifacts: + when: on_success paths: # 'artifacts.zip' will contains the following files: - pc-bios/opensbi-riscv32-generic-fw_dynamic.bin - pc-bios/opensbi-riscv64-generic-fw_dynamic.bin
Signature · 1 line
2.39.2
PATCH v2 2/6 gitlab: ensure coverage job also publishes meson log
In reply to Alex BennéeFrom: Daniel P. Berrangé <[email protected]>
The coverage job wants to publish a coverage report on success, but the tests might fail and in that case we need the meson logs for debugging.
Message-Id: <[email protected]>
Message-Id: <[email protected]>
--- .gitlab-ci.d/buildtest.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
.gitlab-ci.d/buildtest.yml +4 -1
@@ -462,9 +462,12 @@ gcov: coverage: /^\s*lines:\s*\d+.\d+\%/ artifacts: name: ${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHA} - when: on_success + when: always expire_in: 2 days + paths: + - build/meson-logs/testlog.txt reports: + junit: build/meson-logs/testlog.junit.xml coverage_report: coverage_format: cobertura path: build/coverage.xml
Signature · 1 line
2.39.2
PATCH v2 3/6 gitlab: reduce testing scope of check-gcov
In reply to Alex BennéeThis keeps timing out on gitlab due to some qtests taking a long time. As this is just ensuring the gcov machinery is working and not attempting to be comprehensive lets skip qtest in this run.
Message-Id: <[email protected]>
--- .gitlab-ci.d/buildtest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
.gitlab-ci.d/buildtest.yml +1 -1
@@ -454,7 +454,7 @@ gcov: IMAGE: ubuntu2204 CONFIGURE_ARGS: --enable-gcov TARGETS: aarch64-softmmu ppc64-softmmu s390x-softmmu x86_64-softmmu - MAKE_CHECK_ARGS: check + MAKE_CHECK_ARGS: check-unit check-softfloat after_script: - cd build - gcovr --xml-pretty --exclude-unreachable-branches --print-summary
Signature · 1 line
2.39.2
PATCH v2 4/6 docs/devel: remind developers to run CI container pipeline when updating images
In reply to Alex BennéeFrom: Ani Sinha <[email protected]>
When new dependencies and packages are added to containers, its important to run CI container generation pipelines on gitlab to make sure that there are no obvious conflicts between packages that are being added and those that are already present. Running CI container pipelines will make sure that there are no such breakages before we commit the change updating the containers. Add a line in the documentation reminding developers to run the pipeline before submitting the change. It will also ease the life of the maintainers.
Message-Id: <[email protected]>
--- docs/devel/testing.rst | 6 ++++++ 1 file changed, 6 insertions(+)
docs/devel/testing.rst +6 -0
@@ -485,6 +485,12 @@ first to contribute the mapping to the ``libvirt-ci`` project: `CI <https://www.qemu.org/docs/master/devel/ci.html>`__ documentation page on how to trigger gitlab CI pipelines on your change. + * Please also trigger gitlab container generation pipelines on your change + for as many OS distros as practical to make sure that there are no + obvious breakages when adding the new pre-requisite. Please see + `CI <https://www.qemu.org/docs/master/devel/ci.html>`__ documentation + page on how to trigger gitlab CI pipelines on your change. + For enterprise distros that default to old, end-of-life versions of the Python runtime, QEMU uses a separate set of mappings that work with more recent versions. These can be found in ``tests/lcitool/mappings.yml``.
Signature · 1 line
2.39.2
PATCH v2 5/6 tests/tcg: add mechanism to handle plugin arguments
In reply to Alex BennéeWe recently missed a regression that should have been picked up by check-tcg. This was because the libmem plugin is effectively a NOP if the user doesn't specify the type to use.
Rather than changing the default behaviour add an additional expansion so we can take this into account in future.
Message-Id: <[email protected]>
--- tests/tcg/Makefile.target | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
tests/tcg/Makefile.target +6 -2
@@ -169,13 +169,17 @@ extract-plugin = $(wordlist 2, 2, $(subst -with-, ,$1)) RUN_TESTS+=$(EXTRA_RUNS) +# Some plugins need additional arguments above the default to fully +# exercise things. We can define them on a per-test basis here. +run-plugin-%-with-libmem.so: PLUGIN_ARGS=$(COMMA)inline=true$(COMMA)callback=true + ifeq ($(filter %-softmmu, $(TARGET)),) run-%: % $(call run-test, $<, $(QEMU) $(QEMU_OPTS) $<) run-plugin-%: $(call run-test, $@, $(QEMU) $(QEMU_OPTS) \ - -plugin $(PLUGIN_LIB)/$(call extract-plugin,$@) \ + -plugin $(PLUGIN_LIB)/$(call extract-plugin,$@)$(PLUGIN_ARGS) \ -d plugin -D $*.pout \ $(call strip-plugin,$<)) else
@@ -189,7 +193,7 @@ run-plugin-%: $(call run-test, $@, \ $(QEMU) -monitor none -display none \ -chardev file$(COMMA)[email protected]$(COMMA)id=output \ - -plugin $(PLUGIN_LIB)/$(call extract-plugin,$@) \ + -plugin $(PLUGIN_LIB)/$(call extract-plugin,$@)$(PLUGIN_ARGS) \ -d plugin -D $*.pout \ $(QEMU_OPTS) $(call strip-plugin,$<)) endif
Signature · 1 line
2.39.2
PATCH v2 6/6 qemu-keymap: properly check return from xkb_keymap_mod_get_index
In reply to Alex BennéeWe can return XKB_MOD_INVALID which rightly gets flagged by sanitisers as an overly wide shift attempt.
--- qemu-keymap.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-)
qemu-keymap.c +16 -8
@@ -140,6 +140,18 @@ static void usage(FILE *out) names.options ?: "-"); } +static xkb_mod_mask_t get_mod (struct xkb_keymap *map,const char *name) +{ +xkb_mod_index_t mod; +xkb_mod_mask_t mask =0 ; + + mod =xkb_keymap_mod_get_index (map, name); +if (mod !=XKB_MOD_INVALID ) { + mask = (1 << mod); + } +return mask; +} +int main (int argc,char *argv[]) {struct xkb_context *ctx;
@@ -215,14 +227,10 @@ int main(int argc, char *argv[]) mod, xkb_keymap_mod_get_name(map, mod)); } - mod =xkb_keymap_mod_get_index (map,"Shift" ); - shift = (1 << mod); - mod =xkb_keymap_mod_get_index (map,"Control" ); - ctrl = (1 << mod); - mod =xkb_keymap_mod_get_index (map,"AltGr" ); - altgr = (1 << mod); - mod =xkb_keymap_mod_get_index (map,"NumLock" ); - numlock = (1 << mod); + shift =get_mod (map,"Shift" ); + ctrl =get_mod (map,"Control" ); + altgr =get_mod (map,"AltGr" ); + numlock =get_mod (map,"NumLock" ); state =xkb_state_new (map);xkb_keymap_key_for_each (map, walk_map, state);
Signature · 1 line
2.39.2
Re: [PATCH v2 6/6] qemu-keymap: properly check return from xkb_keymap_mod_get_index
Quoted 4 lines · Alex Bennée
We can return
XKB_MOD_INVALIDwhich rightly gets flagged by sanitisers as an overly wide shift attempt.Signed-off-by Alex Bennée <[email protected]>