All of lore.kernel.org
 help / color / mirror / Atom feed
* [PULL 00/18] Misc QEMU patches for 2022-04-28
@ 2022-04-28  6:53 Paolo Bonzini
  2022-04-28  6:53 ` [PULL 01/18] error-report: fix g_date_time_format assertion Paolo Bonzini
                   ` (18 more replies)
  0 siblings, 19 replies; 20+ messages in thread
From: Paolo Bonzini @ 2022-04-28  6:53 UTC (permalink / raw)
  To: qemu-devel

The following changes since commit cf6f26d6f9b2015ee12b4604b79359e76784163a:

  Merge tag 'kraxel-20220427-pull-request' of git://git.kraxel.org/qemu into staging (2022-04-27 10:49:28 -0700)

are available in the Git repository at:

  https://gitlab.com/bonzini/qemu.git tags/for-upstream

for you to fetch changes up to 21abf010bb28f0c98db4ee66a990065062c62126:

  qemu-options: Limit the -enable-kvm option to the targets that support it (2022-04-28 08:52:22 +0200)

----------------------------------------------------------------
* Bugfixes
* Meson conversions

----------------------------------------------------------------
Haiyue Wang (1):
      error-report: fix g_date_time_format assertion

Michael Tokarev (1):
      configure: make fortify_source=yes by default

Paolo Bonzini (14):
      remove -writeconfig
      meson: show final set of compiler flags
      configure: remove dead code
      qga: wixl: get path to sysroot from pkg-config as intended
      configure: pc-bios/qemu-icon.bmp does not exist
      configure: gcov should not exclude fortify-source
      configure: move --enable/--disable-debug-info to second option parsing pass
      configure, meson: move OpenGL check to meson
      meson, configure: move RDMA options to meson
      meson, configure: move keyctl test to meson
      meson, configure: move usbfs test to meson
      meson, configure: move libgio test to meson
      meson: remove CONFIG_XEN_PCI_PASSTHROUGH from config-target.h
      meson, configure: move --enable-module-upgrades to meson

Paul Brook (1):
      i386: pcmpestr 64-bit sign extension bug

Thomas Huth (1):
      qemu-options: Limit the -enable-kvm option to the targets that support it

 backends/meson.build            |   2 +-
 configure                       | 348 ++--------------------------------------
 contrib/rdmacm-mux/meson.build  |   4 +-
 crypto/meson.build              |   4 +-
 docs/about/deprecated.rst       |   7 -
 docs/about/removed-features.rst |   7 +
 hw/xen/meson.build              |  20 ++-
 include/qemu/config-file.h      |   1 -
 meson.build                     | 149 ++++++++++++++---
 meson_options.txt               |  12 ++
 migration/meson.build           |   2 +-
 qemu-options.hx                 |  12 +-
 qga/meson.build                 |   2 +-
 scripts/meson-buildoptions.sh   |  19 +++
 softmmu/vl.c                    |  20 ---
 target/i386/ops_sse.h           |  20 ++-
 tests/qtest/meson.build         |   5 +-
 ui/meson.build                  |  24 +--
 util/error-report.c             |   2 +-
 util/meson.build                |   2 +-
 util/qemu-config.c              |  42 -----
 21 files changed, 221 insertions(+), 483 deletions(-)
-- 
2.35.1



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

* [PULL 01/18] error-report: fix g_date_time_format assertion
  2022-04-28  6:53 [PULL 00/18] Misc QEMU patches for 2022-04-28 Paolo Bonzini
@ 2022-04-28  6:53 ` Paolo Bonzini
  2022-04-28  6:53 ` [PULL 02/18] configure: make fortify_source=yes by default Paolo Bonzini
                   ` (17 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: Paolo Bonzini @ 2022-04-28  6:53 UTC (permalink / raw)
  To: qemu-devel; +Cc: Haiyue Wang, Marc-André Lureau, Daniel P . Berrangé

From: Haiyue Wang <haiyue.wang@intel.com>

The 'g_get_real_time' returns the number of microseconds since January
1, 1970 UTC, but 'g_date_time_new_from_unix_utc' needs the number of
seconds, so it will cause the invalid time input:

(process:279642): GLib-CRITICAL (recursed) **: g_date_time_format: assertion 'datetime != NULL' failed

Call function 'g_date_time_new_now_utc' instead, it has the same result
as 'g_date_time_new_from_unix_utc(g_get_real_time() / G_USEC_PER_SEC)';

Fixes: 73dab893b569 ("error-report: replace deprecated g_get_current_time() with glib >= 2.62")
Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20220424105036.291370-1-haiyue.wang@intel.com>
---
 util/error-report.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/util/error-report.c b/util/error-report.c
index dbadaf206d..5edb2e6040 100644
--- a/util/error-report.c
+++ b/util/error-report.c
@@ -173,7 +173,7 @@ static char *
 real_time_iso8601(void)
 {
 #if GLIB_CHECK_VERSION(2,62,0)
-    g_autoptr(GDateTime) dt = g_date_time_new_from_unix_utc(g_get_real_time());
+    g_autoptr(GDateTime) dt = g_date_time_new_now_utc();
     /* ignore deprecation warning, since GLIB_VERSION_MAX_ALLOWED is 2.56 */
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-- 
2.35.1




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

* [PULL 02/18] configure: make fortify_source=yes by default
  2022-04-28  6:53 [PULL 00/18] Misc QEMU patches for 2022-04-28 Paolo Bonzini
  2022-04-28  6:53 ` [PULL 01/18] error-report: fix g_date_time_format assertion Paolo Bonzini
