All of lore.kernel.org
 help / color / mirror / Atom feed
* [PULL 00/13] Testing, build system and misc patches
@ 2021-09-02 12:48 Thomas Huth
  2021-09-02 12:48 ` [PULL 01/13] docs: add definitions of terms for CI/testing Thomas Huth
                   ` (13 more replies)
  0 siblings, 14 replies; 21+ messages in thread
From: Thomas Huth @ 2021-09-02 12:48 UTC (permalink / raw)
  To: qemu-devel, Peter Maydell

 Hi Peter,

the following changes since commit 59a89510b62ec23dbeab8b02fa4e3526e353d8b6:

  Merge remote-tracking branch 'remotes/stefanberger/tags/pull-tpm-2021-09-01-1' into staging (2021-09-02 08:51:31 +0100)

are available in the Git repository at:

  https://gitlab.com/thuth/qemu.git tags/pull-request-2021-09-02

for you to fetch changes up to c72dc94b74fb1686decc0ca4c2b05e5bf2e5b74b:

  softmmu/vl: Deprecate the -sdl and -curses option (2021-09-02 14:43:58 +0200)

----------------------------------------------------------------
* 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

----------------------------------------------------------------
Peter Maydell (1):
      libqtest: check for g_setenv() failure

Thomas Huth (11):
      gitlab-ci: Merge "build-disabled" with "build-without-default-features"
      gitlab-ci: Remove superfluous "dnf install" statement
      gitlab-ci: Fix ..._RUNNER_AVAILABLE variables and document them
      gitlab-ci: Don't try to use the system libfdt in the debian job
      meson.build: Fix the check for a usable libfdt
      meson.build: Don't use internal libfdt if the user requested the system libfdt
      configure / meson: Move the GBM handling to meson.build
      scripts: Remove the "show-fixed-bugs.sh" file
      softmmu/vl: Add a "grab-mod" parameter to the -display sdl option
      softmmu/vl: Deprecate the old grab options
      softmmu/vl: Deprecate the -sdl and -curses option

Willian Rampazzo (1):
      docs: add definitions of terms for CI/testing

 .gitlab-ci.d/buildtest.yml         | 100 ++++--------------------------
 .gitlab-ci.d/custom-runners.yml    |  12 ++--
 configure                          |  14 -----
 contrib/vhost-user-gpu/meson.build |   5 +-
 docs/about/deprecated.rst          |  20 ++++++
 docs/devel/ci-definitions.rst      | 121 +++++++++++++++++++++++++++++++++++++
 docs/devel/ci-jobs.rst             |  11 ++++
 docs/devel/ci.rst                  |   1 +
 meson.build                        |  17 ++++--
 qemu-options.hx                    |  18 ++++--
 scripts/show-fixed-bugs.sh         |  91 ----------------------------
 softmmu/vl.c                       |  24 +++++++-
 tests/qtest/libqtest.c             |   4 +-
 13 files changed, 222 insertions(+), 216 deletions(-)
 create mode 100644 docs/devel/ci-definitions.rst
 delete mode 100755 scripts/show-fixed-bugs.sh



^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PULL 01/13] docs: add definitions of terms for CI/testing
  2021-09-02 12:48 [PULL 00/13] Testing, build system and misc patches Thomas Huth
@ 2021-09-02 12:48 ` Thomas Huth
  2021-09-02 12:49 ` [PULL 02/13] libqtest: check for g_setenv() failure Thomas Huth
                   ` (12 subsequent siblings)
  13 siblings, 0 replies; 21+ messages in thread
From: Thomas Huth @ 2021-09-02 12:48 UTC (permalink / raw)
  To: qemu-devel, Peter Maydell

From: Willian Rampazzo <willianr@redhat.com>

To understand the current state of QEMU CI/testing and have a base to
discuss the plans for the future, it is important to define some usual
terms. This patch defines the terms for "Automated tests", "Unit
testing", "Functional testing", "System testing", "Flaky tests",
"Gating", and "Continuous Integration".

Signed-off-by: Willian Rampazzo <willianr@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210831152939.97570-2-willianr@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 docs/devel/ci-definitions.rst | 121 ++++++++++++++++++++++++++++++++++
 docs/devel/ci.rst             |   1 +
 2 files changed, 122 insertions(+)
 create mode 100644 docs/devel/ci-definitions.rst

diff --git a/docs/devel/ci-definitions.rst b/docs/devel/ci-definitions.rst
new file mode 100644
index 0000000000..32e22ff468
--- /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 a6a650968b..8d95247188 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
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PULL 02/13] libqtest: check for g_setenv() failure
  2021-09-02 12:48 [PULL 00/13] Testing, build system and misc patches Thomas Huth
  2021-09-02 12:48 ` [PULL 01/13] docs: add definitions of terms for CI/testing Thomas Huth
@ 2021-09-02 12:49 ` Thomas Huth
  2021-09-02 12:49 ` [PULL 03/13] gitlab-ci: Merge "build-disabled" with "build-without-default-features" Thomas Huth
                   ` (11 subsequent siblings)
  13 siblings, 0 replies; 21+ messages in thread
From: Thomas Huth @ 2021-09-02 12:49 UTC (permalink / raw)
  To: qemu-devel, Peter Maydell

From: Peter Maydell <peter.maydell@linaro.org>

g_setenv() can fail; check for it when starting a QEMU process
when we set the QEMU_AUDIO_DRV environment variable.

Because this happens after fork() reporting an exact message
via printf() is a bad idea; just exit(1), as we already do
for the case of execlp() failure.

Fixes: Coverity CID 1460117
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210820163750.9106-1-peter.maydell@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/qtest/libqtest.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c
index 825b13a44c..73f6b977a6 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);
     }
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PULL 03/13] gitlab-ci: Merge "build-disabled" with "build-without-default-features"
  2021-09-02 12:48 [PULL 00/13] Testing, build system and misc patches Thomas Huth
  2021-09-02 12:48 ` [PULL 01/13] docs: add definitions of terms for CI/testing Thomas Huth
  2021-09-02 12:49 ` [PULL 02/13] libqtest: check for g_setenv() failure Thomas Huth
@ 2021-09-02 12:49 ` Thomas Huth
  2021-09-02 12:49 ` [PULL 04/13] gitlab-ci: Remove superfluous "dnf install" statement Thomas Huth
                   ` (10 subsequent siblings)
  13 siblings, 0 replies; 21+ messages in thread
From: Thomas Huth @ 2021-09-02 12:49 UTC (permalink / raw)
  To: qemu-devel, Peter Maydell

Both jobs are testing more or less the same thing (building QEMU with
features disabled), so we are wasting precious CI cycles here by doing
this twice. Merge the jobs by using --without-default-features by default
and just adding some additional --disable-... switches which are not
covered by the generic switch (yet). And while we're at it, also test
compilation with "--disable-fdt" (which forces us to change the list
of targets in this job, though, since some targets do not work without
fdt).

Message-Id: <20210730143809.717079-2-thuth@redhat.com>
Reviewed-by: Willian Rampazzo <willianr@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 .gitlab-ci.d/buildtest.yml | 97 +++++---------------------------------
 1 file changed, 13 insertions(+), 84 deletions(-)

diff --git a/.gitlab-ci.d/buildtest.yml b/.gitlab-ci.d/buildtest.yml
index 903ee65f32..f390f98044 100644
--- a/.gitlab-ci.d/buildtest.yml
+++ b/.gitlab-ci.d/buildtest.yml
@@ -202,85 +202,6 @@ acceptance-system-opensuse:
     MAKE_CHECK_ARGS: check-acceptance
 
 
