diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2021-09-06 12:38:07 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2021-09-06 12:38:07 +0100 |
commit | 935efca6c246c108253b0e4e51cc87648fc7ca10 (patch) | |
tree | e910c5f35673968d71e7e7aae15d0ead9fff34e3 | |
parent | 88afdc92b644120e0182c8567e1b1d236e471b12 (diff) | |
parent | 6695e4c0fd9ef05bf6ab8e3402d5bc95b39c4cf3 (diff) | |
download | qemu-935efca6c246c108253b0e4e51cc87648fc7ca10.zip qemu-935efca6c246c108253b0e4e51cc87648fc7ca10.tar.gz qemu-935efca6c246c108253b0e4e51cc87648fc7ca10.tar.bz2 |
Merge remote-tracking branch 'remotes/thuth-gitlab/tags/pull-request-2021-09-06' into staging
* Add definitions of terms for CI/testing
* Fix g_setenv problem discovered by Coverity
* Gitlab CI improvements
* Build system improvements (configure script + meson.build)
* Removal of the show-fixed-bugs.sh script
* Clean up of the sdl and curses options
# gpg: Signature made Mon 06 Sep 2021 10:51:49 BST
# gpg: using RSA key 27B88847EEE0250118F3EAB92ED9D774FE702DB5
# gpg: issuer "thuth@redhat.com"
# gpg: Good signature from "Thomas Huth <th.huth@gmx.de>" [full]
# gpg: aka "Thomas Huth <thuth@redhat.com>" [full]
# gpg: aka "Thomas Huth <huth@tuxfamily.org>" [full]
# gpg: aka "Thomas Huth <th.huth@posteo.de>" [unknown]
# Primary key fingerprint: 27B8 8847 EEE0 2501 18F3 EAB9 2ED9 D774 FE70 2DB5
* remotes/thuth-gitlab/tags/pull-request-2021-09-06:
softmmu/vl: Deprecate the -sdl and -curses option
softmmu/vl: Deprecate the old grab options
softmmu/vl: Add a "grab-mod" parameter to the -display sdl option
scripts: Remove the "show-fixed-bugs.sh" file
configure / meson: Move the GBM handling to meson.build
meson.build: Don't use internal libfdt if the user requested the system libfdt
meson.build: Fix the check for a usable libfdt
gitlab-ci: Don't try to use the system libfdt in the debian job
libqtest: check for g_setenv() failure
docs: add definitions of terms for CI/testing
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r-- | .gitlab-ci.d/buildtest.yml | 1 | ||||
-rwxr-xr-x | configure | 14 | ||||
-rw-r--r-- | contrib/vhost-user-gpu/meson.build | 5 | ||||
-rw-r--r-- | docs/about/deprecated.rst | 20 | ||||
-rw-r--r-- | docs/devel/ci-definitions.rst | 121 | ||||
-rw-r--r-- | docs/devel/ci.rst | 1 | ||||
-rw-r--r-- | meson.build | 17 | ||||
-rw-r--r-- | qemu-options.hx | 18 | ||||
-rwxr-xr-x | scripts/show-fixed-bugs.sh | 91 | ||||
-rw-r--r-- | softmmu/vl.c | 24 | ||||
-rw-r--r-- | tests/qtest/libqtest.c | 4 |
11 files changed, 192 insertions, 124 deletions
diff --git a/.gitlab-ci.d/buildtest.yml b/.gitlab-ci.d/buildtest.yml index be4d90c..5c378e3 100644 --- a/.gitlab-ci.d/buildtest.yml +++ b/.gitlab-ci.d/buildtest.yml @@ -74,7 +74,6 @@ build-system-debian: job: amd64-debian-container variables: IMAGE: debian-amd64 - CONFIGURE_ARGS: --enable-fdt=system TARGETS: arm-softmmu avr-softmmu i386-softmmu mipsel-softmmu riscv64-softmmu sh4eb-softmmu sparc-softmmu xtensaeb-softmmu MAKE_CHECK_ARGS: check-build @@ -3451,13 +3451,6 @@ esac ########################################## # opengl probe (for sdl2, gtk) -gbm="no" -if $pkg_config gbm; then - gbm_cflags="$($pkg_config --cflags gbm)" - gbm_libs="$($pkg_config --libs gbm)" - gbm="yes" -fi - if test "$opengl" != "no" ; then epoxy=no if $pkg_config epoxy; then @@ -4688,13 +4681,6 @@ if test "$opengl" = "yes" ; then echo "OPENGL_LIBS=$opengl_libs" >> $config_host_mak fi -if test "$gbm" = "yes" ; then - echo "CONFIG_GBM=y" >> $config_host_mak - echo "GBM_LIBS=$gbm_libs" >> $config_host_mak - echo "GBM_CFLAGS=$gbm_cflags" >> $config_host_mak -fi - - if test "$avx2_opt" = "yes" ; then echo "CONFIG_AVX2_OPT=y" >> $config_host_mak fi diff --git a/contrib/vhost-user-gpu/meson.build b/contrib/vhost-user-gpu/meson.build index 4cb52a9..92c8f3a 100644 --- a/contrib/vhost-user-gpu/meson.build +++ b/contrib/vhost-user-gpu/meson.build @@ -1,6 +1,5 @@ -if 'CONFIG_TOOLS' in config_host and virgl.found() \ - and 'CONFIG_GBM' in config_host and 'CONFIG_LINUX' in config_host \ - and pixman.found() +if 'CONFIG_TOOLS' in config_host and virgl.found() and gbm.found() \ + and 'CONFIG_LINUX' in config_host and pixman.found() executable('vhost-user-gpu', files('vhost-user-gpu.c', 'virgl.c', 'vugbm.c'), dependencies: [qemuutil, pixman, gbm, virgl, vhost_user, opengl], install: true, diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index 6e88a84..9ee355e 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -138,6 +138,26 @@ an underscore between "window" and "close"). The ``-no-quit`` is a synonym for ``-display ...,window-close=off`` which should be used instead. +``-alt-grab`` and ``-display sdl,alt_grab=on`` (since 6.2) +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + +Use ``-display sdl,grab-mod=lshift-lctrl-lalt`` instead. + +``-ctrl-grab`` and ``-display sdl,ctrl_grab=on`` (since 6.2) +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + +Use ``-display sdl,grab-mod=rctrl`` instead. + +``-sdl`` (since 6.2) +'''''''''''''''''''' + +Use ``-display sdl`` instead. + +``-curses`` (since 6.2) +''''''''''''''''''''''' + +Use ``-display curses`` instead. + Plugin argument passing through ``arg=<string>`` (since 6.1) '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' diff --git a/docs/devel/ci-definitions.rst b/docs/devel/ci-definitions.rst new file mode 100644 index 0000000..32e22ff --- /dev/null +++ b/docs/devel/ci-definitions.rst @@ -0,0 +1,121 @@ +Definition of terms +=================== + +This section defines the terms used in this document and correlates them with +what is currently used on QEMU. + +Automated tests +--------------- + +An automated test is written on a test framework using its generic test +functions/classes. The test framework can run the tests and report their +success or failure [1]_. + +An automated test has essentially three parts: + +1. The test initialization of the parameters, where the expected parameters, + like inputs and expected results, are set up; +2. The call to the code that should be tested; +3. An assertion, comparing the result from the previous call with the expected + result set during the initialization of the parameters. If the result + matches the expected result, the test has been successful; otherwise, it has + failed. + +Unit testing +------------ + +A unit test is responsible for exercising individual software components as a +unit, like interfaces, data structures, and functionality, uncovering errors +within the boundaries of a component. The verification effort is in the +smallest software unit and focuses on the internal processing logic and data +structures. A test case of unit tests should be designed to uncover errors due +to erroneous computations, incorrect comparisons, or improper control flow [2]_. + +On QEMU, unit testing is represented by the 'check-unit' target from 'make'. + +Functional testing +------------------ + +A functional test focuses on the functional requirement of the software. +Deriving sets of input conditions, the functional tests should fully exercise +all the functional requirements for a program. Functional testing is +complementary to other testing techniques, attempting to find errors like +incorrect or missing functions, interface errors, behavior errors, and +initialization and termination errors [3]_. + +On QEMU, functional testing is represented by the 'check-qtest' target from +'make'. + +System testing +-------------- + +System tests ensure all application elements mesh properly while the overall +functionality and performance are achieved [4]_. Some or all system components +are integrated to create a complete system to be tested as a whole. System +testing ensures that components are compatible, interact correctly, and +transfer the right data at the right time across their interfaces. As system +testing focuses on interactions, use case-based testing is a practical approach +to system testing [5]_. Note that, in some cases, system testing may require +interaction with third-party software, like operating system images, databases, +networks, and so on. + +On QEMU, system testing is represented by the 'check-acceptance' target from +'make'. + +Flaky tests +----------- + +A flaky test is defined as a test that exhibits both a passing and a failing +result with the same code on different runs. Some usual reasons for an +intermittent/flaky test are async wait, concurrency, and test order dependency +[6]_. + +Gating +------ + +A gate restricts the move of code from one stage to another on a +test/deployment pipeline. The step move is granted with approval. The approval +can be a manual intervention or a set of tests succeeding [7]_. + +On QEMU, the gating process happens during the pull request. The approval is +done by the project leader running its own set of tests. The pull request gets +merged when the tests succeed. + +Continuous Integration (CI) +--------------------------- + +Continuous integration (CI) requires the builds of the entire application and +the execution of a comprehensive set of automated tests every time there is a +need to commit any set of changes [8]_. The automated tests can be composed of +the unit, functional, system, and other tests. + +Keynotes about continuous integration (CI) [9]_: + +1. System tests may depend on external software (operating system images, + firmware, database, network). +2. It may take a long time to build and test. It may be impractical to build + the system being developed several times per day. +3. If the development platform is different from the target platform, it may + not be possible to run system tests in the developer’s private workspace. + There may be differences in hardware, operating system, or installed + software. Therefore, more time is required for testing the system. + +References +---------- + +.. [1] Sommerville, Ian (2016). Software Engineering. p. 233. +.. [2] Pressman, Roger S. & Maxim, Bruce R. (2020). Software Engineering, + A Practitioner’s Approach. p. 48, 376, 378, 381. +.. [3] Pressman, Roger S. & Maxim, Bruce R. (2020). Software Engineering, + A Practitioner’s Approach. p. 388. +.. [4] Pressman, Roger S. & Maxim, Bruce R. (2020). Software Engineering, + A Practitioner’s Approach. Software Engineering, p. 377. +.. [5] Sommerville, Ian (2016). Software Engineering. p. 59, 232, 240. +.. [6] Luo, Qingzhou, et al. An empirical analysis of flaky tests. + Proceedings of the 22nd ACM SIGSOFT International Symposium on + Foundations of Software Engineering. 2014. +.. [7] Humble, Jez & Farley, David (2010). Continuous Delivery: + Reliable Software Releases Through Build, Test, and Deployment, p. 122. +.. [8] Humble, Jez & Farley, David (2010). Continuous Delivery: + Reliable Software Releases Through Build, Test, and Deployment, p. 55. +.. [9] Sommerville, Ian (2016). Software Engineering. p. 743. diff --git a/docs/devel/ci.rst b/docs/devel/ci.rst index a6a6509..8d95247 100644 --- a/docs/devel/ci.rst +++ b/docs/devel/ci.rst @@ -8,5 +8,6 @@ found at:: https://wiki.qemu.org/Testing/CI +.. include:: ci-definitions.rst .. include:: ci-jobs.rst .. include:: ci-runners.rst diff --git a/meson.build b/meson.build index bf63784..7e58e62 100644 --- a/meson.build +++ b/meson.build @@ -472,11 +472,6 @@ if not get_option('zstd').auto() or have_block required: get_option('zstd'), method: 'pkg-config', kwargs: static_kwargs) endif -gbm = not_found -if 'CONFIG_GBM' in config_host - gbm = declare_dependency(compile_args: config_host['GBM_CFLAGS'].split(), - link_args: config_host['GBM_LIBS'].split()) -endif virgl = not_found if not get_option('virglrenderer').auto() or have_system virgl = dependency('virglrenderer', @@ -816,11 +811,17 @@ coreaudio = not_found if 'CONFIG_AUDIO_COREAUDIO' in config_host coreaudio = declare_dependency(link_args: config_host['COREAUDIO_LIBS'].split()) endif + opengl = not_found if 'CONFIG_OPENGL' in config_host opengl = declare_dependency(compile_args: config_host['OPENGL_CFLAGS'].split(), link_args: config_host['OPENGL_LIBS'].split()) endif +gbm = not_found +if (have_system or have_tools) and (virgl.found() or opengl.found()) + gbm = dependency('gbm', method: 'pkg-config', required: false, + kwargs: static_kwargs) +endif gnutls = not_found gnutls_crypto = not_found @@ -1244,6 +1245,7 @@ config_host_data.set('CONFIG_MPATH', mpathpersist.found()) config_host_data.set('CONFIG_MPATH_NEW_API', mpathpersist_new_api) config_host_data.set('CONFIG_CURL', curl.found()) config_host_data.set('CONFIG_CURSES', curses.found()) +config_host_data.set('CONFIG_GBM', gbm.found()) config_host_data.set('CONFIG_GLUSTERFS', glusterfs.found()) if glusterfs.found() config_host_data.set('CONFIG_GLUSTERFS_XLATOR_OPT', glusterfs.version().version_compare('>=4')) @@ -1912,10 +1914,13 @@ if have_system int main(void) { fdt_check_full(NULL, 0); return 0; }''', dependencies: fdt) fdt_opt = 'system' + elif fdt_opt == 'system' + error('system libfdt requested, but it is too old (1.5.1 or newer required)') elif have_internal fdt_opt = 'internal' else fdt_opt = 'disabled' + fdt = not_found endif endif if fdt_opt == 'internal' @@ -3083,7 +3088,7 @@ summary_info += {'U2F support': u2f.found()} summary_info += {'libusb': libusb.found()} summary_info += {'usb net redir': usbredir.found()} summary_info += {'OpenGL support': config_host.has_key('CONFIG_OPENGL')} -summary_info += {'GBM': config_host.has_key('CONFIG_GBM')} +summary_info += {'GBM': gbm.found()} summary_info += {'libiscsi support': libiscsi.found()} summary_info += {'libnfs support': libnfs.found()} if targetos == 'windows' diff --git a/qemu-options.hx b/qemu-options.hx index 4a9ee72..8f603cc 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -1834,7 +1834,7 @@ DEF("display", HAS_ARG, QEMU_OPTION_display, #endif #if defined(CONFIG_SDL) "-display sdl[,alt_grab=on|off][,ctrl_grab=on|off][,gl=on|core|es|off]\n" - " [,show-cursor=on|off][,window-close=on|off]\n" + " [,grab-mod=<mod>][,show-cursor=on|off][,window-close=on|off]\n" #endif #if defined(CONFIG_GTK) "-display gtk[,full-screen=on|off][,gl=on|off][,grab-on-hover=on|off]\n" @@ -1880,9 +1880,15 @@ SRST window; see the SDL documentation for other possibilities). Valid parameters are: - ``alt_grab=on|off`` : Use Control+Alt+Shift-g to toggle mouse grabbing + ``grab-mod=<mods>`` : Used to select the modifier keys for toggling + the mouse grabbing in conjunction with the "g" key. `<mods>` can be + either `lshift-lctrl-lalt` or `rctrl`. + + ``alt_grab=on|off`` : Use Control+Alt+Shift-g to toggle mouse grabbing. + This parameter is deprecated - use ``grab-mod`` instead. - ``ctrl_grab=on|off`` : Use Right-Control-g to toggle mouse grabbing + ``ctrl_grab=on|off`` : Use Right-Control-g to toggle mouse grabbing. + This parameter is deprecated - use ``grab-mod`` instead. ``gl=on|off|core|es`` : Use OpenGL for displaying @@ -1967,7 +1973,8 @@ SRST ``-alt-grab`` Use Ctrl-Alt-Shift to grab mouse (instead of Ctrl-Alt). Note that this also affects the special keys (for fullscreen, monitor-mode - switching, etc). + switching, etc). This option is deprecated - please use + ``-display sdl,grab-mod=lshift-lctrl-lalt`` instead. ERST DEF("ctrl-grab", 0, QEMU_OPTION_ctrl_grab, @@ -1977,7 +1984,8 @@ SRST ``-ctrl-grab`` Use Right-Ctrl to grab mouse (instead of Ctrl-Alt). Note that this also affects the special keys (for fullscreen, monitor-mode - switching, etc). + switching, etc). This option is deprecated - please use + ``-display sdl,grab-mod=rctrl`` instead. ERST DEF("no-quit", 0, QEMU_OPTION_no_quit, diff --git a/scripts/show-fixed-bugs.sh b/scripts/show-fixed-bugs.sh deleted file mode 100755 index a095a4d..0000000 --- a/scripts/show-fixed-bugs.sh +++ /dev/null @@ -1,91 +0,0 @@ -#!/bin/sh - -# This script checks the git log for URLs to the QEMU launchpad bugtracker -# and optionally checks whether the corresponding bugs are not closed yet. - -show_help () { - echo "Usage:" - echo " -s <commit> : Start searching at this commit" - echo " -e <commit> : End searching at this commit" - echo " -c : Check if bugs are still open" - echo " -b : Open bugs in browser" -} - -while getopts "s:e:cbh" opt; do - case "$opt" in - s) start="$OPTARG" ;; - e) end="$OPTARG" ;; - c) check_if_open=1 ;; - b) show_in_browser=1 ;; - h) show_help ; exit 0 ;; - *) echo "Use -h for help." ; exit 1 ;; - esac -done - -if [ "x$start" = "x" ]; then - start=$(git tag -l 'v[0-9]*\.[0-9]*\.0' | tail -n 2 | head -n 1) -fi -if [ "x$end" = "x" ]; then - end=$(git tag -l 'v[0-9]*\.[0-9]*\.0' | tail -n 1) -fi - -if [ "x$start" = "x" ] || [ "x$end" = "x" ]; then - echo "Could not determine start or end revision ... Please note that this" - echo "script must be run from a checked out git repository of QEMU." - exit 1 -fi - -echo "Searching git log for bugs in the range $start..$end" - -urlstr='https://bugs.launchpad.net/\(bugs\|qemu/+bug\)/' -bug_urls=$(git log $start..$end \ - | sed -n '\,'"$urlstr"', s,\(.*\)\('"$urlstr"'\)\([0-9]*\).*,\2\4,p' \ - | sort -u) - -echo Found bug URLs: -for i in $bug_urls ; do echo " $i" ; done - -if [ "x$check_if_open" = "x1" ]; then - echo - echo "Checking which ones are still open..." - for i in $bug_urls ; do - if ! curl -s -L "$i" | grep "value status" | grep -q "Fix Released" ; then - echo " $i" - final_bug_urls="$final_bug_urls $i" - fi - done -else - final_bug_urls=$bug_urls -fi - -if [ "x$final_bug_urls" = "x" ]; then - echo "No open bugs found." -elif [ "x$show_in_browser" = "x1" ]; then - # Try to determine which browser we should use - if [ "x$BROWSER" != "x" ]; then - bugbrowser="$BROWSER" - elif command -v xdg-open >/dev/null 2>&1; then - bugbrowser=xdg-open - elif command -v gnome-open >/dev/null 2>&1; then - bugbrowser=gnome-open - elif [ "$(uname)" = "Darwin" ]; then - bugbrowser=open - elif command -v sensible-browser >/dev/null 2>&1; then - bugbrowser=sensible-browser - else - echo "Please set the BROWSER variable to the browser of your choice." - exit 1 - fi - # Now show the bugs in the browser - first=1 - for i in $final_bug_urls; do - "$bugbrowser" "$i" - if [ $first = 1 ]; then - # if it is the first entry, give the browser some time to start - # (to avoid messages like "Firefox is already running, but is - # not responding...") - sleep 4 - first=0 - fi - done -fi diff --git a/softmmu/vl.c b/softmmu/vl.c index ea05bb3..55ab70e 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -1017,15 +1017,24 @@ static void parse_display(const char *p) * parse_display_qapi() due to some options not in * DisplayOptions, specifically: * - ctrl_grab + alt_grab - * Not clear yet what happens to them long-term. Should - * replaced by something better or deprecated and dropped. + * They can't be moved into the QAPI since they use underscores, + * thus they will get replaced by "grab-mod" in the long term */ #if defined(CONFIG_SDL) dpy.type = DISPLAY_TYPE_SDL; while (*opts) { const char *nextopt; - if (strstart(opts, ",alt_grab=", &nextopt)) { + if (strstart(opts, ",grab-mod=", &nextopt)) { + opts = nextopt; + if (strstart(opts, "lshift-lctrl-lalt", &nextopt)) { + alt_grab = 1; + } else if (strstart(opts, "rctrl", &nextopt)) { + ctrl_grab = 1; + } else { + goto invalid_sdl_args; + } + } else if (strstart(opts, ",alt_grab=", &nextopt)) { opts = nextopt; if (strstart(opts, "on", &nextopt)) { alt_grab = 1; @@ -1034,6 +1043,7 @@ static void parse_display(const char *p) } else { goto invalid_sdl_args; } + warn_report("alt_grab is deprecated, use grab-mod instead."); } else if (strstart(opts, ",ctrl_grab=", &nextopt)) { opts = nextopt; if (strstart(opts, "on", &nextopt)) { @@ -1043,6 +1053,7 @@ static void parse_display(const char *p) } else { goto invalid_sdl_args; } + warn_report("ctrl_grab is deprecated, use grab-mod instead."); } else if (strstart(opts, ",window_close=", &nextopt) || strstart(opts, ",window-close=", &nextopt)) { if (strstart(opts, ",window_close=", NULL)) { @@ -2878,6 +2889,8 @@ void qemu_init(int argc, char **argv, char **envp) dpy.type = DISPLAY_TYPE_NONE; break; case QEMU_OPTION_curses: + warn_report("-curses is deprecated, " + "use -display curses instead."); #ifdef CONFIG_CURSES dpy.type = DISPLAY_TYPE_CURSES; #else @@ -3236,9 +3249,13 @@ void qemu_init(int argc, char **argv, char **envp) break; case QEMU_OPTION_alt_grab: alt_grab = 1; + warn_report("-alt-grab is deprecated, please use " + "-display sdl,grab-mod=lshift-lctrl-lalt instead."); break; case QEMU_OPTION_ctrl_grab: ctrl_grab = 1; + warn_report("-ctrl-grab is deprecated, please use " + "-display sdl,grab-mod=rctrl instead."); break; case QEMU_OPTION_no_quit: dpy.has_window_close = true; @@ -3247,6 +3264,7 @@ void qemu_init(int argc, char **argv, char **envp) "-display ...,window-close=off instead."); break; case QEMU_OPTION_sdl: + warn_report("-sdl is deprecated, use -display sdl instead."); #ifdef CONFIG_SDL dpy.type = DISPLAY_TYPE_SDL; break; diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c index 825b13a..73f6b97 100644 --- a/tests/qtest/libqtest.c +++ b/tests/qtest/libqtest.c @@ -301,7 +301,9 @@ QTestState *qtest_init_without_qmp_handshake(const char *extra_args) s->expected_status = 0; s->qemu_pid = fork(); if (s->qemu_pid == 0) { - g_setenv("QEMU_AUDIO_DRV", "none", true); + if (!g_setenv("QEMU_AUDIO_DRV", "none", true)) { + exit(1); + } execlp("/bin/sh", "sh", "-c", command, NULL); exit(1); } |