@ 2022-04-28  6:53 ` Paolo Bonzini
  2022-04-28  6:53 ` [PULL 03/18] remove -writeconfig Paolo Bonzini
                   ` (16 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: Paolo Bonzini @ 2022-04-28  6:53 UTC (permalink / raw)
  To: qemu-devel; +Cc: Michael Tokarev

From: Michael Tokarev <mjt@tls.msk.ru>

Commit c87ea1163111917 "configure: add --without-default-feature"
changed fortify_source from "yes" to "$default_feature". But there's
no option to turn it on, we only turn it off for debug build.  I think
this should always be initialized to "yes" in the first place.

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Message-Id: <20220422100825.3692002-1-mjt@msgid.tls.msk.ru>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index e8786d478e..a4942c13e4 100755
--- a/configure
+++ b/configure
@@ -308,7 +308,7 @@ debug_tcg="no"
 debug="no"
 sanitizers="no"
 tsan="no"
-fortify_source="$default_feature"
+fortify_source="yes"
 gcov="no"
 EXESUF=""
 modules="no"
-- 
2.35.1




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

* [PULL 03/18] remove -writeconfig
  2022-04-28  6:53 [PULL 00/18] Misc QEMU patches for 2022-04-28 Paolo Bonzini
  2022-04-28  6:53 ` [PULL 01/18] error-report: fix g_date_time_format assertion Paolo Bonzini
  2022-04-28  6:53 ` [PULL 02/18] configure: make fortify_source=yes by default Paolo Bonzini
@ 2022-04-28  6:53 ` Paolo Bonzini
  2022-04-28  6:53 ` [PULL 04/18] i386: pcmpestr 64-bit sign extension bug Paolo Bonzini
                   ` (15 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: Paolo Bonzini @ 2022-04-28  6:53 UTC (permalink / raw)
  To: qemu-devel

Like -set and -readconfig, it would not really be too hard to
extend -writeconfig to parsing mechanisms other than QemuOpts.
However, the uses of -writeconfig are substantially more
limited, as it is generally easier to write the configuration
by hand in the first place.  In addition, -writeconfig does
not even try to detect cases where it prints incorrect
syntax (for example if values have a quote in them, since
qemu_config_parse does not support any kind of escaping.
Just remove it.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20220414145721.326866-1-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 docs/about/deprecated.rst       |  7 ------
 docs/about/removed-features.rst |  7 ++++++
 include/qemu/config-file.h      |  1 -
 qemu-options.hx                 |  8 ++-----
 softmmu/vl.c                    | 20 ----------------
 util/qemu-config.c              | 42 ---------------------------------
 6 files changed, 9 insertions(+), 76 deletions(-)

diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst
index 257cc15f82..896e5a97ab 100644
--- a/docs/about/deprecated.rst
+++ b/docs/about/deprecated.rst
@@ -67,13 +67,6 @@ and will cause a warning.
 The replacement for the ``nodelay`` short-form boolean option is ``nodelay=on``
 rather than ``delay=off``.
 
-``-writeconfig`` (since 6.0)
-'''''''''''''''''''''''''''''
-
-The ``-writeconfig`` option is not able to serialize the entire contents
-of the QEMU command line.  It is thus considered a failed experiment
-and deprecated, with no current replacement.
-
 Userspace local APIC with KVM (x86, since 6.0)
 ''''''''''''''''''''''''''''''''''''''''''''''
 
diff --git a/docs/about/removed-features.rst b/docs/about/removed-features.rst
index 7c37dc2bda..4a0b270296 100644
--- a/docs/about/removed-features.rst
+++ b/docs/about/removed-features.rst
@@ -348,6 +348,13 @@ or ``gnutls`` library enabled as a cryptography provider.
 Neither the ``nettle`` library, or the built-in cryptography provider are
 supported on FIPS enabled hosts.
 
+``-writeconfig`` (removed in 7.1)
+'''''''''''''''''''''''''''''''''
+
+The ``-writeconfig`` option was not able to serialize the entire contents
+of the QEMU command line.  It is thus considered a failed experiment
+and removed without a replacement.
+
 QEMU Machine Protocol (QMP) commands
 ------------------------------------
 
diff --git a/include/qemu/config-file.h b/include/qemu/config-file.h
index f605423321..321e7c7c03 100644
--- a/include/qemu/config-file.h
+++ b/include/qemu/config-file.h
@@ -12,7 +12,6 @@ void qemu_add_opts(QemuOptsList *list);
 void qemu_add_drive_opts(QemuOptsList *list);
 int qemu_global_option(const char *str);
 
-void qemu_config_write(FILE *fp);
 int qemu_config_parse(FILE *fp, QemuOptsList **lists, const char *fname,
                       Error **errp);
 
diff --git a/qemu-options.hx b/qemu-options.hx
index 1764eebfaf..bc196808ae 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -4622,18 +4622,14 @@ SRST
 ERST
 
 DEF("readconfig", HAS_ARG, QEMU_OPTION_readconfig,
-    "-readconfig <file>\n", QEMU_ARCH_ALL)
+    "-readconfig <file>\n"
+    "                read config file\n", QEMU_ARCH_ALL)
 SRST
 ``-readconfig file``
     Read device configuration from file. This approach is useful when
     you want to spawn QEMU process with many command line options but
     you don't want to exceed the command line character limit.
 ERST
-DEF("writeconfig", HAS_ARG, QEMU_OPTION_writeconfig,
-    "-writeconfig <file>\n"
-    "                read/write config file (deprecated)\n", QEMU_ARCH_ALL)
-SRST
-ERST
 
 DEF("no-user-config", 0, QEMU_OPTION_nouserconfig,
     "-no-user-config\n"
diff --git a/softmmu/vl.c b/softmmu/vl.c
index 06a0e342fe..c2919579fd 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -3551,26 +3551,6 @@ void qemu_init(int argc, char **argv, char **envp)
                 display_remote++;
                 break;
 #endif
-            case QEMU_OPTION_writeconfig:
-                {
-                    FILE *fp;
-                    warn_report("-writeconfig is deprecated and will go away without a replacement");
-                    if (strcmp(optarg, "-") == 0) {
-                        fp = stdout;
-                    } else {
-                        fp = fopen(optarg, "w");
-                        if (fp == NULL) {
-                            error_report("open %s: %s", optarg,
-                                         strerror(errno));
-                            exit(1);
-                        }
-                    }
-                    qemu_config_write(fp);
-                    if (fp != stdout) {
-                        fclose(fp);
-                    }
-                    break;
-                }
             case QEMU_OPTION_qtest:
                 qtest_chrdev = optarg;
                 break;
diff --git a/util/qemu-config.c b/util/qemu-config.c
index 436ab63b16..433488aa56 100644
--- a/util/qemu-config.c
+++ b/util/qemu-config.c
@@ -314,48 +314,6 @@ void qemu_add_opts(QemuOptsList *list)
     abort();
 }
 
-struct ConfigWriteData {
-    QemuOptsList *list;
-    FILE *fp;
-};
-
-static int config_write_opt(void *opaque, const char *name, const char *value,
-                            Error **errp)
-{
-    struct ConfigWriteData *data = opaque;
-
-    fprintf(data->fp, "  %s = \"%s\"\n", name, value);
-    return 0;
-}
-
-static int config_write_opts(void *opaque, QemuOpts *opts, Error **errp)
-{
-    struct ConfigWriteData *data = opaque;
-    const char *id = qemu_opts_id(opts);
-
-    if (id) {
-        fprintf(data->fp, "[%s \"%s\"]\n", data->list->name, id);
-    } else {
-        fprintf(data->fp, "[%s]\n", data->list->name);
-    }
-    qemu_opt_foreach(opts, config_write_opt, data, NULL);
-    fprintf(data->fp, "\n");
-    return 0;
-}
-
-void qemu_config_write(FILE *fp)
-{
-    struct ConfigWriteData data = { .fp = fp };
-    QemuOptsList **lists = vm_config_groups;
-    int i;
-
-    fprintf(fp, "# qemu config file\n\n");
-    for (i = 0; lists[i] != NULL; i++) {
-        data.list = lists[i];
-        qemu_opts_foreach(data.list, config_write_opts, &data, NULL);
-    }
-}
-
 /* Returns number of config groups on success, -errno on error */
 static int qemu_config_foreach(FILE *fp, QEMUConfigCB *cb, void *opaque,
                                const char *fname, Error **errp)
-- 
2.35.1




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

* [PULL 04/18] i386: pcmpestr 64-bit sign extension bug
  2022-04-28  6:53 [PULL 00/18] Misc QEMU patches for 2022-04-28 Paolo Bonzini
                   ` (2 preceding siblings ...)
  2022-04-28  6:53 ` [PULL 03/18] remove -writeconfig Paolo Bonzini
@ 2022-04-28  6:53 ` Paolo Bonzini
  2022-04-28  6:53 ` [PULL 05/18] meson: show final set of compiler flags Paolo Bonzini
                   ` (14 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: Paolo Bonzini @ 2022-04-28  6:53 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paul Brook

From: Paul Brook <paul@nowt.org>

The abs1 function in ops_sse.h only works sorrectly when the result fits
in a signed int. This is fine most of the time because we're only dealing
with byte sized values.

However pcmp_elen helper function uses abs1 to calculate the absolute value
of a cpu register. This incorrectly truncates to 32 bits, and will give
the wrong anser for the most negative value.

Fix by open coding the saturation check before taking the absolute value.

Signed-off-by: Paul Brook <paul@nowt.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 target/i386/ops_sse.h | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/target/i386/ops_sse.h b/target/i386/ops_sse.h
index e4d74b814a..535440f882 100644
--- a/target/i386/ops_sse.h
+++ b/target/i386/ops_sse.h
@@ -2011,25 +2011,23 @@ SSE_HELPER_Q(helper_pcmpgtq, FCMPGTQ)
 
 static inline int pcmp_elen(CPUX86State *env, int reg, uint32_t ctrl)
 {
-    int val;
+    target_long val, limit;
 
     /* Presence of REX.W is indicated by a bit higher than 7 set */
     if (ctrl >> 8) {
-        val = abs1((int64_t)env->regs[reg]);
+        val = (target_long)env->regs[reg];
     } else {
-        val = abs1((int32_t)env->regs[reg]);
+        val = (int32_t)env->regs[reg];
     }
-
     if (ctrl & 1) {
-        if (val > 8) {
-            return 8;
-        }
+        limit = 8;
     } else {
-        if (val > 16) {
-            return 16;
-        }
+        limit = 16;
     }
-    return val;
+    if ((val > limit) || (val < -limit)) {
+        return limit;
+    }
+    return abs1(val);
 }
 
 static inline int pcmp_ilen(Reg *r, uint8_t ctrl)
-- 
2.35.1




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

* [PULL 05/18] meson: show final set of compiler flags
  2022-04-28  6:53 [PULL 00/18] Misc QEMU patches for 2022-04-28 Paolo Bonzini
                   ` (3 preceding siblings ...)
  2022-04-28  6:53 ` [PULL 04/18] i386: pcmpestr 64-bit sign extension bug Paolo Bonzini
@ 2022-04-28  6:53 ` Paolo Bonzini
  2022-04-28  6:53 ` [PULL 06/18] configure: remove dead code Paolo Bonzini
                   ` (13 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: Paolo Bonzini @ 2022-04-28  6:53 UTC (permalink / raw)
  To: qemu-devel; +Cc: Marc-André Lureau

The actual set of compiler flags can grow beyond what is found by the configure
script, for example if gprof is used.  Show the full set in the summary.

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 meson.build | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/meson.build b/meson.build
index 0c38e491f4..9beca38ebb 100644
--- a/meson.build
+++ b/meson.build
@@ -3535,10 +3535,10 @@ link_args = get_option(link_language + '_link_args')
 if link_args.length() > 0
   summary_info += {'LDFLAGS':         ' '.join(link_args)}
 endif
-summary_info += {'QEMU_CFLAGS':       config_host['QEMU_CFLAGS']}
-summary_info += {'QEMU_CXXFLAGS':     config_host['QEMU_CXXFLAGS']}
-summary_info += {'QEMU_OBJCFLAGS':    config_host['QEMU_OBJCFLAGS']}
-summary_info += {'QEMU_LDFLAGS':      config_host['QEMU_LDFLAGS']}
+summary_info += {'QEMU_CFLAGS':       ' '.join(qemu_cflags)}
+summary_info += {'QEMU_CXXFLAGS':     ' '.join(qemu_cxxflags)}
+summary_info += {'QEMU_OBJCFLAGS':    ' '.join(qemu_objcflags)}
+summary_info += {'QEMU_LDFLAGS':      ' '.join(qemu_ldflags)}
 summary_info += {'profiler':          get_option('profiler')}
 summary_info += {'link-time optimization (LTO)': get_option('b_lto')}
 summary_info += {'PIE':               get_option('b_pie')}
-- 
2.35.1




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

* [PULL 06/18] configure: remove dead code
  2022-04-28  6:53 [PULL 00/18] Misc QEMU patches for 2022-04-28 Paolo Bonzini
                   ` (4 preceding siblings ...)
  2022-04-28  6:53 ` [PULL 05/18] meson: show final set of compiler flags Paolo Bonzini
@ 2022-04-28  6:53 ` Paolo Bonzini
  2022-04-28  6:53 ` [PULL 07/18] qga: wixl: get path to sysroot from pkg-config as intended Paolo Bonzini
                   ` (12 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: Paolo Bonzini @ 2022-04-28  6:53 UTC (permalink / raw)
  To: qemu-devel; +Cc: Marc-André Lureau

tcg_interpreter is never written, it is purely a meson option;
trace_backends is never read.

And SeaBIOS is only build from the source tree with roms/Makefile,
so the config.mak file is unused.

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 configure | 24 ------------------------
 1 file changed, 24 deletions(-)

diff --git a/configure b/configure
index a4942c13e4..9e32c96fce 100755
--- a/configure
+++ b/configure
@@ -320,7 +320,6 @@ linux_user=""
 bsd_user=""
 pkgversion=""
 pie=""
-trace_backends="log"
 trace_file="trace"
 opengl="$default_feature"
 coroutine=""
@@ -391,7 +390,6 @@ for opt do
                       cross_cc_vars="$cross_cc_vars cross_cc_cflags_${cc_arch}"
   ;;
   --cross-cc-*) cc_arch=${opt#--cross-cc-}; cc_arch=${cc_arch%%=*}
-                cc_archs="$cc_archs $cc_arch"
                 eval "cross_cc_${cc_arch}=\$optarg"
                 cross_cc_vars="$cross_cc_vars cross_cc_${cc_arch}"
   ;;
@@ -2881,9 +2879,6 @@ fi
 if test "$vhost_user_fs" = "yes" ; then
   echo "CONFIG_VHOST_USER_FS=y" >> $config_host_mak
 fi
-if test "$tcg" = "enabled" -a "$tcg_interpreter" = "true" ; then
-  echo "CONFIG_TCG_INTERPRETER=y" >> $config_host_mak
-fi
 
 if test "$opengl" = "yes" ; then
   echo "CONFIG_OPENGL=y" >> $config_host_mak
@@ -3024,7 +3019,6 @@ LINKS="Makefile"
 LINKS="$LINKS tests/tcg/Makefile.target"
 LINKS="$LINKS pc-bios/optionrom/Makefile"
 LINKS="$LINKS pc-bios/s390-ccw/Makefile"
-LINKS="$LINKS roms/seabios/Makefile"
 LINKS="$LINKS pc-bios/qemu-icon.bmp"
 LINKS="$LINKS .gdbinit scripts" # scripts needed by relative path in .gdbinit
 LINKS="$LINKS tests/avocado tests/data"
@@ -3059,24 +3053,6 @@ done
 export target_list source_path use_containers cpu host_cc
 $source_path/tests/tcg/configure.sh)
 
-# temporary config to build submodules
-if test -f $source_path/roms/seabios/Makefile; then
-  for rom in seabios; do
-    config_mak=roms/$rom/config.mak
-    echo "# Automatically generated by configure - do not modify" > $config_mak
-    echo "SRC_PATH=$source_path/roms/$rom" >> $config_mak
-    echo "AS=$as" >> $config_mak
-    echo "CCAS=$ccas" >> $config_mak
-    echo "CC=$cc" >> $config_mak
-    echo "BCC=bcc" >> $config_mak
-    echo "CPP=$cpp" >> $config_mak
-    echo "OBJCOPY=objcopy" >> $config_mak
-    echo "IASL=$iasl" >> $config_mak
-    echo "LD=$ld" >> $config_mak
-    echo "RANLIB=$ranlib" >> $config_mak
-  done
-fi
-
 config_mak=pc-bios/optionrom/config.mak
 echo "# Automatically generated by configure - do not modify" > $config_mak
 echo "TOPSRC_DIR=$source_path" >> $config_mak
-- 
2.35.1




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

* [PULL 07/18] qga: wixl: get path to sysroot from pkg-config as intended
  2022-04-28  6:53 [PULL 00/18] Misc QEMU patches for 2022-04-28 Paolo Bonzini
                   ` (5 preceding siblings ...)
  2022-04-28  6:53 ` [PULL 06/18] configure: remove dead code Paolo Bonzini
@ 2022-04-28  6:53 ` Paolo Bonzini
  2022-04-28  6:53 ` [PULL 08/18] configure: pc-bios/qemu-icon.bmp does not exist Paolo Bonzini
                   ` (11 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: Paolo Bonzini @ 2022-04-28  6:53 UTC (permalink / raw)
  To: qemu-devel; +Cc: Marc-André Lureau

The .wxs file uses $(var.Mingw_bin) while configure/meson have always
used Mingw_dlls.  Fix them to match what was probably intended.

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 configure       | 4 ++--
 qga/meson.build | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/configure b/configure
index 9e32c96fce..049f669a94 100755
--- a/configure
+++ b/configure
@@ -2702,7 +2702,7 @@ if test "$QEMU_GA_VERSION" = ""; then
     QEMU_GA_VERSION=$(cat $source_path/VERSION)
 fi
 
-QEMU_GA_MSI_MINGW_DLL_PATH="$($pkg_config --variable=prefix glib-2.0)/bin"
+QEMU_GA_MSI_MINGW_BIN_PATH="$($pkg_config --variable=prefix glib-2.0)/bin"
 
 # Mac OS X ships with a broken assembler
 roms=
@@ -2790,7 +2790,7 @@ if test "$debug_tcg" = "yes" ; then
 fi
 if test "$mingw32" = "yes" ; then
   echo "CONFIG_WIN32=y" >> $config_host_mak
-  echo "QEMU_GA_MSI_MINGW_DLL_PATH=${QEMU_GA_MSI_MINGW_DLL_PATH}" >> $config_host_mak
+  echo "QEMU_GA_MSI_MINGW_BIN_PATH=${QEMU_GA_MSI_MINGW_BIN_PATH}" >> $config_host_mak
   echo "QEMU_GA_MANUFACTURER=${QEMU_GA_MANUFACTURER}" >> $config_host_mak
   echo "QEMU_GA_DISTRO=${QEMU_GA_DISTRO}" >> $config_host_mak
   echo "QEMU_GA_VERSION=${QEMU_GA_VERSION}" >> $config_host_mak
diff --git a/qga/meson.build b/qga/meson.build
index 392d560941..6d9f39bb32 100644
--- a/qga/meson.build
+++ b/qga/meson.build
@@ -129,7 +129,7 @@ if targetos == 'windows'
                               wixl, '-o', '@OUTPUT0@', '@INPUT0@',
                               qemu_ga_msi_arch[cpu],
                               qemu_ga_msi_vss,
-                              '-D', 'Mingw_dlls=' + config_host['QEMU_GA_MSI_MINGW_DLL_PATH'],
+                              '-D', 'Mingw_bin=' + config_host['QEMU_GA_MSI_MINGW_BIN_PATH'],
                             ])
     all_qga += [qga_msi]
     alias_target('msi', qga_msi)
-- 
2.35.1




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

* [PULL 08/18] configure: pc-bios/qemu-icon.bmp does not exist
  2022-04-28  6:53 [PULL 00/18] Misc QEMU patches for 2022-04-28 Paolo Bonzini
                   ` (6 preceding siblings ...)
  2022-04-28  6:53 ` [PULL 07/18] qga: wixl: get path to sysroot from pkg-config as intended Paolo Bonzini
@ 2022-04-28  6:53 ` Paolo Bonzini
  2022-04-28  6:53 ` [PULL 09/18] configure: gcov should not exclude fortify-source Paolo Bonzini
                   ` (10 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: Paolo Bonzini @ 2022-04-28  6:53 UTC (permalink / raw)
  To: qemu-devel; +Cc: Marc-André Lureau, Thomas Huth

The file has been removed in commit a8260d3876 ("ui: install logo icons to
$prefix/share/icons", 2019-01-21), do not try to symlink it in the build tree.

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 configure | 1 -
 1 file changed, 1 deletion(-)

diff --git a/configure b/configure
index 049f669a94..a6ed3498f2 100755
--- a/configure
+++ b/configure
@@ -3019,7 +3019,6 @@ LINKS="Makefile"
 LINKS="$LINKS tests/tcg/Makefile.target"
 LINKS="$LINKS pc-bios/optionrom/Makefile"
 LINKS="$LINKS pc-bios/s390-ccw/Makefile"
-LINKS="$LINKS pc-bios/qemu-icon.bmp"
 LINKS="$LINKS .gdbinit scripts" # scripts needed by relative path in .gdbinit
 LINKS="$LINKS tests/avocado tests/data"
 LINKS="$LINKS tests/qemu-iotests/check"
-- 
2.35.1




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

* [PULL 09/18] configure: gcov should not exclude fortify-source
  2022-04-28  6:53 [PULL 00/18] Misc QEMU patches for 2022-04-28 Paolo Bonzini
                   ` (7 preceding siblings ...)
  2022-04-28  6:53 ` [PULL 08/18] configure: pc-bios/qemu-icon.bmp does not exist Paolo Bonzini
@ 2022-04-28  6:53 ` Paolo Bonzini
  2022-04-28  6:53 ` [PULL 10/18] configure: move --enable/--disable-debug-info to second option parsing pass Paolo Bonzini
                   ` (9 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: Paolo Bonzini @ 2022-04-28  6:53 UTC (permalink / raw)
  To: qemu-devel; +Cc: Marc-André Lureau

There is no reason other than history (dating back to commit 1d728c3946, "tests: add gcov
support", 2013-01-06) for this, remove this unnecessary conditional.

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 configure | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/configure b/configure
index a6ed3498f2..e404b55da5 100755
--- a/configure
+++ b/configure
@@ -2625,9 +2625,7 @@ fi
 
 write_c_skeleton
 
-if test "$gcov" = "yes" ; then
-  :
-elif test "$fortify_source" = "yes" ; then
+if test "$fortify_source" = "yes" ; then
   QEMU_CFLAGS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 $QEMU_CFLAGS"
   debug=no
 fi
-- 
2.35.1




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

* [PULL 10/18] configure: move --enable/--disable-debug-info to second option parsing pass
  2022-04-28  6:53 [PULL 00/18] Misc QEMU patches for 2022-04-28 Paolo Bonzini
                   ` (8 preceding siblings ...)
  2022-04-28  6:53 ` [PULL 09/18] configure: gcov should not exclude fortify-source Paolo Bonzini
@ 2022-04-28  6:53 ` Paolo Bonzini
  2022-04-28  6:53 ` [PULL 11/18] configure, meson: move OpenGL check to meson Paolo Bonzini
                   ` (8 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: Paolo Bonzini @ 2022-04-28  6:53 UTC (permalink / raw)
  To: qemu-devel; +Cc: Marc-André Lureau, Thomas Huth

$debug_info is not needed anywhere except in the final meson invocation,
no need to special case it.

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 configure | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/configure b/configure
index e404b55da5..d704029284 100755
--- a/configure
+++ b/configure
@@ -244,7 +244,6 @@ audio_drv_list="default"
 block_drv_rw_whitelist=""
 block_drv_ro_whitelist=""
 host_cc="cc"
-debug_info="yes"
 lto="false"
 stack_protector=""
 safe_stack=""
@@ -304,6 +303,7 @@ vhost_user_fs="$default_feature"
 vhost_vdpa="$default_feature"
 rdma="$default_feature"
 pvrdma="$default_feature"
+debug_info="yes"
 debug_tcg="no"
 debug="no"
 sanitizers="no"
@@ -379,10 +379,6 @@ for opt do
   ;;
   --extra-ldflags=*) EXTRA_LDFLAGS="$EXTRA_LDFLAGS $optarg"
   ;;
-  --enable-debug-info) debug_info="yes"
-  ;;
-  --disable-debug-info) debug_info="no"
-  ;;
   --cross-cc-*[!a-zA-Z0-9_-]*=*) error_exit "Passed bad --cross-cc-FOO option"
   ;;
   --cross-cc-cflags-*) cc_arch=${opt#--cross-cc-cflags-}; cc_arch=${cc_arch%%=*}
@@ -759,12 +755,12 @@ for opt do
   ;;
   --extra-ldflags=*)
   ;;
-  --enable-debug-info)
-  ;;
-  --disable-debug-info)
-  ;;
   --cross-cc-*)
   ;;
+  --enable-debug-info) debug_info="yes"
+  ;;
+  --disable-debug-info) debug_info="no"
+  ;;
   --enable-modules)
       modules="yes"
   ;;
-- 
2.35.1




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

* [PULL 11/18] configure, meson: move OpenGL check to meson
  2022-04-28  6:53 [PULL 00/18] Misc QEMU patches for 2022-04-28 Paolo Bonzini
                   ` (9 preceding siblings ...)
  2022-04-28  6:53 ` [PULL 10/18] configure: move --enable/--disable-debug-info to second option parsing pass Paolo Bonzini
@ 2022-04-28  6:53 ` Paolo Bonzini
  2022-04-28  6:53 ` [PULL 12/18] meson, configure: move RDMA options " Paolo Bonzini
                   ` (7 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: Paolo Bonzini @ 2022-04-28  6:53 UTC (permalink / raw)
  To: qemu-devel; +Cc: Marc-André Lureau

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 configure                     | 40 -----------------------------------
 meson.build                   | 16 +++++++++-----
 meson_options.txt             |  2 ++
 scripts/meson-buildoptions.sh |  3 +++
 ui/meson.build                | 17 ++++++++-------
 5 files changed, 25 insertions(+), 53 deletions(-)

diff --git a/configure b/configure
index d704029284..1aefbc2f68 100755
--- a/configure
+++ b/configure
@@ -321,7 +321,6 @@ bsd_user=""
 pkgversion=""
 pie=""
 trace_file="trace"
-opengl="$default_feature"
 coroutine=""
 tls_priority="NORMAL"
 plugins="$default_feature"
@@ -960,10 +959,6 @@ for opt do
   ;;
   --enable-vhost-user-fs) vhost_user_fs="yes"
   ;;
-  --disable-opengl) opengl="no"
-  ;;
-  --enable-opengl) opengl="yes"
-  ;;
   --disable-zlib-test)
   ;;
   --disable-virtio-blk-data-plane|--enable-virtio-blk-data-plane)
@@ -1258,7 +1253,6 @@ cat << EOF
   vhost-kernel    vhost kernel backend support
   vhost-user      vhost-user backend support
   vhost-vdpa      vhost-vdpa kernel backend support
-  opengl          opengl support
   gio             libgio support
 
 NOTE: The object files are built at the place where configure is launched
@@ -2278,34 +2272,6 @@ case "$fdt" in
 esac
 
 ##########################################
-# opengl probe (for sdl2, gtk)
-
-if test "$opengl" != "no" ; then
-  epoxy=no
-  if $pkg_config epoxy; then
-    cat > $TMPC << EOF
-#include <epoxy/egl.h>
-int main(void) { return 0; }
-EOF
-    if compile_prog "" "" ; then
-      epoxy=yes
-    fi
-  fi
-
-  if test "$epoxy" = "yes" ; then
-    opengl_cflags="$($pkg_config --cflags epoxy)"
-    opengl_libs="$($pkg_config --libs epoxy)"
-    opengl=yes
-  else
-    if test "$opengl" = "yes" ; then
-      feature_not_found "opengl" "Please install epoxy with EGL"
-    fi
-    opengl_cflags=""
-    opengl_libs=""
-    opengl=no
-  fi
-fi
-
 # check for usbfs
 have_usbfs=no
 if test "$linux_user" = "yes"; then
@@ -2874,12 +2840,6 @@ if test "$vhost_user_fs" = "yes" ; then
   echo "CONFIG_VHOST_USER_FS=y" >> $config_host_mak
 fi
 
-if test "$opengl" = "yes" ; then
-  echo "CONFIG_OPENGL=y" >> $config_host_mak
-  echo "OPENGL_CFLAGS=$opengl_cflags" >> $config_host_mak
-  echo "OPENGL_LIBS=$opengl_libs" >> $config_host_mak
-fi
-
 # XXX: suppress that
 if [ "$bsd" = "yes" ] ; then
   echo "CONFIG_BSD=y" >> $config_host_mak
diff --git a/meson.build b/meson.build
index 9beca38ebb..83b7347c5f 100644
--- a/meson.build
+++ b/meson.build
@@ -1000,9 +1000,14 @@ if not get_option('coreaudio').auto() or (targetos == 'darwin' and have_system)
 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())
+if not get_option('opengl').auto() or have_system or have_vhost_user_gpu
+  epoxy = dependency('epoxy', method: 'pkg-config',
+                      required: get_option('opengl'), kwargs: static_kwargs)
+  if cc.has_header('epoxy/egl.h', dependencies: epoxy)
+    opengl = epoxy
+  elif get_option('opengl').enabled()
+    error('epoxy/egl.h not found')
+  endif
 endif
 gbm = not_found
 if (have_system or have_tools) and (virgl.found() or opengl.found())
@@ -1546,6 +1551,7 @@ config_host_data.set('CONFIG_LINUX_AIO', libaio.found())
 config_host_data.set('CONFIG_LINUX_IO_URING', linux_io_uring.found())
 config_host_data.set('CONFIG_LIBPMEM', libpmem.found())
 config_host_data.set('CONFIG_NUMA', numa.found())
+config_host_data.set('CONFIG_OPENGL', opengl.found())
 config_host_data.set('CONFIG_PROFILER', get_option('profiler'))
 config_host_data.set('CONFIG_RBD', rbd.found())
 config_host_data.set('CONFIG_SDL', sdl.found())
@@ -2093,7 +2099,7 @@ host_kconfig = \
   (have_tpm ? ['CONFIG_TPM=y'] : []) + \
   (spice.found() ? ['CONFIG_SPICE=y'] : []) + \
   (have_ivshmem ? ['CONFIG_IVSHMEM=y'] : []) + \
-  ('CONFIG_OPENGL' in config_host ? ['CONFIG_OPENGL=y'] : []) + \
+  (opengl.found() ? ['CONFIG_OPENGL=y'] : []) + \
   (x11.found() ? ['CONFIG_X11=y'] : []) + \
   ('CONFIG_VHOST_USER' in config_host ? ['CONFIG_VHOST_USER=y'] : []) + \
   ('CONFIG_VHOST_VDPA' in config_host ? ['CONFIG_VHOST_VDPA=y'] : []) + \
@@ -3708,7 +3714,7 @@ summary_info += {'smartcard support': cacard}
 summary_info += {'U2F support':       u2f}
 summary_info += {'libusb':            libusb}
 summary_info += {'usb net redir':     usbredir}
-summary_info += {'OpenGL support':    config_host.has_key('CONFIG_OPENGL')}
+summary_info += {'OpenGL support (epoxy)': opengl}
 summary_info += {'GBM':               gbm}
 summary_info += {'libiscsi support':  libiscsi}
 summary_info += {'libnfs support':    libnfs}
diff --git a/meson_options.txt b/meson_options.txt
index d85734f8e6..dbcf9722bb 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -149,6 +149,8 @@ option('lzo', type : 'feature', value : 'auto',
        description: 'lzo compression support')
 option('rbd', type : 'feature', value : 'auto',
        description: 'Ceph block device driver')
+option('opengl', type : 'feature', value : 'auto',
+       description: 'OpenGL support')
 option('gtk', type : 'feature', value : 'auto',
        description: 'GTK+ user interface')
 option('sdl', type : 'feature', value : 'auto',
diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh
index ef0dcd4a77..203f33ae18 100644
--- a/scripts/meson-buildoptions.sh
+++ b/scripts/meson-buildoptions.sh
@@ -91,6 +91,7 @@ meson_options_help() {
   printf "%s\n" '  nettle          nettle cryptography support'
   printf "%s\n" '  numa            libnuma support'
   printf "%s\n" '  nvmm            NVMM acceleration support'
+  printf "%s\n" '  opengl          OpenGL support'
   printf "%s\n" '  oss             OSS sound support'
   printf "%s\n" '  pa              PulseAudio sound support'
   printf "%s\n" '  parallels       parallels image format support'
@@ -271,6 +272,8 @@ _meson_option_parse() {
     --disable-numa) printf "%s" -Dnuma=disabled ;;
     --enable-nvmm) printf "%s" -Dnvmm=enabled ;;
     --disable-nvmm) printf "%s" -Dnvmm=disabled ;;
+    --enable-opengl) printf "%s" -Dopengl=enabled ;;
+    --disable-opengl) printf "%s" -Dopengl=disabled ;;
     --enable-oss) printf "%s" -Doss=enabled ;;
     --disable-oss) printf "%s" -Doss=disabled ;;
     --enable-pa) printf "%s" -Dpa=enabled ;;
diff --git a/ui/meson.build b/ui/meson.build
index 64286ba150..b21d3d1534 100644
--- a/ui/meson.build
+++ b/ui/meson.build
@@ -1,5 +1,6 @@
 softmmu_ss.add(pixman)
 specific_ss.add(when: ['CONFIG_SOFTMMU'], if_true: pixman)   # for the include path
+specific_ss.add(when: ['CONFIG_SOFTMMU'], if_true: opengl)   # for the include path
 
 softmmu_ss.add(files(
   'clipboard.c',
@@ -43,7 +44,6 @@ vnc_ss.add(zlib, png, jpeg, gnutls)
 vnc_ss.add(when: sasl, if_true: files('vnc-auth-sasl.c'))
 softmmu_ss.add_all(when: vnc, if_true: vnc_ss)
 softmmu_ss.add(when: vnc, if_false: files('vnc-stubs.c'))
-specific_ss.add(when: ['CONFIG_SOFTMMU'], if_true: opengl)
 
 ui_modules = {}
 
@@ -53,17 +53,18 @@ if curses.found()
   ui_modules += {'curses' : curses_ss}
 endif
 
-if config_host.has_key('CONFIG_OPENGL')
+softmmu_ss.add(opengl)
+if opengl.found()
   opengl_ss = ss.source_set()
   opengl_ss.add(gbm)
-  opengl_ss.add(when: [opengl, pixman, 'CONFIG_OPENGL'],
+  opengl_ss.add(when: [opengl, pixman],
                if_true: files('shader.c', 'console-gl.c', 'egl-helpers.c', 'egl-context.c'))
   ui_modules += {'opengl' : opengl_ss}
 endif
 
-if config_host.has_key('CONFIG_OPENGL') and gbm.found()
+if opengl.found() and gbm.found()
   egl_headless_ss = ss.source_set()
-  egl_headless_ss.add(when: [opengl, gbm, pixman, 'CONFIG_OPENGL'],
+  egl_headless_ss.add(when: [opengl, gbm, pixman],
                       if_true: files('egl-headless.c'))
   ui_modules += {'egl-headless' : egl_headless_ss}
 endif
@@ -98,8 +99,8 @@ if gtk.found()
   gtk_ss = ss.source_set()
   gtk_ss.add(gtk, vte, pixman, files('gtk.c', 'gtk-clipboard.c'))
   gtk_ss.add(when: x11, if_true: files('x_keymap.c'))
-  gtk_ss.add(when: [opengl, 'CONFIG_OPENGL'], if_true: files('gtk-gl-area.c'))
-  gtk_ss.add(when: [x11, opengl, 'CONFIG_OPENGL'], if_true: files('gtk-egl.c'))
+  gtk_ss.add(when: opengl, if_true: files('gtk-gl-area.c'))
+  gtk_ss.add(when: [x11, opengl], if_true: files('gtk-egl.c'))
   ui_modules += {'gtk' : gtk_ss}
 endif
 
@@ -112,7 +113,7 @@ if sdl.found()
     'sdl2-input.c',
     'sdl2.c',
   ))
-  sdl_ss.add(when: [opengl, 'CONFIG_OPENGL'], if_true: files('sdl2-gl.c'))
+  sdl_ss.add(when: opengl, if_true: files('sdl2-gl.c'))
   sdl_ss.add(when: x11, if_true: files('x_keymap.c'))
   ui_modules += {'sdl' : sdl_ss}
 endif
-- 
2.35.1




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

* [PULL 12/18] meson, configure: move RDMA options to meson
  2022-04-28  6:53 [PULL 00/18] Misc QEMU patches for 2022-04-28 Paolo Bonzini
                   ` (10 preceding siblings ...)
  2022-04-28  6:53 ` [PULL 11/18] configure, meson: move OpenGL check to meson Paolo Bonzini
@ 2022-04-28  6:53 ` Paolo Bonzini
  2022-04-28  6:53 ` [PULL 13/18] meson, configure: move keyctl test " Paolo Bonzini
                   ` (6 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: Paolo Bonzini @ 2022-04-28  6:53 UTC (permalink / raw)
  To: qemu-devel; +Cc: Marc-André Lureau

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 configure                      | 115 ---------------------------------
 contrib/rdmacm-mux/meson.build |   4 +-
 meson.build                    |  56 ++++++++++++++--
 meson_options.txt              |   4 ++
 migration/meson.build          |   2 +-
 scripts/meson-buildoptions.sh  |   6 ++
 6 files changed, 62 insertions(+), 125 deletions(-)

diff --git a/configure b/configure
index 1aefbc2f68..4deca94235 100755
--- a/configure
+++ b/configure
@@ -301,8 +301,6 @@ vhost_vsock="$default_feature"
 vhost_user="no"
 vhost_user_fs="$default_feature"
 vhost_vdpa="$default_feature"
-rdma="$default_feature"
-pvrdma="$default_feature"
 debug_info="yes"
 debug_tcg="no"
 debug="no"
@@ -972,14 +970,6 @@ for opt do
   ;;
   --tls-priority=*) tls_priority="$optarg"
   ;;
-  --enable-rdma) rdma="yes"
-  ;;
-  --disable-rdma) rdma="no"
-  ;;
-  --enable-pvrdma) pvrdma="yes"
-  ;;
-  --disable-pvrdma) pvrdma="no"
-  ;;
   --disable-vhost-user) vhost_user="no"
   ;;
   --enable-vhost-user) vhost_user="yes"
@@ -1244,8 +1234,6 @@ cat << EOF
   lto             Enable Link-Time Optimization.
   safe-stack      SafeStack Stack Smash Protection. Depends on
                   clang/llvm >= 3.7 and requires coroutine backend ucontext.
-  rdma            Enable RDMA-based migration
-  pvrdma          Enable PVRDMA support
   vhost-net       vhost-net kernel acceleration support
   vhost-vsock     virtio sockets device support
   vhost-scsi      vhost-scsi kernel target support
@@ -2037,100 +2025,6 @@ EOF
   fi
 fi
 
-##########################################
-# RDMA needs OpenFabrics libraries
-if test "$rdma" != "no" ; then
-  cat > $TMPC <<EOF
-#include <rdma/rdma_cma.h>
-int main(void) { return 0; }
-EOF
-  rdma_libs="-lrdmacm -libverbs -libumad"
-  if compile_prog "" "$rdma_libs" ; then
-    rdma="yes"
-  else
-    if test "$rdma" = "yes" ; then
-        error_exit \
-            " OpenFabrics librdmacm/libibverbs/libibumad not present." \
-            " Your options:" \
-            "  (1) Fast: Install infiniband packages (devel) from your distro." \
-            "  (2) Cleanest: Install libraries from www.openfabrics.org" \
-            "  (3) Also: Install softiwarp if you don't have RDMA hardware"
-    fi
-    rdma="no"
-  fi
-fi
-
-##########################################
-# PVRDMA detection
-
-cat > $TMPC <<EOF &&
-#include <sys/mman.h>
-
-int
-main(void)
-{
-    char buf = 0;
-    void *addr = &buf;
-    addr = mremap(addr, 0, 1, MREMAP_MAYMOVE | MREMAP_FIXED);
-
-    return 0;
-}
-EOF
-
-if test "$rdma" = "yes" ; then
-    case "$pvrdma" in
-    "")
-        if compile_prog "" ""; then
-            pvrdma="yes"
-        else
-            pvrdma="no"
-        fi
-        ;;
-    "yes")
-        if ! compile_prog "" ""; then
-            error_exit "PVRDMA is not supported since mremap is not implemented"
-        fi
-        pvrdma="yes"
-        ;;
-    "no")
-        pvrdma="no"
-        ;;
-    esac
-else
-    if test "$pvrdma" = "yes" ; then
-        error_exit "PVRDMA requires rdma suppport"
-    fi
-    pvrdma="no"
-fi
-
-# Let's see if enhanced reg_mr is supported
-if test "$pvrdma" = "yes" ; then
-
-cat > $TMPC <<EOF &&
-#include <infiniband/verbs.h>
-
-int
-main(void)
-{
-    struct ibv_mr *mr;
-    struct ibv_pd *pd = NULL;
-    size_t length = 10;
-    uint64_t iova = 0;
-    int access = 0;
-    void *addr = NULL;
-
-    mr = ibv_reg_mr_iova(pd, addr, length, iova, access);
-
-    ibv_dereg_mr(mr);
-
-    return 0;
-}
-EOF
-    if ! compile_prog "" "-libverbs"; then
-        QEMU_CFLAGS="$QEMU_CFLAGS -DLEGACY_RDMA_REG_MR"
-    fi
-fi
-
 ##########################################
 # glib support probe
 
@@ -2855,15 +2749,6 @@ if test "$have_tsan" = "yes" && test "$have_tsan_iface_fiber" = "yes" ; then
     echo "CONFIG_TSAN=y" >> $config_host_mak
 fi
 
-if test "$rdma" = "yes" ; then
-  echo "CONFIG_RDMA=y" >> $config_host_mak
-  echo "RDMA_LIBS=$rdma_libs" >> $config_host_mak
-fi
-
-if test "$pvrdma" = "yes" ; then
-  echo "CONFIG_PVRDMA=y" >> $config_host_mak
-fi
-
 if test "$plugins" = "yes" ; then
     echo "CONFIG_PLUGIN=y" >> $config_host_mak
 fi
diff --git a/contrib/rdmacm-mux/meson.build b/contrib/rdmacm-mux/meson.build
index 7674f54cc5..36c9c89630 100644
--- a/contrib/rdmacm-mux/meson.build
+++ b/contrib/rdmacm-mux/meson.build
@@ -1,7 +1,5 @@
-if 'CONFIG_PVRDMA' in config_host
-  # if not found, CONFIG_PVRDMA should not be set
+if have_pvrdma
   # FIXME: broken on big endian architectures
-  libumad = cc.find_library('ibumad', required: true)
   executable('rdmacm-mux', files('main.c'), genh,
              dependencies: [glib, libumad],
              build_by_default: false,
diff --git a/meson.build b/meson.build
index 83b7347c5f..9c03436756 100644
--- a/meson.build
+++ b/meson.build
@@ -1219,9 +1219,22 @@ if numa.found() and not cc.links('''
 endif
 
 rdma = not_found
-if 'CONFIG_RDMA' in config_host
-  rdma = declare_dependency(link_args: config_host['RDMA_LIBS'].split())
+if not get_option('rdma').auto() or have_system
+  libumad = cc.find_library('ibumad', required: get_option('rdma'))
+  rdma_libs = [cc.find_library('rdmacm', has_headers: ['rdma/rdma_cma.h'],
+                               required: get_option('rdma'),
+                               kwargs: static_kwargs),
+               cc.find_library('ibverbs', required: get_option('rdma'),
+                               kwargs: static_kwargs),
+               libumad]
+  rdma = declare_dependency(dependencies: rdma_libs)
+  foreach lib: rdma_libs
+    if not lib.found()
+      rdma = not_found
+    endif
+  endforeach
 endif
+
 xen = not_found
 if 'CONFIG_XEN_BACKEND' in config_host
   xen = declare_dependency(compile_args: config_host['XEN_CFLAGS'].split(),
@@ -1554,6 +1567,7 @@ config_host_data.set('CONFIG_NUMA', numa.found())
 config_host_data.set('CONFIG_OPENGL', opengl.found())
 config_host_data.set('CONFIG_PROFILER', get_option('profiler'))
 config_host_data.set('CONFIG_RBD', rbd.found())
+config_host_data.set('CONFIG_RDMA', rdma.found())
 config_host_data.set('CONFIG_SDL', sdl.found())
 config_host_data.set('CONFIG_SDL_IMAGE', sdl_image.found())
 config_host_data.set('CONFIG_SECCOMP', seccomp.found())
@@ -1652,7 +1666,7 @@ config_host_data.set('HAVE_SYSTEM_FUNCTION', cc.has_function('system', prefix: '
 if rdma.found()
   config_host_data.set('HAVE_IBV_ADVISE_MR',
                        cc.has_function('ibv_advise_mr',
-                                       args: config_host['RDMA_LIBS'].split(),
+                                       dependencies: rdma,
                                        prefix: '#include <infiniband/verbs.h>'))
 endif
 
@@ -1972,6 +1986,36 @@ config_host_data.set('CONFIG_AVX512F_OPT', get_option('avx512f') \
     int main(int argc, char *argv[]) { return bar(argv[0]); }
   '''), error_message: 'AVX512F not available').allowed())
 
+have_pvrdma = get_option('pvrdma') \
+  .require(rdma.found(), error_message: 'PVRDMA requires OpenFabrics libraries') \
+  .require(cc.compiles('''
+    int main(void)
+    {
+      char buf = 0;
+      void *addr = &buf;
+      addr = mremap(addr, 0, 1, MREMAP_MAYMOVE | MREMAP_FIXED);
+
+      return 0;
+    }'''), error_message: 'PVRDMA requires mremap').allowed()
+
+if have_pvrdma
+  config_host_data.set('LEGACY_RDMA_REG_MR', not cc.compiles('''
+    #include <infiniband/verbs.h>
+    int main(void)
+    {
+      struct ibv_mr *mr;
+      struct ibv_pd *pd = NULL;
+      size_t length = 10;
+      uint64_t iova = 0;
+      int access = 0;
+      void *addr = NULL;
+
+      mr = ibv_reg_mr_iova(pd, addr, length, iova, access);
+      ibv_dereg_mr(mr);
+      return 0;
+    }'''))
+endif
+
 if get_option('membarrier').disabled()
   have_membarrier = false
 elif targetos == 'windows'
@@ -2106,7 +2150,7 @@ host_kconfig = \
   ('CONFIG_VHOST_KERNEL' in config_host ? ['CONFIG_VHOST_KERNEL=y'] : []) + \
   (have_virtfs ? ['CONFIG_VIRTFS=y'] : []) + \
   ('CONFIG_LINUX' in config_host ? ['CONFIG_LINUX=y'] : []) + \
-  ('CONFIG_PVRDMA' in config_host ? ['CONFIG_PVRDMA=y'] : []) + \
+  (have_pvrdma ? ['CONFIG_PVRDMA=y'] : []) + \
   (multiprocess_allowed ? ['CONFIG_MULTIPROCESS_ALLOWED=y'] : [])
 
 ignored = [ 'TARGET_XML_FILES', 'TARGET_ABI_DIR', 'TARGET_ARCH' ]
@@ -3700,8 +3744,8 @@ summary_info += {'l2tpv3 support':    have_l2tpv3}
 summary_info += {'Linux AIO support': libaio}
 summary_info += {'Linux io_uring support': linux_io_uring}
 summary_info += {'ATTR/XATTR support': libattr}
-summary_info += {'RDMA support':      config_host.has_key('CONFIG_RDMA')}
-summary_info += {'PVRDMA support':    config_host.has_key('CONFIG_PVRDMA')}
+summary_info += {'RDMA support':      rdma}
+summary_info += {'PVRDMA support':    have_pvrdma}
 summary_info += {'fdt support':       fdt_opt == 'disabled' ? false : fdt_opt}
 summary_info += {'libcap-ng support': libcap_ng}
 summary_info += {'bpf support':       libbpf}
diff --git a/meson_options.txt b/meson_options.txt
index dbcf9722bb..3bdf409497 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -151,6 +151,10 @@ option('rbd', type : 'feature', value : 'auto',
        description: 'Ceph block device driver')
 option('opengl', type : 'feature', value : 'auto',
        description: 'OpenGL support')
+option('rdma', type : 'feature', value : 'auto',
+       description: 'Enable RDMA-based migration')
+option('pvrdma', type : 'feature', value : 'auto',
+       description: 'Enable PVRDMA support')
 option('gtk', type : 'feature', value : 'auto',
        description: 'GTK+ user interface')
 option('sdl', type : 'feature', value : 'auto',
diff --git a/migration/meson.build b/migration/meson.build
index 8b5ca5c047..6880b61b10 100644
--- a/migration/meson.build
+++ b/migration/meson.build
@@ -27,7 +27,7 @@ softmmu_ss.add(files(
   'tls.c',
 ), gnutls)
 
-softmmu_ss.add(when: ['CONFIG_RDMA', rdma], if_true: files('rdma.c'))
+softmmu_ss.add(when: rdma, if_true: files('rdma.c'))
 if get_option('live_block_migration').allowed()
   softmmu_ss.add(files('block.c'))
 endif
diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh
index 203f33ae18..838aa38df9 100644
--- a/scripts/meson-buildoptions.sh
+++ b/scripts/meson-buildoptions.sh
@@ -96,10 +96,12 @@ meson_options_help() {
   printf "%s\n" '  pa              PulseAudio sound support'
   printf "%s\n" '  parallels       parallels image format support'
   printf "%s\n" '  png             PNG support with libpng'
+  printf "%s\n" '  pvrdma          Enable PVRDMA support'
   printf "%s\n" '  qcow1           qcow1 image format support'
   printf "%s\n" '  qed             qed image format support'
   printf "%s\n" '  qga-vss         build QGA VSS support (broken with MinGW)'
   printf "%s\n" '  rbd             Ceph block device driver'
+  printf "%s\n" '  rdma            Enable RDMA-based migration'
   printf "%s\n" '  replication     replication support'
   printf "%s\n" '  sdl             SDL user interface'
   printf "%s\n" '  sdl-image       SDL Image support for icons'
@@ -284,6 +286,8 @@ _meson_option_parse() {
     --disable-png) printf "%s" -Dpng=disabled ;;
     --enable-profiler) printf "%s" -Dprofiler=true ;;
     --disable-profiler) printf "%s" -Dprofiler=false ;;
+    --enable-pvrdma) printf "%s" -Dpvrdma=enabled ;;
+    --disable-pvrdma) printf "%s" -Dpvrdma=disabled ;;
     --enable-qcow1) printf "%s" -Dqcow1=enabled ;;
     --disable-qcow1) printf "%s" -Dqcow1=disabled ;;
     --enable-qed) printf "%s" -Dqed=enabled ;;
@@ -294,6 +298,8 @@ _meson_option_parse() {
     --disable-qom-cast-debug) printf "%s" -Dqom_cast_debug=false ;;
     --enable-rbd) printf "%s" -Drbd=enabled ;;
     --disable-rbd) printf "%s" -Drbd=disabled ;;
+    --enable-rdma) printf "%s" -Drdma=enabled ;;
+    --disable-rdma) printf "%s" -Drdma=disabled ;;
     --enable-replication) printf "%s" -Dreplication=enabled ;;
     --disable-replication) printf "%s" -Dreplication=disabled ;;
     --enable-rng-none) printf "%s" -Drng_none=true ;;
-- 
2.35.1




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

* [PULL 13/18] meson, configure: move keyctl test to meson
  2022-04-28  6:53 [PULL 00/18] Misc QEMU patches for 2022-04-28 Paolo Bonzini
                   ` (11 preceding siblings ...)
  2022-04-28  6:53 ` [PULL 12/18] meson, configure: move RDMA options " Paolo Bonzini
@ 2022-04-28  6:53 ` Paolo Bonzini
  2022-04-28  6:53 ` [PULL 14/18] meson, configure: move usbfs " Paolo Bonzini
                   ` (5 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: Paolo Bonzini @ 2022-04-28  6:53 UTC (permalink / raw)
  To: qemu-devel; +Cc: Marc-André Lureau

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 configure                     | 44 -----------------------------------
 crypto/meson.build            |  4 +++-
 meson.build                   | 15 +++++++++++-
 meson_options.txt             |  2 ++
 scripts/meson-buildoptions.sh |  3 +++
 5 files changed, 22 insertions(+), 46 deletions(-)

diff --git a/configure b/configure
index 4deca94235..313579019d 100755
--- a/configure
+++ b/configure
@@ -322,7 +322,6 @@ trace_file="trace"
 coroutine=""
 tls_priority="NORMAL"
 plugins="$default_feature"
-secret_keyring="$default_feature"
 meson=""
 meson_args=""
 ninja=""
@@ -1009,10 +1008,6 @@ for opt do
   ;;
   --gdb=*) gdb_bin="$optarg"
   ;;
-  --enable-keyring) secret_keyring="yes"
-  ;;
-  --disable-keyring) secret_keyring="no"
-  ;;
   --enable-gio) gio=yes
   ;;
   --disable-gio) gio=no
@@ -2440,41 +2435,6 @@ case "$slirp" in
     ;;
 esac
 
-##########################################
-# check for usable __NR_keyctl syscall
-
-if test "$linux" = "yes" ; then
-
-    have_keyring=no
-    cat > $TMPC << EOF
-#include <errno.h>
-#include <asm/unistd.h>
-#include <linux/keyctl.h>
-#include <unistd.h>
-int main(void) {
-    return syscall(__NR_keyctl, KEYCTL_READ, 0, NULL, NULL, 0);
-}
-EOF
-    if compile_prog "" "" ; then
-        have_keyring=yes
-    fi
-fi
-if test "$secret_keyring" != "no"
-then
-    if test "$have_keyring" = "yes"
-    then
-	secret_keyring=yes
-    else
-	if test "$secret_keyring" = "yes"
-	then
-	    error_exit "syscall __NR_keyctl requested, \
-but not implemented on your system"
-	else
-	    secret_keyring=no
-	fi
-    fi
-fi
-
 ##########################################
 # End of CC checks
 # After here, no more $cc or $ld runs
@@ -2760,10 +2720,6 @@ if test -n "$gdb_bin"; then
     fi
 fi
 
-if test "$secret_keyring" = "yes" ; then
-  echo "CONFIG_SECRET_KEYRING=y" >> $config_host_mak
-fi
-
 echo "ROMS=$roms" >> $config_host_mak
 echo "MAKE=$make" >> $config_host_mak
 echo "PYTHON=$python" >> $config_host_mak
diff --git a/crypto/meson.build b/crypto/meson.build
index 19c44bea89..f065f2f277 100644
--- a/crypto/meson.build
+++ b/crypto/meson.build
@@ -34,7 +34,9 @@ else
   crypto_ss.add(files('hash-glib.c', 'hmac-glib.c', 'pbkdf-stub.c'))
 endif
 
-crypto_ss.add(when: 'CONFIG_SECRET_KEYRING', if_true: files('secret_keyring.c'))
+if have_keyring
+  crypto_ss.add(files('secret_keyring.c'))
+endif
 if have_afalg
   crypto_ss.add(if_true: files('afalg.c', 'cipher-afalg.c', 'hash-afalg.c'))
 endif
diff --git a/meson.build b/meson.build
index 9c03436756..64161dffe7 100644
--- a/meson.build
+++ b/meson.build
@@ -1940,6 +1940,19 @@ config_host_data.set('CONFIG_GETAUXVAL', cc.links(gnu_source_prefix + '''
     return getauxval(AT_HWCAP) == 0;
   }'''))
 
+have_keyring = get_option('keyring') \
+  .require(targetos == 'linux', error_message: 'keyring is only available on Linux') \
+  .require(cc.compiles('''
+    #include <errno.h>
+    #include <asm/unistd.h>
+    #include <linux/keyctl.h>
+    #include <sys/syscall.h>
+    #include <unistd.h>
+    int main(void) {
+        return syscall(__NR_keyctl, KEYCTL_READ, 0, NULL, NULL, 0);
+    }'''), error_message: 'keyctl syscall not available on this system').allowed()
+config_host_data.set('CONFIG_SECRET_KEYRING', have_keyring)
+
 have_cpuid_h = cc.links('''
   #include <cpuid.h>
   int main(void) {
@@ -3698,7 +3711,7 @@ if nettle.found()
 endif
 summary_info += {'AF_ALG support':    have_afalg}
 summary_info += {'rng-none':          get_option('rng_none')}
-summary_info += {'Linux keyring':     config_host.has_key('CONFIG_SECRET_KEYRING')}
+summary_info += {'Linux keyring':     have_keyring}
 summary(summary_info, bool_yn: true, section: 'Crypto')
 
 # Libraries
diff --git a/meson_options.txt b/meson_options.txt
index 3bdf409497..8efdd0193a 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -90,6 +90,8 @@ option('avx2', type: 'feature', value: 'auto',
        description: 'AVX2 optimizations')
 option('avx512f', type: 'feature', value: 'disabled',
        description: 'AVX512F optimizations')
+option('keyring', type: 'feature', value: 'auto',
+       description: 'Linux keyring support')
 
 option('attr', type : 'feature', value : 'auto',
        description: 'attr/xattr support')
diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh
index 838aa38df9..3ba4aaf132 100644
--- a/scripts/meson-buildoptions.sh
+++ b/scripts/meson-buildoptions.sh
@@ -68,6 +68,7 @@ meson_options_help() {
   printf "%s\n" '  hvf             HVF acceleration support'
   printf "%s\n" '  iconv           Font glyph conversion support'
   printf "%s\n" '  jack            JACK sound support'
+  printf "%s\n" '  keyring         Linux keyring support'
   printf "%s\n" '  kvm             KVM acceleration support'
   printf "%s\n" '  l2tpv3          l2tpv3 network backend support'
   printf "%s\n" '  libdaxctl       libdaxctl support'
@@ -229,6 +230,8 @@ _meson_option_parse() {
     --disable-install-blobs) printf "%s" -Dinstall_blobs=false ;;
     --enable-jack) printf "%s" -Djack=enabled ;;
     --disable-jack) printf "%s" -Djack=disabled ;;
+    --enable-keyring) printf "%s" -Dkeyring=enabled ;;
+    --disable-keyring) printf "%s" -Dkeyring=disabled ;;
     --enable-kvm) printf "%s" -Dkvm=enabled ;;
     --disable-kvm) printf "%s" -Dkvm=disabled ;;
     --enable-l2tpv3) printf "%s" -Dl2tpv3=enabled ;;