-build-disabled:
-  extends: .native_build_job_template
-  needs:
-    job: amd64-fedora-container
-  variables:
-    IMAGE: fedora
-    CONFIGURE_ARGS:
-      --disable-attr
-      --disable-auth-pam
-      --disable-avx2
-      --disable-bochs
-      --disable-brlapi
-      --disable-bzip2
-      --disable-cap-ng
-      --disable-capstone
-      --disable-cloop
-      --disable-coroutine-pool
-      --disable-curl
-      --disable-curses
-      --disable-dmg
-      --disable-docs
-      --disable-gcrypt
-      --disable-glusterfs
-      --disable-gnutls
-      --disable-gtk
-      --disable-guest-agent
-      --disable-iconv
-      --disable-keyring
-      --disable-kvm
-      --disable-libiscsi
-      --disable-libpmem
-      --disable-libssh
-      --disable-libudev
-      --disable-libusb
-      --disable-libxml2
-      --disable-linux-aio
-      --disable-live-block-migration
-      --disable-lzo
-      --disable-malloc-trim
-      --disable-mpath
-      --disable-nettle
-      --disable-numa
-      --disable-opengl
-      --disable-parallels
-      --disable-pie
-      --disable-qcow1
-      --disable-qed
-      --disable-qom-cast-debug
-      --disable-rbd
-      --disable-rdma
-      --disable-replication
-      --disable-sdl
-      --disable-seccomp
-      --disable-slirp
-      --disable-smartcard
-      --disable-snappy
-      --disable-sparse
-      --disable-spice
-      --disable-strip
-      --disable-tpm
-      --disable-usb-redir
-      --disable-vdi
-      --disable-vhost-crypto
-      --disable-vhost-net
-      --disable-vhost-scsi
-      --disable-vhost-kernel
-      --disable-vhost-user
-      --disable-vhost-vdpa
-      --disable-vhost-vsock
-      --disable-virglrenderer
-      --disable-vnc
-      --disable-vte
-      --disable-vvfat
-      --disable-xen
-      --disable-zstd
-    TARGETS: arm-softmmu i386-softmmu ppc64-softmmu mips64-softmmu
-      s390x-softmmu i386-linux-user
-    MAKE_CHECK_ARGS: check-qtest SPEED=slow
-
 # This jobs explicitly disable TCG (--disable-tcg), KVM is detected by
 # the configure script. The container doesn't contain Xen headers so
 # Xen accelerator is not detected / selected. As result it build the
@@ -649,12 +570,20 @@ build-without-default-devices:
 build-without-default-features:
   extends: .native_build_job_template
   needs:
-    job: amd64-debian-container
+    job: amd64-fedora-container
   variables:
-    IMAGE: debian-amd64
-    CONFIGURE_ARGS: --without-default-features --disable-user
-        --target-list-exclude=arm-softmmu,i386-softmmu,mipsel-softmmu,mips64-softmmu,ppc-softmmu
-    MAKE_CHECK_ARGS: check-unit
+    IMAGE: fedora
+    CONFIGURE_ARGS:
+      --without-default-features
+      --disable-capstone
+      --disable-fdt
+      --disable-pie
+      --disable-qom-cast-debug
+      --disable-slirp
+      --disable-strip
+    TARGETS: avr-softmmu i386-softmmu mips64-softmmu s390x-softmmu sh4-softmmu
+      sparc64-softmmu hexagon-linux-user i386-linux-user s390x-linux-user
+    MAKE_CHECK_ARGS: check-unit check-qtest SPEED=slow
 
 build-libvhost-user:
   stage: build
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PULL 04/13] gitlab-ci: Remove superfluous "dnf install" statement
  2021-09-02 12:48 [PULL 00/13] Testing, build system and misc patches Thomas Huth
                   ` (2 preceding siblings ...)
  2021-09-02 12:49 ` [PULL 03/13] gitlab-ci: Merge "build-disabled" with "build-without-default-features" Thomas Huth
@ 2021-09-02 12:49 ` Thomas Huth
  2021-09-02 12:49 ` [PULL 05/13] gitlab-ci: Fix ..._RUNNER_AVAILABLE variables and document them Thomas Huth
                   ` (9 subsequent siblings)
  13 siblings, 0 replies; 21+ messages in thread
From: Thomas Huth @ 2021-09-02 12:49 UTC (permalink / raw)
  To: qemu-devel, Peter Maydell

The container already features meson and ninja, so there is no need
to try to install it with dnf again.

Message-Id: <20210730143809.717079-3-thuth@redhat.com>
Reviewed-by: Willian Rampazzo <willianr@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 .gitlab-ci.d/buildtest.yml | 2 --
 1 file changed, 2 deletions(-)

diff --git a/.gitlab-ci.d/buildtest.yml b/.gitlab-ci.d/buildtest.yml
index f390f98044..38f08452f1 100644
--- a/.gitlab-ci.d/buildtest.yml
+++ b/.gitlab-ci.d/buildtest.yml
@@ -590,8 +590,6 @@ build-libvhost-user:
   image: $CI_REGISTRY_IMAGE/qemu/fedora:latest
   needs:
     job: amd64-fedora-container
-  before_script:
-    - dnf install -y meson ninja-build
   script:
     - mkdir subprojects/libvhost-user/build
     - cd subprojects/libvhost-user/build
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PULL 05/13] gitlab-ci: Fix ..._RUNNER_AVAILABLE variables and document them
  2021-09-02 12:48 [PULL 00/13] Testing, build system and misc patches Thomas Huth
                   ` (3 preceding siblings ...)
  2021-09-02 12:49 ` [PULL 04/13] gitlab-ci: Remove superfluous "dnf install" statement Thomas Huth
@ 2021-09-02 12:49 ` Thomas Huth
  2021-09-02 12:49 ` [PULL 06/13] gitlab-ci: Don't try to use the system libfdt in the debian job Thomas Huth
                   ` (8 subsequent siblings)
  13 siblings, 0 replies; 21+ messages in thread
From: Thomas Huth @ 2021-09-02 12:49 UTC (permalink / raw)
  To: qemu-devel, Peter Maydell

The patch that recently introduced the S390X_RUNNER_AVAILABLE variable
in custom-runners.yml missed that the bottom half of the file is rather
about aarch64 than s390x. Thus rename the S390X_RUNNER_AVAILABLE to
AARCH64_RUNNER_AVAILABLE in those jobs.

Finally mention both variables in our CI documentation, too.

Fixes: c5dd0f0342 ("Improve rules for the staging branch")
Message-Id: <20210730143809.717079-4-thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Willian Rampazzo <willianr@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 .gitlab-ci.d/custom-runners.yml | 12 ++++++------
 docs/devel/ci-jobs.rst          | 11 +++++++++++
 2 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/.gitlab-ci.d/custom-runners.yml b/.gitlab-ci.d/custom-runners.yml
index 564b94565d..0d3e4a7b4b 100644
--- a/.gitlab-ci.d/custom-runners.yml
+++ b/.gitlab-ci.d/custom-runners.yml
@@ -137,7 +137,7 @@ ubuntu-20.04-aarch64-all-linux-static:
  - aarch64
  rules:
  - if: '$CI_PROJECT_NAMESPACE == "qemu-project" && $CI_COMMIT_BRANCH =~ /^staging/'