-- 
2.35.1




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

* [PULL 14/18] meson, configure: move usbfs test to meson
  2022-04-28  6:53 [PULL 00/18] Misc QEMU patches for 2022-04-28 Paolo Bonzini
                   ` (12 preceding siblings ...)
  2022-04-28  6:53 ` [PULL 13/18] meson, configure: move keyctl test " Paolo Bonzini
@ 2022-04-28  6:53 ` Paolo Bonzini
  2022-04-28  6:53 ` [PULL 15/18] meson, configure: move libgio " Paolo Bonzini
                   ` (4 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: Paolo Bonzini @ 2022-04-28  6:53 UTC (permalink / raw)
  To: qemu-devel; +Cc: Marc-André Lureau

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 configure   | 28 ----------------------------
 meson.build | 13 +++++++++++++
 2 files changed, 13 insertions(+), 28 deletions(-)

diff --git a/configure b/configure
index 313579019d..d527a9c22e 100755
--- a/configure
+++ b/configure
@@ -2160,31 +2160,6 @@ case "$fdt" in
     ;;
 esac
 
-##########################################
-# check for usbfs
-have_usbfs=no
-if test "$linux_user" = "yes"; then
-  cat > $TMPC << EOF
-#include <linux/usbdevice_fs.h>
-
-#ifndef USBDEVFS_GET_CAPABILITIES
-#error "USBDEVFS_GET_CAPABILITIES undefined"
-#endif
-
-#ifndef USBDEVFS_DISCONNECT_CLAIM
-#error "USBDEVFS_DISCONNECT_CLAIM undefined"
-#endif
-
-int main(void)
-{
-    return 0;
-}
-EOF
-  if compile_prog "" ""; then
-    have_usbfs=yes
-  fi
-fi
-
 ##########################################
 # capstone
 
@@ -2641,9 +2616,6 @@ fi
 if test "$module_upgrades" = "yes"; then
   echo "CONFIG_MODULE_UPGRADES=y" >> $config_host_mak
 fi
-if test "$have_usbfs" = "yes" ; then
-  echo "CONFIG_USBFS=y" >> $config_host_mak
-fi
 if test "$gio" = "yes" ; then
     echo "CONFIG_GIO=y" >> $config_host_mak
     echo "GIO_CFLAGS=$gio_cflags" >> $config_host_mak
diff --git a/meson.build b/meson.build
index 64161dffe7..c99b28a5ef 100644
--- a/meson.build
+++ b/meson.build
@@ -1940,6 +1940,19 @@ config_host_data.set('CONFIG_GETAUXVAL', cc.links(gnu_source_prefix + '''
     return getauxval(AT_HWCAP) == 0;
   }'''))
 
+config_host_data.set('CONFIG_USBFS', have_linux_user and cc.compiles('''
+  #include <linux/usbdevice_fs.h>
+
+  #ifndef USBDEVFS_GET_CAPABILITIES
+  #error "USBDEVFS_GET_CAPABILITIES undefined"
+  #endif
+
+  #ifndef USBDEVFS_DISCONNECT_CLAIM
+  #error "USBDEVFS_DISCONNECT_CLAIM undefined"
+  #endif
+
+  int main(void) { return 0; }'''))
+
 have_keyring = get_option('keyring') \
   .require(targetos == 'linux', error_message: 'keyring is only available on Linux') \
   .require(cc.compiles('''
-- 
2.35.1




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

* [PULL 15/18] meson, configure: move libgio test to meson
  2022-04-28  6:53 [PULL 00/18] Misc QEMU patches for 2022-04-28 Paolo Bonzini
                   ` (13 preceding siblings ...)
  2022-04-28  6:53 ` [PULL 14/18] meson, configure: move usbfs " Paolo Bonzini
@ 2022-04-28  6:53 ` Paolo Bonzini
  2022-04-28  6:53 ` [PULL 16/18] meson: remove CONFIG_XEN_PCI_PASSTHROUGH from config-target.h Paolo Bonzini
                   ` (3 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: Paolo Bonzini @ 2022-04-28  6:53 UTC (permalink / raw)
  To: qemu-devel; +Cc: Marc-André Lureau

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 backends/meson.build          |  2 +-
 configure                     | 58 -----------------------------------
 meson.build                   | 32 ++++++++++++++++---
 meson_options.txt             |  2 ++
 scripts/meson-buildoptions.sh |  3 ++
 tests/qtest/meson.build       |  5 ++-
 ui/meson.build                |  7 ++---
 util/meson.build              |  2 +-
 8 files changed, 39 insertions(+), 72 deletions(-)

diff --git a/backends/meson.build b/backends/meson.build
index 6e68945528..535c3ca7dd 100644
--- a/backends/meson.build
+++ b/backends/meson.build
@@ -15,7 +15,7 @@ softmmu_ss.add(when: 'CONFIG_LINUX', if_true: files('hostmem-memfd.c'))
 softmmu_ss.add(when: ['CONFIG_VHOST_USER', 'CONFIG_VIRTIO'], if_true: files('vhost-user.c'))
 softmmu_ss.add(when: 'CONFIG_VIRTIO_CRYPTO', if_true: files('cryptodev-vhost.c'))
 softmmu_ss.add(when: ['CONFIG_VIRTIO_CRYPTO', 'CONFIG_VHOST_CRYPTO'], if_true: files('cryptodev-vhost-user.c'))
-softmmu_ss.add(when: 'CONFIG_GIO', if_true: [files('dbus-vmstate.c'), gio])
+softmmu_ss.add(when: gio, if_true: files('dbus-vmstate.c'))
 softmmu_ss.add(when: 'CONFIG_SGX', if_true: files('hostmem-epc.c'))
 
 subdir('tpm')
diff --git a/configure b/configure
index d527a9c22e..1fb70bf614 100755
--- a/configure
+++ b/configure
@@ -325,7 +325,6 @@ plugins="$default_feature"
 meson=""
 meson_args=""
 ninja=""
-gio="$default_feature"
 skip_meson=no
 
 # The following Meson options are handled manually (still they
@@ -1008,10 +1007,6 @@ for opt do
   ;;
   --gdb=*) gdb_bin="$optarg"
   ;;
-  --enable-gio) gio=yes
-  ;;
-  --disable-gio) gio=no
-  ;;
   # backwards compatibility options
   --enable-trace-backend=*) meson_option_parse "--enable-trace-backends=$optarg" "$optarg"
   ;;
@@ -1236,7 +1231,6 @@ cat << EOF
   vhost-kernel    vhost kernel backend support
   vhost-user      vhost-user backend support
   vhost-vdpa      vhost-vdpa kernel backend support
-  gio             libgio support
 
 NOTE: The object files are built at the place where configure is launched
 EOF
@@ -2047,50 +2041,6 @@ if test "$static" = yes && test "$mingw32" = yes; then
     glib_cflags="-DGLIB_STATIC_COMPILATION $glib_cflags"
 fi
 
-if ! test "$gio" = "no"; then
-    pass=no
-    if $pkg_config --atleast-version=$glib_req_ver gio-2.0; then
-        gio_cflags=$($pkg_config --cflags gio-2.0)
-        gio_libs=$($pkg_config --libs gio-2.0)
-        gdbus_codegen=$($pkg_config --variable=gdbus_codegen gio-2.0)
-        if ! has "$gdbus_codegen"; then
-            gdbus_codegen=
-        fi
-        # Check that the libraries actually work -- Ubuntu 18.04 ships
-        # with pkg-config --static --libs data for gio-2.0 that is missing
-        # -lblkid and will give a link error.
-        cat > $TMPC <<EOF
-#include <gio/gio.h>
-int main(void)
-{
-    g_dbus_proxy_new_sync(0, 0, 0, 0, 0, 0, 0, 0);
-    return 0;
-}
-EOF
-        if compile_prog "$gio_cflags" "$gio_libs" ; then
-            pass=yes
-        else
-            pass=no
-        fi
-
-        if test "$pass" = "yes" &&
-            $pkg_config --atleast-version=$glib_req_ver gio-unix-2.0; then
-            gio_cflags="$gio_cflags $($pkg_config --cflags gio-unix-2.0)"
-            gio_libs="$gio_libs $($pkg_config --libs gio-unix-2.0)"
-        fi
-    fi
-
-    if test "$pass" = "no"; then
-        if test "$gio" = "yes"; then
-            feature_not_found "gio" "Install libgio >= 2.0"
-        else
-            gio=no
-        fi
-    else
-        gio=yes
-    fi
-fi
-
 # Sanity check that the current size_t matches the
 # size that glib thinks it should be. This catches
 # problems on multi-arch where people try to build