- - if: "$S390X_RUNNER_AVAILABLE"
+ - if: "$AARCH64_RUNNER_AVAILABLE"
  script:
  # --disable-libssh is needed because of https://bugs.launchpad.net/qemu/+bug/1838763
  # --disable-glusterfs is needed because there's no static version of those libs in distro supplied packages
@@ -157,7 +157,7 @@ ubuntu-20.04-aarch64-all:
  - aarch64
  rules:
  - if: '$CI_PROJECT_NAMESPACE == "qemu-project" && $CI_COMMIT_BRANCH =~ /^staging/'
- - if: "$S390X_RUNNER_AVAILABLE"
+ - if: "$AARCH64_RUNNER_AVAILABLE"
  script:
  - mkdir build
  - cd build
@@ -174,7 +174,7 @@ ubuntu-20.04-aarch64-alldbg:
  - aarch64
  rules:
  - if: '$CI_PROJECT_NAMESPACE == "qemu-project" && $CI_COMMIT_BRANCH =~ /^staging/'
- - if: "$S390X_RUNNER_AVAILABLE"
+ - if: "$AARCH64_RUNNER_AVAILABLE"
  script:
  - mkdir build
  - cd build
@@ -193,7 +193,7 @@ ubuntu-20.04-aarch64-clang:
  rules:
  - if: '$CI_PROJECT_NAMESPACE == "qemu-project" && $CI_COMMIT_BRANCH =~ /^staging/'
    when: manual
- - if: "$S390X_RUNNER_AVAILABLE"
+ - if: "$AARCH64_RUNNER_AVAILABLE"
    when: manual
  script:
  - mkdir build
@@ -211,7 +211,7 @@ ubuntu-20.04-aarch64-tci:
  - aarch64
  rules:
  - if: '$CI_PROJECT_NAMESPACE == "qemu-project" && $CI_COMMIT_BRANCH =~ /^staging/'
- - if: "$S390X_RUNNER_AVAILABLE"
+ - if: "$AARCH64_RUNNER_AVAILABLE"
  script:
  - mkdir build
  - cd build
@@ -228,7 +228,7 @@ ubuntu-20.04-aarch64-notcg:
  rules:
  - if: '$CI_PROJECT_NAMESPACE == "qemu-project" && $CI_COMMIT_BRANCH =~ /^staging/'
    when: manual
- - if: "$S390X_RUNNER_AVAILABLE"
+ - if: "$AARCH64_RUNNER_AVAILABLE"
    when: manual
  script:
  - mkdir build
diff --git a/docs/devel/ci-jobs.rst b/docs/devel/ci-jobs.rst
index 9cd9819786..277975e4ad 100644
--- a/docs/devel/ci-jobs.rst
+++ b/docs/devel/ci-jobs.rst
@@ -38,3 +38,14 @@ these artifacts are not already cached, downloading them make the jobs
 reach the timeout limit). Set this variable to have the tests using the
 Avocado framework run automatically.
 
+AARCH64_RUNNER_AVAILABLE
+~~~~~~~~~~~~~~~~~~~~~~~~
+If you've got access to an aarch64 host that can be used as a gitlab-CI
+runner, you can set this variable to enable the tests that require this
+kind of host. The runner should be tagged with "aarch64".
+
+S390X_RUNNER_AVAILABLE
+~~~~~~~~~~~~~~~~~~~~~~
+If you've got access to an IBM Z host that can be used as a gitlab-CI
+runner, you can set this variable to enable the tests that require this
+kind of host. The runner should be tagged with "s390x".
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PULL 06/13] gitlab-ci: Don't try to use the system libfdt in the debian job
  2021-09-02 12:48 [PULL 00/13] Testing, build system and misc patches Thomas Huth
                   ` (4 preceding siblings ...)
  2021-09-02 12:49 ` [PULL 05/13] gitlab-ci: Fix ..._RUNNER_AVAILABLE variables and document them Thomas Huth
@ 2021-09-02 12:49 ` Thomas Huth
  2021-09-02 12:49 ` [PULL 07/13] meson.build: Fix the check for a usable libfdt Thomas Huth
                   ` (7 subsequent siblings)
  13 siblings, 0 replies; 21+ messages in thread
From: Thomas Huth @ 2021-09-02 12:49 UTC (permalink / raw)
  To: qemu-devel, Peter Maydell

libfdt in Debian is too old to be usable for QEMU. So far we were
silently falling back to the internal dtc submodule, but since
this is wrong, let's remove the --enable-fdt=system switch here now.

Message-Id: <20210827151718.178988-1-thuth@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 .gitlab-ci.d/buildtest.yml | 1 -
 1 file changed, 1 deletion(-)

diff --git a/.gitlab-ci.d/buildtest.yml b/.gitlab-ci.d/buildtest.yml
index 38f08452f1..175ebe43d3 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
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PULL 07/13] meson.build: Fix the check for a usable libfdt
  2021-09-02 12:48 [PULL 00/13] Testing, build system and misc patches Thomas Huth
                   ` (5 preceding siblings ...)
  2021-09-02 12:49 ` [PULL 06/13] gitlab-ci: Don't try to use the system libfdt in the debian job Thomas Huth
@ 2021-09-02 12:49 ` Thomas Huth
  2021-09-02 12:49 ` [PULL 08/13] meson.build: Don't use internal libfdt if the user requested the system libfdt Thomas Huth
                   ` (6 subsequent siblings)
  13 siblings, 0 replies; 21+ messages in thread
From: Thomas Huth @ 2021-09-02 12:49 UTC (permalink / raw)
  To: qemu-devel, Peter Maydell

The check for libfdt currently has a flaw: If there is a system libfdt, the
meson.build code initialized the fdt variable with fdt = cc.find_library(...).
However, if this libfdt is too old and there is no internal dtc module
available, it continues with "fdt" pointing to the old and unusable version.
The check later in the file that tries to detect whether libfdt is necessary
then fails to trigger:

 if not fdt.found() and fdt_required.length() > 0
  error('fdt not available but required by targets ' + ', '.join(fdt_required))
 endif

The build fails then during compilation instead, which is of course bad
since this is quite confusing and already wasted quite some time of the user.
Thus if libfdt is not usable, we should unset the "fdt" variable immediately
again, so that the build already fails during the configuration phase.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/255
Message-Id: <20210827120901.150276-2-thuth@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 meson.build | 1 +
 1 file changed, 1 insertion(+)

diff --git a/meson.build b/meson.build
index bf63784812..6f7177428e 100644
--- a/meson.build
+++ b/meson.build
@@ -1916,6 +1916,7 @@ if have_system
       fdt_opt = 'internal'
     else
       fdt_opt = 'disabled'
+      fdt = not_found
     endif
   endif
   if fdt_opt == 'internal'
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PULL 08/13] meson.build: Don't use internal libfdt if the user requested the system libfdt
  2021-09-02 12:48 [PULL 00/13] Testing, build system and misc patches Thomas Huth
                   ` (6 preceding siblings ...)
  2021-09-02 12:49 ` [PULL 07/13] meson.build: Fix the check for a usable libfdt Thomas Huth
@ 2021-09-02 12:49 ` Thomas Huth
  2021-09-02 12:49 ` [PULL 09/13] configure / meson: Move the GBM handling to meson.build Thomas Huth
                   ` (5 subsequent siblings)
  13 siblings, 0 replies; 21+ messages in thread
From: Thomas Huth @ 2021-09-02 12:49 UTC (permalink / raw)
  To: qemu-devel, Peter Maydell

If the users ran configure with --enable-libfdt=system, they likely did
that on purpose. We should not silently fall back to the internal libfdt
if the system libfdt is not usable, but report the problem with a proper
message instead.

Message-Id: <20210827120901.150276-3-thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 meson.build | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meson.build b/meson.build
index 6f7177428e..ecfdce921c 100644
--- a/meson.build
+++ b/meson.build
@@ -1912,6 +1912,8 @@ 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
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PULL 09/13] configure / meson: Move the GBM handling to meson.build
  2021-09-02 12:48 [PULL 00/13] Testing, build system and misc patches Thomas Huth
                   ` (7 preceding siblings ...)
  2021-09-02 12:49 ` [PULL 08/13] meson.build: Don't use internal libfdt if the user requested the system libfdt Thomas Huth
@ 2021-09-02 12:49 ` Thomas Huth
  2021-09-02 12:49 ` [PULL 10/13] scripts: Remove the "show-fixed-bugs.sh" file Thomas Huth
                   ` (4 subsequent siblings)
  13 siblings, 0 replies; 21+ messages in thread
From: Thomas Huth @ 2021-09-02 12:49 UTC (permalink / raw)
  To: qemu-devel, Peter Maydell

The GBM library detection does not need to be in the configure script,
since it does not have any user-facing options (there are no
--enable-gbm or --disable-gbm switches). Let's move it to meson.build
instead, so we don't have to clutter config-host.mak with the related
switches.

Additionally, only check for GBM if it is really required, i.e. if we
either compile with OpenGL or with virglrenderer support.

Message-Id: <20210714085045.797168-1-thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 configure                          | 14 --------------
 contrib/vhost-user-gpu/meson.build |  5 ++---
 meson.build                        | 14 ++++++++------
 3 files changed, 10 insertions(+), 23 deletions(-)

diff --git a/configure b/configure
index 9a79a004d7..d63b173410 100755
--- a/configure
+++ b/configure
@@ -3452,13 +3452,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
@@ -4681,13 +4674,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 4cb52a91d7..92c8f3a86a 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/meson.build b/meson.build
index ecfdce921c..83310980f1 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 virgl.found() or 'CONFIG_OPENGL' in config_host
+  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'))
@@ -3086,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'
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PULL 10/13] scripts: Remove the "show-fixed-bugs.sh" file
  2021-09-02 12:48 [PULL 00/13] Testing, build system and misc patches Thomas Huth
                   ` (8 preceding siblings ...)
  2021-09-02 12:49 ` [PULL 09/13] configure / meson: Move the GBM handling to meson.build Thomas Huth
@ 2021-09-02 12:49 ` Thomas Huth
  2021-09-02 12:49 ` [PULL 11/13] softmmu/vl: Add a "grab-mod" parameter to the -display sdl option Thomas Huth
                   ` (3 subsequent siblings)
  13 siblings, 0 replies; 21+ messages in thread
From: Thomas Huth @ 2021-09-02 12:49 UTC (permalink / raw)
  To: qemu-devel, Peter Maydell

Since we are not using Launchpad anymore, there is no more need for
this script.

Message-Id: <20210825142143.142037-1-thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 scripts/show-fixed-bugs.sh | 91 --------------------------------------
 1 file changed, 91 deletions(-)
 delete mode 100755 scripts/show-fixed-bugs.sh

diff --git a/scripts/show-fixed-bugs.sh b/scripts/show-fixed-bugs.sh
deleted file mode 100755
index a095a4d6ba..0000000000
--- 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
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PULL 11/13] softmmu/vl: Add a "grab-mod" parameter to the -display sdl option
  2021-09-02 12:48 [PULL 00/13] Testing, build system and misc patches Thomas Huth
                   ` (9 preceding siblings ...)
  2021-09-02 12:49 ` [PULL 10/13] scripts: Remove the "show-fixed-bugs.sh" file Thomas Huth
@ 2021-09-02 12:49 ` Thomas Huth
  2021-09-02 12:49 ` [PULL 12/13] softmmu/vl: Deprecate the old grab options Thomas Huth
                   ` (2 subsequent siblings)
  13 siblings, 0 replies; 21+ messages in thread
From: Thomas Huth @ 2021-09-02 12:49 UTC (permalink / raw)
  To: qemu-devel, Peter Maydell

The -display sdl option is not using QAPI internally yet, and uses hand-
crafted parsing instead (see parse_display() in vl.c), which is quite
ugly, since most of the other code is using the QAPIfied DisplayOption
already. Unfortunately, the "alt_grab" and "ctrl_grab" use underscores in
their names which has recently been forbidden in new QAPI code, so
a straight conversion is not possible. While we could add some exceptions
to the QAPI schema parser for this, the way these parameters have been
designed was maybe a bad idea anyway: First, it's not possible to enable
both parameters at the same time, thus instead of two boolean parameters
it would be better to have only one multi-choice parameter instead.
Second, the naming is also somewhat unfortunate since the "alt_grab"
parameter is not about the ALT key, but rather about the left SHIFT key
that has to be used additionally when the parameter is enabled.

So instead of trying to QAPIfy "alt_grab" and "ctrl_grab", let's rather
introduce an alternative to these parameters instead, a new parameter
called "grab-mod" which can either be set to "lshift-lctrl-lalt" or to
"rctrl". In case we ever want to support additional modes later, we can
then also simply extend the list of supported strings here.

Message-Id: <20210825092023.81396-2-thuth@redhat.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 qemu-options.hx |  6 +++++-
 softmmu/vl.c    | 15 ++++++++++++---
 2 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/qemu-options.hx b/qemu-options.hx
index 83aa59a920..0bff756ded 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,6 +1880,10 @@ SRST
         window; see the SDL documentation for other possibilities).
         Valid parameters are:
 
+        ``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
 
         ``ctrl_grab=on|off`` : Use Right-Control-g to toggle mouse grabbing
diff --git a/softmmu/vl.c b/softmmu/vl.c
index ea05bb39c5..2176e3c5ae 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;
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PULL 12/13] softmmu/vl: Deprecate the old grab options
  2021-09-02 12:48 [PULL 00/13] Testing, build system and misc patches Thomas Huth
                   ` (10 preceding siblings ...)
  2021-09-02 12:49 ` [PULL 11/13] softmmu/vl: Add a "grab-mod" parameter to the -display sdl option Thomas Huth