@@ -2616,14 +2566,6 @@ fi
 if test "$module_upgrades" = "yes"; then
   echo "CONFIG_MODULE_UPGRADES=y" >> $config_host_mak
 fi
-if test "$gio" = "yes" ; then
-    echo "CONFIG_GIO=y" >> $config_host_mak
-    echo "GIO_CFLAGS=$gio_cflags" >> $config_host_mak
-    echo "GIO_LIBS=$gio_libs" >> $config_host_mak
-fi
-if test "$gdbus_codegen" != "" ; then
-    echo "GDBUS_CODEGEN=$gdbus_codegen" >> $config_host_mak
-fi
 echo "CONFIG_TLS_PRIORITY=\"$tls_priority\"" >> $config_host_mak
 
 if test "$xen" = "enabled" ; then
diff --git a/meson.build b/meson.build
index c99b28a5ef..9f2a12e1cf 100644
--- a/meson.build
+++ b/meson.build
@@ -448,11 +448,32 @@ glib = declare_dependency(compile_args: config_host['GLIB_CFLAGS'].split(),
 meson.override_dependency('glib-2.0', glib)
 
 gio = not_found
-if 'CONFIG_GIO' in config_host
-  gio = declare_dependency(compile_args: config_host['GIO_CFLAGS'].split(),
-                           link_args: config_host['GIO_LIBS'].split(),
-                           version: config_host['GLIB_VERSION'])
+gdbus_codegen = not_found
+if not get_option('gio').auto() or have_system
+  gio = dependency('gio-2.0', required: get_option('gio'),
+                   method: 'pkg-config', kwargs: static_kwargs)
+  if gio.found() and not cc.links('''
+    #include <gio/gio.h>
+    int main(void)
+    {
+      g_dbus_proxy_new_sync(0, 0, 0, 0, 0, 0, 0, 0);
+      return 0;
+    }''', dependencies: [glib, gio])
+    if get_option('gio').enabled()
+      error('The installed libgio is broken for static linking')
+    endif
+    gio = not_found
+  endif
+  if gio.found()
+    gdbus_codegen = find_program(gio.get_variable('gdbus_codegen'),
+                                 required: get_option('gio'))
+    gio_unix = dependency('gio-unix-2.0', required: get_option('gio'),
+                          method: 'pkg-config', kwargs: static_kwargs)
+    gio = declare_dependency(dependencies: [gio, gio_unix],
+                             version: gio.version())
+  endif
 endif
+
 lttng = not_found
 if 'ust' in get_option('trace_backends')
   lttng = dependency('lttng-ust', required: true, version: '>= 2.1',
@@ -1480,7 +1501,7 @@ dbus_display = get_option('dbus_display') \
            error_message: '-display dbus requires glib>=2.64') \
   .require(enable_modules,
            error_message: '-display dbus requires --enable-modules') \
-  .require(config_host.has_key('GDBUS_CODEGEN'),
+  .require(gdbus_codegen.found(),
            error_message: '-display dbus requires gdbus-codegen') \
   .allowed()
 
@@ -1542,6 +1563,7 @@ 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_GIO', gio.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'))
diff --git a/meson_options.txt b/meson_options.txt
index 8efdd0193a..65f7010bae 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -109,6 +109,8 @@ option('cocoa', type : 'feature', value : 'auto',
        description: 'Cocoa user interface (macOS only)')
 option('curl', type : 'feature', value : 'auto',
        description: 'CURL block device driver')