@ 2021-09-02 12:49 ` Thomas Huth
  2021-09-02 12:49 ` [PULL 13/13] softmmu/vl: Deprecate the -sdl and -curses option Thomas Huth
  2021-09-03 13:22 ` [PULL 00/13] Testing, build system and misc patches Peter Maydell
  13 siblings, 0 replies; 21+ messages in thread
From: Thomas Huth @ 2021-09-02 12:49 UTC (permalink / raw)
  To: qemu-devel, Peter Maydell

The alt_grab and ctrl_grab parameter of the -display sdl option prevent
the QAPIfication of the "sdl" part of the -display option, so we should
eventually remove them. And since this feature is also rather niche anyway,
we should not clutter the top-level option list with these, so let's
also deprecate the "-alt-grab" and the "-ctrl-grab" options while we're
at it.

Once the deprecation period of "alt_grab" and "ctrl_grab" is over, we
then can finally switch the -display sdl option to use QAPI internally,
too.

Message-Id: <20210825092023.81396-3-thuth@redhat.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 docs/about/deprecated.rst | 10 ++++++++++
 qemu-options.hx           | 12 ++++++++----
 softmmu/vl.c              |  6 ++++++
 3 files changed, 24 insertions(+), 4 deletions(-)

diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst
index 1e1a5e96ad..65d8b4370f 100644
--- a/docs/about/deprecated.rst
+++ b/docs/about/deprecated.rst
@@ -138,6 +138,16 @@ 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.
+
 
 QEMU Machine Protocol (QMP) commands
 ------------------------------------
diff --git a/qemu-options.hx b/qemu-options.hx
index 0bff756ded..4f46233527 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -1884,9 +1884,11 @@ SRST
         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
+        ``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
 
@@ -1971,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,
@@ -1981,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/softmmu/vl.c b/softmmu/vl.c
index 2176e3c5ae..e9346b49d2 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -1043,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)) {
@@ -1052,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)) {
@@ -3245,9 +3247,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;
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PULL 13/13] softmmu/vl: Deprecate the -sdl and -curses option
  2021-09-02 12:48 [PULL 00/13] Testing, build system and misc patches Thomas Huth
                   ` (11 preceding siblings ...)
  2021-09-02 12:49 ` [PULL 12/13] softmmu/vl: Deprecate the old grab options Thomas Huth
@ 2021-09-02 12:49 ` Thomas Huth
  2021-09-03 13:22 ` [PULL 00/13] Testing, build system and misc patches Peter Maydell
  13 siblings, 0 replies; 21+ messages in thread
From: Thomas Huth @ 2021-09-02 12:49 UTC (permalink / raw)
  To: qemu-devel, Peter Maydell

It's not that much complicated to type "-display sdl" or "-display curses",
so we should not clutter our main option name space with such simple
wrapper options and rather present the users with a concise interface
instead. Thus let's deprecate the "-sdl" and "-curses" wrapper options now.

Message-Id: <20210825092023.81396-4-thuth@redhat.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 docs/about/deprecated.rst | 10 ++++++++++
 softmmu/vl.c              |  3 +++
 2 files changed, 13 insertions(+)

diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst
index 65d8b4370f..6145573be1 100644
--- a/docs/about/deprecated.rst
+++ b/docs/about/deprecated.rst
@@ -148,6 +148,16 @@ Use ``-display sdl,grab-mod=lshift-lctrl-lalt`` instead.
 
 Use ``-display sdl,grab-mod=rctrl`` instead.
 
+``-sdl`` (since 6.2)
+''''''''''''''''''''
+
+Use ``-display sdl`` instead.
+
+``-curses`` (since 6.2)
+'''''''''''''''''''''''
+
+Use ``-display curses`` instead.
+
 
 QEMU Machine Protocol (QMP) commands
 ------------------------------------
diff --git a/softmmu/vl.c b/softmmu/vl.c
index e9346b49d2..55ab70eb97 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -2889,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
@@ -3262,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;
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 21+ messages in thread

* Re: [PULL 00/13] Testing, build system and misc patches
  2021-09-02 12:48 [PULL 00/13] Testing, build system and misc patches Thomas Huth
                   ` (12 preceding siblings ...)
  2021-09-02 12:49 ` [PULL 13/13] softmmu/vl: Deprecate the -sdl and -curses option Thomas Huth
@ 2021-09-03 13:22 ` Peter Maydell
  2021-09-03 14:19   ` Thomas Huth
  13 siblings, 1 reply; 21+ messages in thread
From: Peter Maydell @ 2021-09-03 13:22 UTC (permalink / raw)
  To: Thomas Huth; +Cc: QEMU Developers

On Thu, 2 Sept 2021 at 13:49, Thomas Huth <thuth@redhat.com> wrote:
>
>  Hi Peter,
>
> the following changes since commit 59a89510b62ec23dbeab8b02fa4e3526e353d8b6:
>
>   Merge remote-tracking branch 'remotes/stefanberger/tags/pull-tpm-2021-09-01-1' into staging (2021-09-02 08:51:31 +0100)
>
> are available in the Git repository at:
>
>   https://gitlab.com/thuth/qemu.git tags/pull-request-2021-09-02
>
> for you to fetch changes up to c72dc94b74fb1686decc0ca4c2b05e5bf2e5b74b:
>
>   softmmu/vl: Deprecate the -sdl and -curses option (2021-09-02 14:43:58 +0200)
>
> ----------------------------------------------------------------
> * 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
>

This provokes a new warning from meson on a linux-static build:

Run-time dependency appleframeworks found: NO (tried framework)
Library rt found: YES
Found pkg-config: /usr/bin/pkg-config (0.29.1)
WARNING: Static library 'gbm' not found for dependency 'gbm', may not
be statically linked
Run-time dependency gbm found: YES 20.0.8
Dependency libpng found: YES 1.6.34 (cached)
Dependency libjpeg found: YES unknown (cached)

If we're building statically and we can't find a static
library then (a) we shouldn't print a WARNING and
(b) we shouldn't then conclude that we've found gdm.

thanks
-- PMM


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PULL 00/13] Testing, build system and misc patches
  2021-09-03 13:22 ` [PULL 00/13] Testing, build system and misc patches Peter Maydell
@ 2021-09-03 14:19   ` Thomas Huth
  2021-09-03 16:35     ` Alex Bennée
  0 siblings, 1 reply; 21+ messages in thread
From: Thomas Huth @ 2021-09-03 14:19 UTC (permalink / raw)
  To: Peter Maydell, Paolo Bonzini; +Cc: QEMU Developers

On 03/09/2021 15.22, Peter Maydell wrote:
> On Thu, 2 Sept 2021 at 13:49, Thomas Huth <thuth@redhat.com> wrote:
>>
>>   Hi Peter,
>>
>> the following changes since commit 59a89510b62ec23dbeab8b02fa4e3526e353d8b6:
>>
>>    Merge remote-tracking branch 'remotes/stefanberger/tags/pull-tpm-2021-09-01-1' into staging (2021-09-02 08:51:31 +0100)
>>
>> are available in the Git repository at:
>>
>>    https://gitlab.com/thuth/qemu.git tags/pull-request-2021-09-02
>>
>> for you to fetch changes up to c72dc94b74fb1686decc0ca4c2b05e5bf2e5b74b:
>>
>>    softmmu/vl: Deprecate the -sdl and -curses option (2021-09-02 14:43:58 +0200)
>>
>> ----------------------------------------------------------------
>> * 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
>>
> 
> This provokes a new warning from meson on a linux-static build:
> 
> Run-time dependency appleframeworks found: NO (tried framework)
> Library rt found: YES
> Found pkg-config: /usr/bin/pkg-config (0.29.1)
> WARNING: Static library 'gbm' not found for dependency 'gbm', may not
> be statically linked
> Run-time dependency gbm found: YES 20.0.8
> Dependency libpng found: YES 1.6.34 (cached)
> Dependency libjpeg found: YES unknown (cached)
> 
> If we're building statically and we can't find a static
> library then (a) we shouldn't print a WARNING and
> (b) we shouldn't then conclude that we've found gdm.

Hmmm, no clue what's wrong here, since I basically did declare it like all 
other libraries are declared, too (so this problem should have shown up 
somewhere else already?)... Paolo, do you have any ideas what's going on here?

  Thomas



^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PULL 00/13] Testing, build system and misc patches
  2021-09-03 14:19   ` Thomas Huth
@ 2021-09-03 16:35     ` Alex Bennée
  2021-09-03 16:49       ` Peter Maydell
  0 siblings, 1 reply; 21+ messages in thread
From: Alex Bennée @ 2021-09-03 16:35 UTC (permalink / raw)
  To: Thomas Huth; +Cc: Peter Maydell, qemu-devel, Paolo Bonzini


Thomas Huth <thuth@redhat.com> writes:

> On 03/09/2021 15.22, Peter Maydell wrote:
>> On Thu, 2 Sept 2021 at 13:49, Thomas Huth <thuth@redhat.com> wrote:
>>>
>>>   Hi Peter,
>>>
>>> the following changes since commit 59a89510b62ec23dbeab8b02fa4e3526e353d8b6:
>>>
>>>    Merge remote-tracking branch 'remotes/stefanberger/tags/pull-tpm-2021-09-01-1' into staging (2021-09-02 08:51:31 +0100)
>>>
>>> are available in the Git repository at:
>>>
>>>    https://gitlab.com/thuth/qemu.git tags/pull-request-2021-09-02
>>>
>>> for you to fetch changes up to c72dc94b74fb1686decc0ca4c2b05e5bf2e5b74b:
>>>
>>>    softmmu/vl: Deprecate the -sdl and -curses option (2021-09-02 14:43:58 +0200)
>>>
>>> ----------------------------------------------------------------
>>> * 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
>>>
>> This provokes a new warning from meson on a linux-static build:
>> Run-time dependency appleframeworks found: NO (tried framework)
>> Library rt found: YES
>> Found pkg-config: /usr/bin/pkg-config (0.29.1)
>> WARNING: Static library 'gbm' not found for dependency 'gbm', may not
>> be statically linked
>> Run-time dependency gbm found: YES 20.0.8
>> Dependency libpng found: YES 1.6.34 (cached)
>> Dependency libjpeg found: YES unknown (cached)
>> If we're building statically and we can't find a static
>> library then (a) we shouldn't print a WARNING and
>> (b) we shouldn't then conclude that we've found gdm.
>
> Hmmm, no clue what's wrong here, since I basically did declare it like
> all other libraries are declared, too (so this problem should have
> shown up somewhere else already?)... Paolo, do you have any ideas
> what's going on here?

In attempting to replicate I found all the dynamic libs blow up:

  Run-time dependency pixman-1 found: YES 0.40.0
  Library aio found: Y
  Run-time dependency zlib found: YES 1.2.1
  Run-time dependency liburing found: NO (tried p
  Run-time dependency libxml-2.0 found: YES 2.9.1
  Run-time dependency libnfs found: YES 4.0.0
  Run-time dependency appleframeworks found: NO (tried f
  Run-time dependency libseccomp found: YES 2.5.1
  Has header "cap-ng.h" : Y
  Library cap-ng found: Y
  WARNING: Static library 'xkbcommon' not found for dependency 'xkbcommon', may not be statically l
  Run-time dependency xkbcommon found: YES 1.0.3
  Library rt found: Y
  Run-time dependency libiscsi found: YES 1.19.0
  Run-time dependency libzstd found: YES 1.4.8
  WARNING: Static library 'virglrenderer' not found for dependency 'virglrenderer', may not be statically l
  Run-time dependency virglrenderer found: YES 0.8.2
  WARNING: Static library 'nghttp2' not found for dependency 'libcurl', may not be statically l
  WARNING: Static library 'rtmp' not found for dependency 'libcurl', may not be statically l
  WARNING: Static library 'psl' not found for dependency 'libcurl', may not be statically l
  WARNING: Static library 'gssapi_krb5' not found for dependency 'libcurl', may not be statically l
  WARNING: Static library 'krb5' not found for dependency 'libcurl', may not be statically l
  WARNING: Static library 'k5crypto' not found for dependency 'libcurl', may not be statically l
  WARNING: Static library 'lber' not found for dependency 'libcurl', may not be statically l
  WARNING: Static library 'ldap' not found for dependency 'libcurl', may not be statically l
  Run-time dependency libcurl found: YES 7.74.0
  WARNING: Static library 'udev' not found for dependency 'libudev', may not be statically l
  Run-time dependency libudev found: YES 2
  Library mpathpersist found: N
  Run-time dependency ncursesw found: YES 6.2.2
  Has header "brlapi.h" : Y
  Library brlapi found: Y
  ../../meson.build:680: WARNING: could not link brlapi, d
  sdl2-config found: N
  Run-time dependency sdl2 found: NO (tried pkgconfig and config-t
  Library rados found: N
  Has header "rbd/librbd.h" : Y
  Library rbd found: N
  WARNING: Static library 'gfapi' not found for dependency 'glusterfs-api', may not be statically l
  WARNING: Static library 'glusterfs' not found for dependency 'glusterfs-api', may not be statically l
  WARNING: Static library 'gfrpc' not found for dependency 'glusterfs-api', may not be statically l
  WARNING: Static library 'gfxdr' not found for dependency 'glusterfs-api', may not be statically l
  Run-time dependency glusterfs-api found: YES 7.9.2
  Has header "bzlib.h" : Y
  Library bz2 found: YES
  Has header "lzfse.h" : NO                                                              

So is this a general problem with static libs. BTW I didn't catch this
because I only build user with --static as I thought system --static was
flakey anyway.

>
>  Thomas


-- 
Alex Bennée


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PULL 00/13] Testing, build system and misc patches
  2021-09-03 16:35     ` Alex Bennée
@ 2021-09-03 16:49       ` Peter Maydell
  2021-09-06  9:51         ` Thomas Huth
  0 siblings, 1 reply; 21+ messages in thread
From: Peter Maydell @ 2021-09-03 16:49 UTC (permalink / raw)
  To: Alex Bennée; +Cc: Paolo Bonzini, Thomas Huth, QEMU Developers

On Fri, 3 Sept 2021 at 17:37, Alex Bennée <alex.bennee@linaro.org> wrote:
> Thomas Huth <thuth@redhat.com> writes:
> > On 03/09/2021 15.22, Peter Maydell wrote:
> >> This provokes a new warning from meson on a linux-static build:
> >> Run-time dependency appleframeworks found: NO (tried framework)
> >> Library rt found: YES
> >> Found pkg-config: /usr/bin/pkg-config (0.29.1)
> >> WARNING: Static library 'gbm' not found for dependency 'gbm', may not
> >> be statically linked
> >> Run-time dependency gbm found: YES 20.0.8
> >> Dependency libpng found: YES 1.6.34 (cached)
> >> Dependency libjpeg found: YES unknown (cached)
> >> If we're building statically and we can't find a static
> >> library then (a) we shouldn't print a WARNING and
> >> (b) we shouldn't then conclude that we've found gdm.
> >
> > Hmmm, no clue what's wrong here, since I basically did declare it like
> > all other libraries are declared, too (so this problem should have
> > shown up somewhere else already?)... Paolo, do you have any ideas
> > what's going on here?
>
> In attempting to replicate I found all the dynamic libs blow up:

>   WARNING: Static library 'xkbcommon' not found for dependency 'xkbcommon', may not be statically l
>   Run-time dependency xkbcommon found: YES 1.0.3

I do vaguely recall complaining about new meson warnings for
static library detection in the past as well:
https://lore.kernel.org/qemu-devel/CAFEAcA8chPqS0keyGv0vBgNgacnMo95gA3LZDU2QfmteQ=4UZg@mail.gmail.com/
https://lore.kernel.org/qemu-devel/CAFEAcA_-cNmt-sY3nqnGkpUqET86M6-82rf-Uv3QkwCR14kYsw@mail.gmail.com/
https://lore.kernel.org/qemu-devel/CAFEAcA8xHxCGhh2hibsdCxZrYRRU+xcwVsa85O7KL9BsmW7ohw@mail.gmail.com/