+option('gio', type : 'feature', value : 'auto',
+       description: 'use libgio for D-Bus support')
 option('glusterfs', type : 'feature', value : 'auto',
        description: 'Glusterfs block device driver')
 option('libiscsi', type : 'feature', value : 'auto',
diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh
index 3ba4aaf132..ee80f01cea 100644
--- a/scripts/meson-buildoptions.sh
+++ b/scripts/meson-buildoptions.sh
@@ -59,6 +59,7 @@ meson_options_help() {
   printf "%s\n" '  fuse-lseek      SEEK_HOLE/SEEK_DATA support for FUSE exports'
   printf "%s\n" '  gcrypt          libgcrypt cryptography support'
   printf "%s\n" '  gettext         Localization of the GTK+ user interface'
+  printf "%s\n" '  gio             use libgio for D-Bus support'
   printf "%s\n" '  glusterfs       Glusterfs block device driver'
   printf "%s\n" '  gnutls          GNUTLS cryptography support'
   printf "%s\n" '  gtk             GTK+ user interface'
@@ -208,6 +209,8 @@ _meson_option_parse() {
     --disable-gcrypt) printf "%s" -Dgcrypt=disabled ;;
     --enable-gettext) printf "%s" -Dgettext=enabled ;;
     --disable-gettext) printf "%s" -Dgettext=disabled ;;