> So is this a general problem with static libs. BTW I didn't catch this
> because I only build user with --static as I thought system --static was
> flakey anyway.

I'm not doing a system build in this case... Looking at some of
those older threads, it looks like part of the answer is that
for dependencies that we don't need for linux-user mode we should
guard the test with some suitable if condition so we don't create
the dependency unless we're going to use it, eg the brlapi check
uses "if not get_option('brlapi').auto() or have_system", rbd
has a similar thing involving have_block, etc.

But I think there is an underlying meson bug here which that kind of
use of an if is merely working around: if we ask for a static library
it should not give us a dynamic library.

-- PMM


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PULL 00/13] Testing, build system and misc patches
  2021-09-03 16:49       ` Peter Maydell
@ 2021-09-06  9:51         ` Thomas Huth
  2021-09-06 15:08           ` Paolo Bonzini
  0 siblings, 1 reply; 21+ messages in thread
From: Thomas Huth @ 2021-09-06  9:51 UTC (permalink / raw)
  To: Peter Maydell, Paolo Bonzini, QEMU Developers; +Cc: Alex Bennée

On 03/09/2021 18.49, Peter Maydell wrote:
> On Fri, 3 Sept 2021 at 17:37, Alex Bennée <alex.bennee@linaro.org> wrote:
>> Thomas Huth <thuth@redhat.com> writes:
>>> On 03/09/2021 15.22, Peter Maydell wrote:
>>>> This provokes a new warning from meson on a linux-static build:
>>>> Run-time dependency appleframeworks found: NO (tried framework)
>>>> Library rt found: YES
>>>> Found pkg-config: /usr/bin/pkg-config (0.29.1)
>>>> WARNING: Static library 'gbm' not found for dependency 'gbm', may not
>>>> be statically linked
>>>> Run-time dependency gbm found: YES 20.0.8
>>>> Dependency libpng found: YES 1.6.34 (cached)
>>>> Dependency libjpeg found: YES unknown (cached)
>>>> If we're building statically and we can't find a static
>>>> library then (a) we shouldn't print a WARNING and
>>>> (b) we shouldn't then conclude that we've found gdm.
>>>
>>> Hmmm, no clue what's wrong here, since I basically did declare it like
>>> all other libraries are declared, too (so this problem should have
>>> shown up somewhere else already?)... Paolo, do you have any ideas
>>> what's going on here?
>>
>> In attempting to replicate I found all the dynamic libs blow up:
> 
>>    WARNING: Static library 'xkbcommon' not found for dependency 'xkbcommon', may not be statically l
>>    Run-time dependency xkbcommon found: YES 1.0.3
> 
> I do vaguely recall complaining about new meson warnings for
> static library detection in the past as well:
> https://lore.kernel.org/qemu-devel/CAFEAcA8chPqS0keyGv0vBgNgacnMo95gA3LZDU2QfmteQ=4UZg@mail.gmail.com/
> https://lore.kernel.org/qemu-devel/CAFEAcA_-cNmt-sY3nqnGkpUqET86M6-82rf-Uv3QkwCR14kYsw@mail.gmail.com/
> https://lore.kernel.org/qemu-devel/CAFEAcA8xHxCGhh2hibsdCxZrYRRU+xcwVsa85O7KL9BsmW7ohw@mail.gmail.com/
> 
>> So is this a general problem with static libs. BTW I didn't catch this
>> because I only build user with --static as I thought system --static was
>> flakey anyway.
> 
> I'm not doing a system build in this case... Looking at some of
> those older threads, it looks like part of the answer is that
> for dependencies that we don't need for linux-user mode we should
> guard the test with some suitable if condition so we don't create
> the dependency unless we're going to use it, eg the brlapi check
> uses "if not get_option('brlapi').auto() or have_system", rbd
> has a similar thing involving have_block, etc.

Ok, thanks, that seems to work, I'll change the patch accordingly.

> But I think there is an underlying meson bug here which that kind of
> use of an if is merely working around: if we ask for a static library
> it should not give us a dynamic library.

Agreed. Actually, when I run configure with "--static --disable-system" on 
my laptop, I'm also getting some warnings:

WARNING: Static library 'z' not found for dependency 'zlib', may not be 
statically linked
Run-time dependency zlib found: YES 1.2.11
Run-time dependency appleframeworks found: NO (tried framework)
Library rt found: YES
WARNING: Static library 'png16' not found for dependency 'libpng', may not 
be statically linked
WARNING: Static library 'z' not found for dependency 'libpng', may not be 
statically linked

... and linking then later fails while running "make".

Paolo, could the behavior of meson be changed to fail already the 
configuration step in this case instead of only printing a warning?

  Thomas



^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PULL 00/13] Testing, build system and misc patches
  2021-09-06  9:51         ` Thomas Huth
@ 2021-09-06 15:08           ` Paolo Bonzini
  2021-09-06 15:14             ` Peter Maydell
  0 siblings, 1 reply; 21+ messages in thread
From: Paolo Bonzini @ 2021-09-06 15:08 UTC (permalink / raw)
  To: Thomas Huth, Peter Maydell, QEMU Developers; +Cc: Alex Bennée

On 06/09/21 11:51, Thomas Huth wrote:
> On 03/09/2021 18.49, Peter Maydell wrote:
>> On Fri, 3 Sept 2021 at 17:37, Alex Bennée <alex.bennee@linaro.org> wrote:
>>> Thomas Huth <thuth@redhat.com> writes:
>>>> On 03/09/2021 15.22, Peter Maydell wrote:
>>>>> This provokes a new warning from meson on a linux-static build:
>>>>> Run-time dependency appleframeworks found: NO (tried framework)
>>>>> Library rt found: YES
>>>>> Found pkg-config: /usr/bin/pkg-config (0.29.1)
>>>>> WARNING: Static library 'gbm' not found for dependency 'gbm', may not
>>>>> be statically linked
>>>>> Run-time dependency gbm found: YES 20.0.8
>>>>> Dependency libpng found: YES 1.6.34 (cached)
>>>>> Dependency libjpeg found: YES unknown (cached)
>>>>> If we're building statically and we can't find a static
>>>>> library then (a) we shouldn't print a WARNING and
>>>>> (b) we shouldn't then conclude that we've found gdm.
>>>>
>>>> Hmmm, no clue what's wrong here, since I basically did declare it like
>>>> all other libraries are declared, too (so this problem should have
>>>> shown up somewhere else already?)... Paolo, do you have any ideas
>>>> what's going on here?
>>>
>>> In attempting to replicate I found all the dynamic libs blow up:
>>
>>>    WARNING: Static library 'xkbcommon' not found for dependency 
>>> 'xkbcommon', may not be statically l
>>>    Run-time dependency xkbcommon found: YES 1.0.3
>>
>> I do vaguely recall complaining about new meson warnings for
>> static library detection in the past as well:
>> https://lore.kernel.org/qemu-devel/CAFEAcA8chPqS0keyGv0vBgNgacnMo95gA3LZDU2QfmteQ=4UZg@mail.gmail.com/ 
>>
>> https://lore.kernel.org/qemu-devel/CAFEAcA_-cNmt-sY3nqnGkpUqET86M6-82rf-Uv3QkwCR14kYsw@mail.gmail.com/ 
>>
>> https://lore.kernel.org/qemu-devel/CAFEAcA8xHxCGhh2hibsdCxZrYRRU+xcwVsa85O7KL9BsmW7ohw@mail.gmail.com/ 
>>
>>
>>> So is this a general problem with static libs. BTW I didn't catch this
>>> because I only build user with --static as I thought system --static was
>>> flakey anyway.
>>
>> I'm not doing a system build in this case... Looking at some of
>> those older threads, it looks like part of the answer is that
>> for dependencies that we don't need for linux-user mode we should
>> guard the test with some suitable if condition so we don't create
>> the dependency unless we're going to use it, eg the brlapi check
>> uses "if not get_option('brlapi').auto() or have_system", rbd
>> has a similar thing involving have_block, etc.
> 
> Ok, thanks, that seems to work, I'll change the patch accordingly.
> 
>> But I think there is an underlying meson bug here which that kind of
>> use of an if is merely working around: if we ask for a static library
>> it should not give us a dynamic library.
> 
> Agreed. Actually, when I run configure with "--static --disable-system" 
> on my laptop, I'm also getting some warnings:
> 
> WARNING: Static library 'z' not found for dependency 'zlib', may not be 
> statically linked
> Run-time dependency zlib found: YES 1.2.11
> Run-time dependency appleframeworks found: NO (tried framework)
> Library rt found: YES
> WARNING: Static library 'png16' not found for dependency 'libpng', may 
> not be statically linked
> WARNING: Static library 'z' not found for dependency 'libpng', may not 
> be statically linked
> 
> ... and linking then later fails while running "make".
> 
> Paolo, could the behavior of meson be changed to fail already the 
> configuration step in this case instead of only printing a warning?