+    --enable-gio) printf "%s" -Dgio=enabled ;;
+    --disable-gio) printf "%s" -Dgio=disabled ;;
     --enable-glusterfs) printf "%s" -Dglusterfs=enabled ;;
     --disable-glusterfs) printf "%s" -Dglusterfs=disabled ;;
     --enable-gnutls) printf "%s" -Dgnutls=enabled ;;
diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build
index 22e1361210..6b9807c183 100644
--- a/tests/qtest/meson.build
+++ b/tests/qtest/meson.build
@@ -98,14 +98,13 @@ if dbus_display
 endif
 
 dbus_daemon = find_program('dbus-daemon', required: false)
-if dbus_daemon.found() and config_host.has_key('GDBUS_CODEGEN')
+if dbus_daemon.found() and gdbus_codegen.found()
   # Temporarily disabled due to Patchew failures:
   #qtests_i386 += ['dbus-vmstate-test']
   dbus_vmstate1 = custom_target('dbus-vmstate description',
                                 output: ['dbus-vmstate1.h', 'dbus-vmstate1.c'],
                                 input: meson.project_source_root() / 'backends/dbus-vmstate1.xml',
-                                command: [config_host['GDBUS_CODEGEN'],
-                                          '@INPUT@',
+                                command: [gdbus_codegen, '@INPUT@',
                                           '--interface-prefix', 'org.qemu',
                                           '--generate-c-code', '@BASENAME@']).to_list()
 else
diff --git a/ui/meson.build b/ui/meson.build
index b21d3d1534..eba93b41e3 100644
--- a/ui/meson.build
+++ b/ui/meson.build
@@ -74,14 +74,13 @@ if dbus_display
   dbus_display1 = custom_target('dbus-display gdbus-codegen',
                                 output: ['dbus-display1.h', 'dbus-display1.c'],
                                 input: files('dbus-display1.xml'),
-                                command: [config_host['GDBUS_CODEGEN'],
-                                          '@INPUT@',
+                                command: [gdbus_codegen, '@INPUT@',
                                           '--glib-min-required', '2.64',
                                           '--output-directory', meson.current_build_dir(),
                                           '--interface-prefix', 'org.qemu.',
                                           '--c-namespace', 'QemuDBus',
                                           '--generate-c-code', '@BASENAME@'])
-  dbus_ss.add(when: [gio, pixman, opengl, 'CONFIG_GIO'],
+  dbus_ss.add(when: [gio, pixman, opengl],
               if_true: [files(
                 'dbus-chardev.c',
                 'dbus-clipboard.c',
@@ -128,7 +127,7 @@ if spice.found()
   ui_modules += {'spice-core' : spice_core_ss}
 endif
 
-if spice.found() and config_host.has_key('CONFIG_GIO')
+if spice.found() and gio.found()
   spice_ss = ss.source_set()
   spice_ss.add(spice, gio, pixman, files('spice-app.c'))
   ui_modules += {'spice-app': spice_ss}
diff --git a/util/meson.build b/util/meson.build
index 82eec004e2..8f16018cd4 100644
--- a/util/meson.build
+++ b/util/meson.build
@@ -61,7 +61,7 @@ endif
 
 if have_system
   util_ss.add(files('crc-ccitt.c'))
-  util_ss.add(when: 'CONFIG_GIO', if_true: [files('dbus.c'), gio])
+  util_ss.add(when: gio, if_true: files('dbus.c'))
   util_ss.add(when: 'CONFIG_LINUX', if_true: files('userfaultfd.c'))
 endif
 
-- 
2.35.1




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

* [PULL 16/18] meson: remove CONFIG_XEN_PCI_PASSTHROUGH from config-target.h
  2022-04-28  6:53 [PULL 00/18] Misc QEMU patches for 2022-04-28 Paolo Bonzini
                   ` (14 preceding siblings ...)
  2022-04-28  6:53 ` [PULL 15/18] meson, configure: move libgio " Paolo Bonzini
@ 2022-04-28  6:53 ` Paolo Bonzini
  2022-04-28  6:53 ` [PULL 17/18] meson, configure: move --enable-module-upgrades to meson Paolo Bonzini
                   ` (2 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: Paolo Bonzini @ 2022-04-28  6:53 UTC (permalink / raw)
  To: qemu-devel

CONFIG_XEN_PCI_PASSTHROUGH is just a global configuration option;
it is never used in the source files, so there is no need to put
CONFIG_XEN_PCI_PASSTHROUGH in config-target.h or even in config-host.h.

This inaccuracy was copied over from the configure script in commit
8a19980e3f ("configure: move accelerator logic to meson", 2020-10-03).

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/xen/meson.build | 20 ++++++++++++--------
 meson.build        |  2 --
 2 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/hw/xen/meson.build b/hw/xen/meson.build
index 076954b89c..08dc1f6857 100644
--- a/hw/xen/meson.build
+++ b/hw/xen/meson.build
@@ -8,13 +8,17 @@ softmmu_ss.add(when: ['CONFIG_XEN', xen], if_true: files(
 ))
 
 xen_specific_ss = ss.source_set()
-xen_specific_ss.add(when: 'CONFIG_XEN_PCI_PASSTHROUGH', if_true: files(
-  'xen-host-pci-device.c',
-  'xen_pt.c',
-  'xen_pt_config_init.c',
-  'xen_pt_graphics.c',
-  'xen_pt_load_rom.c',
-  'xen_pt_msi.c',
-), if_false: files('xen_pt_stub.c'))
+if have_xen_pci_passthrough
+  xen_specific_ss.add(files(
+    'xen-host-pci-device.c',
+    'xen_pt.c',
+    'xen_pt_config_init.c',
+    'xen_pt_graphics.c',
+    'xen_pt_load_rom.c',
+    'xen_pt_msi.c',
+  ))
+else
+  xen_specific_ss.add('xen_pt_stub.c')
+endif
 
 specific_ss.add_all(when: ['CONFIG_XEN', xen], if_true: xen_specific_ss)
diff --git a/meson.build b/meson.build
index 9f2a12e1cf..ab1ac9b959 100644
--- a/meson.build
+++ b/meson.build
@@ -2242,8 +2242,6 @@ foreach target : target_dirs
       config_all += { sym: 'y' }
       if sym == 'CONFIG_TCG' and tcg_arch == 'tci'
         config_target += { 'CONFIG_TCG_INTERPRETER': 'y' }
-      elif sym == 'CONFIG_XEN' and have_xen_pci_passthrough
-        config_target += { 'CONFIG_XEN_PCI_PASSTHROUGH': 'y' }
       endif
       if target in modular_tcg
         config_target += { 'CONFIG_TCG_MODULAR': 'y' }
-- 
2.35.1




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

* [PULL 17/18] meson, configure: move --enable-module-upgrades to meson
  2022-04-28  6:53 [PULL 00/18] Misc QEMU patches for 2022-04-28 Paolo Bonzini
                   ` (15 preceding siblings ...)
  2022-04-28  6:53 ` [PULL 16/18] meson: remove CONFIG_XEN_PCI_PASSTHROUGH from config-target.h Paolo Bonzini
@ 2022-04-28  6:53 ` Paolo Bonzini
  2022-04-28  6:53 ` [PULL 18/18] qemu-options: Limit the -enable-kvm option to the targets that support it Paolo Bonzini
  2022-04-28 15:33 ` [PULL 00/18] Misc QEMU patches for 2022-04-28 Richard Henderson
  18 siblings, 0 replies; 20+ messages in thread
From: Paolo Bonzini @ 2022-04-28  6:53 UTC (permalink / raw)
  To: qemu-devel; +Cc: Marc-André Lureau

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 configure                     | 14 --------------
 meson.build                   |  7 ++++++-
 meson_options.txt             |  2 ++
 scripts/meson-buildoptions.sh |  4 ++++
 4 files changed, 12 insertions(+), 15 deletions(-)

diff --git a/configure b/configure
index 1fb70bf614..59c43bea05 100755
--- a/configure
+++ b/configure
@@ -310,7 +310,6 @@ fortify_source="yes"
 gcov="no"
 EXESUF=""
 modules="no"
-module_upgrades="no"
 prefix="/usr/local"
 qemu_suffix="qemu"
 softmmu="yes"
@@ -762,10 +761,6 @@ for opt do
   --disable-modules)
       modules="no"
   ;;
-  --disable-module-upgrades) module_upgrades="no"
-  ;;
-  --enable-module-upgrades) module_upgrades="yes"
-  ;;
   --cpu=*)
   ;;
   --target-list=*) target_list="$optarg"
@@ -1218,7 +1213,6 @@ cat << EOF
   bsd-user        all BSD usermode emulation targets
   pie             Position Independent Executables
   modules         modules support (non-Windows)
-  module-upgrades try to load modules from alternate paths for upgrades
   debug-tcg       TCG debugging (default is disabled)
   debug-info      debugging information
   lto             Enable Link-Time Optimization.
@@ -1487,11 +1481,6 @@ if test "$modules" = "yes" && test "$mingw32" = "yes" ; then
   error_exit "Modules are not available for Windows"
 fi
 
-# module_upgrades is only reasonable if modules are enabled
-if test "$modules" = "no" && test "$module_upgrades" = "yes" ; then
-  error_exit "Can't enable module-upgrades as Modules are not enabled"
-fi
-
 # Static linking is not possible with plugins, modules or PIE
 if test "$static" = "yes" ; then
   if test "$modules" = "yes" ; then
@@ -2563,9 +2552,6 @@ if test "$modules" = "yes"; then
   echo "CONFIG_STAMP=_$( (echo $qemu_version; echo $pkgversion; cat $0) | $shacmd - | cut -f1 -d\ )" >> $config_host_mak
   echo "CONFIG_MODULES=y" >> $config_host_mak
 fi
-if test "$module_upgrades" = "yes"; then
-  echo "CONFIG_MODULE_UPGRADES=y" >> $config_host_mak
-fi
 echo "CONFIG_TLS_PRIORITY=\"$tls_priority\"" >> $config_host_mak
 
 if test "$xen" = "enabled" ; then
diff --git a/meson.build b/meson.build
index ab1ac9b959..1fe7d257ff 100644
--- a/meson.build
+++ b/meson.build
@@ -1550,6 +1550,11 @@ endif
 
 config_host_data.set('HOST_' + host_arch.to_upper(), 1)
 
+if get_option('module_upgrades') and not enable_modules
+  error('Cannot enable module-upgrades as modules are not enabled')
+endif
+config_host_data.set('CONFIG_MODULE_UPGRADES', get_option('module_upgrades'))
+
 config_host_data.set('CONFIG_ATTR', libattr.found())
 config_host_data.set('CONFIG_BDRV_WHITELIST_TOOLS', get_option('block_drv_whitelist_in_tools'))
 config_host_data.set('CONFIG_BRLAPI', brlapi.found())
@@ -3576,7 +3581,7 @@ summary_info += {'block layer':       have_block}
 summary_info += {'Install blobs':     get_option('install_blobs')}
 summary_info += {'module support':    config_host.has_key('CONFIG_MODULES')}
 if config_host.has_key('CONFIG_MODULES')
-  summary_info += {'alternative module path': config_host.has_key('CONFIG_MODULE_UPGRADES')}
+  summary_info += {'alternative module path': get_option('module_upgrades')}
 endif
 summary_info += {'fuzzing support':   get_option('fuzzing')}
 if have_system
diff --git a/meson_options.txt b/meson_options.txt
index 65f7010bae..af432a4ee6 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -34,6 +34,8 @@ option('fuzzing', type : 'boolean', value: false,
        description: 'build fuzzing targets')
 option('gettext', type : 'feature', value : 'auto',
        description: 'Localization of the GTK+ user interface')
+option('module_upgrades', type : 'boolean', value : false,
+       description: 'try to load modules from alternate paths for upgrades')
 option('install_blobs', type : 'boolean', value : true,
        description: 'install provided firmware blobs')
 option('sparse', type : 'feature', value : 'auto',
diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh
index ee80f01cea..21366b2102 100644
--- a/scripts/meson-buildoptions.sh
+++ b/scripts/meson-buildoptions.sh
@@ -19,6 +19,8 @@ meson_options_help() {
   printf "%s\n" '  --disable-install-blobs  install provided firmware blobs'
   printf "%s\n" '  --enable-malloc=CHOICE   choose memory allocator to use [system] (choices:'
   printf "%s\n" '                           jemalloc/system/tcmalloc)'
+  printf "%s\n" '  --enable-module-upgrades try to load modules from alternate paths for'
+  printf "%s\n" '                           upgrades'
   printf "%s\n" '  --enable-profiler        profiler support'
   printf "%s\n" '  --enable-qom-cast-debug  cast debugging support'
   printf "%s\n" '  --enable-rng-none        dummy RNG, avoid using /dev/(u)random and'
@@ -268,6 +270,8 @@ _meson_option_parse() {
     --disable-malloc-trim) printf "%s" -Dmalloc_trim=disabled ;;
     --enable-membarrier) printf "%s" -Dmembarrier=enabled ;;
     --disable-membarrier) printf "%s" -Dmembarrier=disabled ;;
+    --enable-module-upgrades) printf "%s" -Dmodule_upgrades=true ;;
+    --disable-module-upgrades) printf "%s" -Dmodule_upgrades=false ;;
     --enable-mpath) printf "%s" -Dmpath=enabled ;;
     --disable-mpath) printf "%s" -Dmpath=disabled ;;
     --enable-multiprocess) printf "%s" -Dmultiprocess=enabled ;;