The reason why this is just a warning is explained only in the code, and
it's this:

     # Library wasn't found, maybe we're looking in the wrong
     # places or the library will be provided with LDFLAGS or
     # LIBRARY_PATH from the environment (on macOS), and many
     # other edge cases that we can't account for.
     #
     # Add all -L paths and use it as -lfoo

In other words, Meson doesn't really know the library will be used for a
statically-linked binary (as opposed to just not wanting a shared
library for whatever reason).  So it looks for a .a file, and forces use
of the a static library by passing a path to that file.  If it cannot
find one, it warns.

Note that pre-Meson we didn't warn for --disable-system (correct) but we
did the wrong thing silently for --enable-system (just like now, except
without a warning).  So Meson's warning forces us to be a bit more verbose
to do only strictly necesary tests, as in:

   pam = not_found
   if not get_option('auth_pam').auto() or have_system
     pam = cc.find_library('pam', has_headers: ['security/pam_appl.h'],
                           required: get_option('auth_pam'),
                           kwargs: static_kwargs)
   endif

but it also catches incorrect setups on the user side and makes the "configure"
step a little faster with --disable-system.

FWIW, in the latest Meson version there's a shortcut for the above pattern,
since it is very common in QEMU; it can be rewritten as follows to avoid the
if/endif:

   pam = cc.find_library('pam', has_headers: ['security/pam_appl.h'],
                         required: get_option('auth_pam').disable_auto_if(not have_system)
                         kwargs: static_kwargs)

Paolo



^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PULL 00/13] Testing, build system and misc patches
  2021-09-06 15:08           ` Paolo Bonzini
@ 2021-09-06 15:14             ` Peter Maydell
  0 siblings, 0 replies; 21+ messages in thread
From: Peter Maydell @ 2021-09-06 15:14 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: Thomas Huth, Alex Bennée, QEMU Developers

On Mon, 6 Sept 2021 at 16:08, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> On 06/09/21 11:51, Thomas Huth wrote:
> > On 03/09/2021 18.49, Peter Maydell wrote:
> >> But I think there is an underlying meson bug here which that kind of
> >> use of an if is merely working around: if we ask for a static library
> >> it should not give us a dynamic library.
> >
> > Agreed. Actually, when I run configure with "--static --disable-system"
> > on my laptop, I'm also getting some warnings:
> >
> > WARNING: Static library 'z' not found for dependency 'zlib', may not be
> > statically linked
> > Run-time dependency zlib found: YES 1.2.11
> > Run-time dependency appleframeworks found: NO (tried framework)
> > Library rt found: YES
> > WARNING: Static library 'png16' not found for dependency 'libpng', may
> > not be statically linked
> > WARNING: Static library 'z' not found for dependency 'libpng', may not
> > be statically linked
> >
> > ... and linking then later fails while running "make".
> >
> > Paolo, could the behavior of meson be changed to fail already the
> > configuration step in this case instead of only printing a warning?
>
> The reason why this is just a warning is explained only in the code, and
> it's this:
>
>      # Library wasn't found, maybe we're looking in the wrong
>      # places or the library will be provided with LDFLAGS or
>      # LIBRARY_PATH from the environment (on macOS), and many
>      # other edge cases that we can't account for.
>      #
>      # Add all -L paths and use it as -lfoo
>
> In other words, Meson doesn't really know the library will be used for a
> statically-linked binary (as opposed to just not wanting a shared
> library for whatever reason).  So it looks for a .a file, and forces use
> of the a static library by passing a path to that file.  If it cannot
> find one, it warns.

Then Meson needs a feature so we can tell it "yes, we really did mean
that we want a static library, and only a static library will do".

thanks
-- PMM


^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2021-09-06 15:17 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-02 12:48 [PULL 00/13] Testing, build system and misc patches Thomas Huth
2021-09-02 12:48 ` [PULL 01/13] docs: add definitions of terms for CI/testing Thomas Huth
2021-09-02 12:49 ` [PULL 02/13] libqtest: check for g_setenv() failure Thomas Huth
2021-09-02 12:49 ` [PULL 03/13] gitlab-ci: Merge "build-disabled" with "build-without-default-features" Thomas Huth
2021-09-02 12:49 ` [PULL 04/13] gitlab-ci: Remove superfluous "dnf install" statement Thomas Huth
2021-09-02 12:49 ` [PULL 05/13] gitlab-ci: Fix ..._RUNNER_AVAILABLE variables and document them Thomas Huth
2021-09-02 12:49 ` [PULL 06/13] gitlab-ci: Don't try to use the system libfdt in the debian job Thomas Huth
2021-09-02 12:49 ` [PULL 07/13] meson.build: Fix the check for a usable libfdt Thomas Huth
2021-09-02 12:49 ` [PULL 08/13] meson.build: Don't use internal libfdt if the user requested the system libfdt Thomas Huth
2021-09-02 12:49 ` [PULL 09/13] configure / meson: Move the GBM handling to meson.build Thomas Huth
2021-09-02 12:49 ` [PULL 10/13] scripts: Remove the "show-fixed-bugs.sh" file Thomas Huth
2021-09-02 12:49 ` [PULL 11/13] softmmu/vl: Add a "grab-mod" parameter to the -display sdl option Thomas Huth
2021-09-02 12:49 ` [PULL 12/13] softmmu/vl: Deprecate the old grab options Thomas Huth
2021-09-02 12:49 ` [PULL 13/13] softmmu/vl: Deprecate the -sdl and -curses option Thomas Huth
2021-09-03 13:22 ` [PULL 00/13] Testing, build system and misc patches Peter Maydell
2021-09-03 14:19   ` Thomas Huth
2021-09-03 16:35     ` Alex Bennée
2021-09-03 16:49       ` Peter Maydell
2021-09-06  9:51         ` Thomas Huth
2021-09-06 15:08           ` Paolo Bonzini
2021-09-06 15:14             ` Peter Maydell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.