-- 
2.35.1




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

* [PULL 18/18] qemu-options: Limit the -enable-kvm option to the targets that support it
  2022-04-28  6:53 [PULL 00/18] Misc QEMU patches for 2022-04-28 Paolo Bonzini
                   ` (16 preceding siblings ...)
  2022-04-28  6:53 ` [PULL 17/18] meson, configure: move --enable-module-upgrades to meson Paolo Bonzini
@ 2022-04-28  6:53 ` Paolo Bonzini
  2022-04-28 15:33 ` [PULL 00/18] Misc QEMU patches for 2022-04-28 Richard Henderson
  18 siblings, 0 replies; 20+ messages in thread
From: Paolo Bonzini @ 2022-04-28  6:53 UTC (permalink / raw)
  To: qemu-devel; +Cc: Thomas Huth

From: Thomas Huth <thuth@redhat.com>

There is no need to present the user with -enable-kvm if there
is no support for KVM on the corresponding target.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20220427134906.348118-1-thuth@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 qemu-options.hx | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/qemu-options.hx b/qemu-options.hx
index bc196808ae..5f69b94b8e 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -4176,7 +4176,9 @@ SRST
 ERST
 
 DEF("enable-kvm", 0, QEMU_OPTION_enable_kvm, \
-    "-enable-kvm     enable KVM full virtualization support\n", QEMU_ARCH_ALL)
+    "-enable-kvm     enable KVM full virtualization support\n",
+    QEMU_ARCH_ARM | QEMU_ARCH_I386 | QEMU_ARCH_MIPS | QEMU_ARCH_PPC |
+    QEMU_ARCH_RISCV | QEMU_ARCH_S390X)
 SRST
 ``-enable-kvm``
     Enable KVM full virtualization support. This option is only
-- 
2.35.1



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

* Re: [PULL 00/18] Misc QEMU patches for 2022-04-28
  2022-04-28  6:53 [PULL 00/18] Misc QEMU patches for 2022-04-28 Paolo Bonzini
                   ` (17 preceding siblings ...)
  2022-04-28  6:53 ` [PULL 18/18] qemu-options: Limit the -enable-kvm option to the targets that support it Paolo Bonzini
@ 2022-04-28 15:33 ` Richard Henderson
  18 siblings, 0 replies; 20+ messages in thread
From: Richard Henderson @ 2022-04-28 15:33 UTC (permalink / raw)
  To: Paolo Bonzini, qemu-devel

On 4/27/22 23:53, Paolo Bonzini wrote:
> The following changes since commit cf6f26d6f9b2015ee12b4604b79359e76784163a:
> 
>    Merge tag 'kraxel-20220427-pull-request' of git://git.kraxel.org/qemu into staging (2022-04-27 10:49:28 -0700)
> 
> are available in the Git repository at:
> 
>    https://gitlab.com/bonzini/qemu.git tags/for-upstream
> 
> for you to fetch changes up to 21abf010bb28f0c98db4ee66a990065062c62126:
> 
>    qemu-options: Limit the -enable-kvm option to the targets that support it (2022-04-28 08:52:22 +0200)
> 
> ----------------------------------------------------------------
> * Bugfixes
> * Meson conversions

Applied, thanks.  Please update https://wiki.qemu.org/ChangeLog/7.1 as appropriate.


r~


> 
> ----------------------------------------------------------------
> Haiyue Wang (1):
>        error-report: fix g_date_time_format assertion
> 
> Michael Tokarev (1):
>        configure: make fortify_source=yes by default
> 
> Paolo Bonzini (14):
>        remove -writeconfig
>        meson: show final set of compiler flags
>        configure: remove dead code
>        qga: wixl: get path to sysroot from pkg-config as intended
>        configure: pc-bios/qemu-icon.bmp does not exist
>        configure: gcov should not exclude fortify-source
>        configure: move --enable/--disable-debug-info to second option parsing pass
>        configure, meson: move OpenGL check to meson
>        meson, configure: move RDMA options to meson
>        meson, configure: move keyctl test to meson
>        meson, configure: move usbfs test to meson
>        meson, configure: move libgio test to meson
>        meson: remove CONFIG_XEN_PCI_PASSTHROUGH from config-target.h
>        meson, configure: move --enable-module-upgrades to meson
> 
> Paul Brook (1):
>        i386: pcmpestr 64-bit sign extension bug
> 
> Thomas Huth (1):
>        qemu-options: Limit the -enable-kvm option to the targets that support it
> 
>   backends/meson.build            |   2 +-
>   configure                       | 348 ++--------------------------------------
>   contrib/rdmacm-mux/meson.build  |   4 +-
>   crypto/meson.build              |   4 +-
>   docs/about/deprecated.rst       |   7 -
>   docs/about/removed-features.rst |   7 +
>   hw/xen/meson.build              |  20 ++-
>   include/qemu/config-file.h      |   1 -
>   meson.build                     | 149 ++++++++++++++---
>   meson_options.txt               |  12 ++
>   migration/meson.build           |   2 +-
>   qemu-options.hx                 |  12 +-
>   qga/meson.build                 |   2 +-
>   scripts/meson-buildoptions.sh   |  19 +++
>   softmmu/vl.c                    |  20 ---
>   target/i386/ops_sse.h           |  20 ++-
>   tests/qtest/meson.build         |   5 +-
>   ui/meson.build                  |  24 +--
>   util/error-report.c             |   2 +-
>   util/meson.build                |   2 +-
>   util/qemu-config.c              |  42 -----
>   21 files changed, 221 insertions(+), 483 deletions(-)



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

end of thread, other threads:[~2022-04-28 16:23 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-28  6:53 [PULL 00/18] Misc QEMU patches for 2022-04-28 Paolo Bonzini
2022-04-28  6:53 ` [PULL 01/18] error-report: fix g_date_time_format assertion Paolo Bonzini
2022-04-28  6:53 ` [PULL 02/18] configure: make fortify_source=yes by default Paolo Bonzini
2022-04-28  6:53 ` [PULL 03/18] remove -writeconfig Paolo Bonzini
2022-04-28  6:53 ` [PULL 04/18] i386: pcmpestr 64-bit sign extension bug Paolo Bonzini
2022-04-28  6:53 ` [PULL 05/18] meson: show final set of compiler flags Paolo Bonzini
2022-04-28  6:53 ` [PULL 06/18] configure: remove dead code Paolo Bonzini
2022-04-28  6:53 ` [PULL 07/18] qga: wixl: get path to sysroot from pkg-config as intended Paolo Bonzini
2022-04-28  6:53 ` [PULL 08/18] configure: pc-bios/qemu-icon.bmp does not exist Paolo Bonzini
2022-04-28  6:53 ` [PULL 09/18] configure: gcov should not exclude fortify-source Paolo Bonzini
2022-04-28  6:53 ` [PULL 10/18] configure: move --enable/--disable-debug-info to second option parsing pass Paolo Bonzini
2022-04-28  6:53 ` [PULL 11/18] configure, meson: move OpenGL check to meson Paolo Bonzini
2022-04-28  6:53 ` [PULL 12/18] meson, configure: move RDMA options " Paolo Bonzini
2022-04-28  6:53 ` [PULL 13/18] meson, configure: move keyctl test " Paolo Bonzini
2022-04-28  6:53 ` [PULL 14/18] meson, configure: move usbfs " Paolo Bonzini
2022-04-28  6:53 ` [PULL 15/18] meson, configure: move libgio " Paolo Bonzini
2022-04-28  6:53 ` [PULL 16/18] meson: remove CONFIG_XEN_PCI_PASSTHROUGH from config-target.h Paolo Bonzini
2022-04-28  6:53 ` [PULL 17/18] meson, configure: move --enable-module-upgrades to meson Paolo Bonzini
2022-04-28  6:53 ` [PULL 18/18] qemu-options: Limit the -enable-kvm option to the targets that support it Paolo Bonzini
2022-04-28 15:33 ` [PULL 00/18] Misc QEMU patches for 2022-04-28 Richard Henderson

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.