All of lore.kernel.org
 help / color / mirror / Atom feed
* [PULL 00/31] Misc patches for 2020-01-21
@ 2021-01-23 14:30 Paolo Bonzini
  2021-01-23 14:30 ` [PULL 01/31] runstate: cleanup reboot and panic actions Paolo Bonzini
                   ` (32 more replies)
  0 siblings, 33 replies; 53+ messages in thread
From: Paolo Bonzini @ 2021-01-23 14:30 UTC (permalink / raw)
  To: qemu-devel

The following changes since commit fef80ea073c4862bc9eaddb6ddb0ed970b8ad7c4:

  Merge remote-tracking branch 'remotes/ericb/tags/pull-nbd-2021-01-20' into staging (2021-01-21 10:44:28 +0000)

are available in the Git repository at:

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

for you to fetch changes up to fc70d67e73e9cba950cf9d16281a78eb4ab6e4ce:

  qemu-option: warn for short-form boolean options (2021-01-23 09:29:42 -0500)

----------------------------------------------------------------
* Make MinGW respect --bindir (Joshua)
* Switch MinGW to a "deep" installation (Joshua + NSIS fixes by myself)
* Fix compilation errors/warnings (Qixin, Philippe)
* Switch slirp to a subproject (Marc-André)
* QemuOpts cleanups (myself)
* Consistency improvements for -action (myself)
* remove deprecated "change vnc TARGET" functionality (myself)
* meson cleanups (Philippe, myself)
* IDE out-of-bounds access (Prasad)
* LA57 fix for -cpu max (Weijiang)

----------------------------------------------------------------
Gan Qixin (1):
      util/cacheflush: Fix error generated by clang

Joshua Watt (1):
      configure: MinGW respect --bindir argument

Marc-André Lureau (4):
      build-sys: remove unused LIBS
      build-sys: set global arguments for cflags/ldflags
      build-sys: add libvhost-user missing dependencies
      slirp: update to git master

Paolo Bonzini (11):
      runstate: cleanup reboot and panic actions
      build-system: clean up TCG/TCI configury
      nsis: adjust for new MinGW paths
      meson: convert wixl detection to Meson
      acceptance: switch to QMP change-vnc-password command
      hmp: remove "change vnc TARGET" command
      qmp: remove deprecated "change" command
      vnc: support "-vnc help"
      qemu-option: clean up id vs. list->merge_lists
      qemu-option: move help handling to get_opt_name_value
      qemu-option: warn for short-form boolean options

Philippe Mathieu-Daudé (12):
      softmmu/physmem: Silence GCC 10 maybe-uninitialized error
      meson: Declare have_virtfs_proxy_helper in main meson.build
      meson: Summarize information related to directories first
      meson: Display host binaries information altogether
      meson: Summarize overall features altogether
      meson: Summarize compilation-related information altogether
      meson: Display accelerators and selected targets altogether
      meson: Display block layer information altogether
      meson: Display crypto-related information altogether
      meson: Add a section header for library dependencies
      meson.build: Declare global edk2_targets / install_edk2_blobs variables
      meson.build: Detect bzip2 program

Prasad J Pandit (1):
      ide: atapi: check logical block address and read size (CVE-2020-29443)

Yang Weijiang (1):
      x86/cpu: Use max host physical address if -cpu max option is applied

 .gitmodules                           |   6 +-
 Makefile                              |   2 -
 configure                             | 146 +++---------
 disas/meson.build                     |   2 -
 docs/system/deprecated.rst            |  11 +-
 docs/system/removed-features.rst      |  11 +
 fsdev/meson.build                     |   1 -
 hmp-commands.hx                       |   6 -
 hw/ide/atapi.c                        |  30 ++-
 include/ui/console.h                  |   2 +-
 meson.build                           | 408 +++++++++++++++++-----------------
 meson_options.txt                     |   4 +
 monitor/hmp-cmds.c                    |   7 +-
 monitor/qmp-cmds.c                    |  51 -----
 pc-bios/descriptors/meson.build       |  30 +--
 pc-bios/meson.build                   |   6 +-
 qapi/misc.json                        |  49 ----
 qapi/run-state.json                   |  10 +-
 qemu-options.hx                       |   8 +-
 qemu.nsi                              |  42 +---
 qga/meson.build                       |  55 +++--
 slirp                                 |   1 -
 softmmu/physmem.c                     |   2 +-
 softmmu/runstate-action.c             |   4 +-
 softmmu/runstate.c                    |   7 +-
 softmmu/vl.c                          |   8 +-
 subprojects/libslirp                  |   1 +
 subprojects/libvhost-user/meson.build |   3 +
 target/i386/cpu.c                     |   1 +
 tests/acceptance/vnc.py               |  18 +-
 tests/test-qemu-opts.c                |   2 +-
 ui/vnc-stubs.c                        |   7 +-
 ui/vnc.c                              |   8 +-
 util/cacheflush.c                     |   8 +-
 util/qemu-option.c                    |  86 ++++---
 35 files changed, 442 insertions(+), 601 deletions(-)
 delete mode 160000 slirp
 create mode 160000 subprojects/libslirp
-- 
2.26.2



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

* [PULL 01/31] runstate: cleanup reboot and panic actions
  2021-01-23 14:30 [PULL 00/31] Misc patches for 2020-01-21 Paolo Bonzini
@ 2021-01-23 14:30 ` Paolo Bonzini
  2021-01-23 14:30 ` [PULL 02/31] configure: MinGW respect --bindir argument Paolo Bonzini
                   ` (31 subsequent siblings)
  32 siblings, 0 replies; 53+ messages in thread
From: Paolo Bonzini @ 2021-01-23 14:30 UTC (permalink / raw)
  To: qemu-devel

The possible choices for panic, reset and watchdog actions are inconsistent.

"-action panic=poweroff" should be renamed to "-action panic=shutdown"
on the command line.  This is because "-action panic=poweroff" and
"-action watchdog=poweroff" have slightly different semantics, the first
does an unorderly exit while the second goes through qemu_cleanup().  With
this change, -no-shutdown would not have to change "-action panic=pause"
"pause", just like it does not have to change the reset action.

"-action reboot=none" should be renamed to "-action reboot=reset".
This should be self explanatory, since for example "-action panic=none"
lets the guest proceed without taking any action.

Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 qapi/run-state.json       | 10 ++++++----
 qemu-options.hx           |  8 ++++----
 softmmu/runstate-action.c |  4 ++--
 softmmu/runstate.c        |  7 ++++---
 softmmu/vl.c              |  2 +-
 5 files changed, 17 insertions(+), 14 deletions(-)

diff --git a/qapi/run-state.json b/qapi/run-state.json
index 1f3b329f05..43d66d700f 100644
--- a/qapi/run-state.json
+++ b/qapi/run-state.json
@@ -330,14 +330,14 @@
 #
 # Possible QEMU actions upon guest reboot
 #
-# @none: Reset the VM
+# @reset: Reset the VM
 #
-# @shutdown: Shutdown the VM and exit
+# @shutdown: Shutdown the VM and exit, according to the shutdown action
 #
 # Since: 6.0
 ##
 { 'enum': 'RebootAction',
-  'data': [ 'none', 'shutdown' ] }
+  'data': [ 'reset', 'shutdown' ] }
 
 ##
 # @ShutdownAction:
@@ -360,10 +360,12 @@
 #
 # @pause: Pause the VM
 #
+# @shutdown: Shutdown the VM and exit, according to the shutdown action
+#
 # Since: 6.0
 ##
 { 'enum': 'PanicAction',
-  'data': [ 'poweroff', 'pause', 'none' ] }
+  'data': [ 'pause', 'shutdown', 'none' ] }
 
 ##
 # @watchdog-set-action:
diff --git a/qemu-options.hx b/qemu-options.hx
index 62791f56d8..9172d51659 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -3900,12 +3900,12 @@ SRST
 ERST
 
 DEF("action", HAS_ARG, QEMU_OPTION_action,
-    "-action reboot=none|shutdown\n"
-    "                   action when guest reboots [default=none]\n"
+    "-action reboot=reset|shutdown\n"
+    "                   action when guest reboots [default=reset]\n"
     "-action shutdown=poweroff|pause\n"
     "                   action when guest shuts down [default=poweroff]\n"
-    "-action panic=poweroff|pause|none\n"
-    "                   action when guest panics [default=poweroff]\n"
+    "-action panic=pause|shutdown|none\n"
+    "                   action when guest panics [default=shutdown]\n"
     "-action watchdog=reset|shutdown|poweroff|inject-nmi|pause|debug|none\n"
     "                   action when watchdog fires [default=reset]\n",
     QEMU_ARCH_ALL)
diff --git a/softmmu/runstate-action.c b/softmmu/runstate-action.c
index 99ce880886..ae0761a9c3 100644
--- a/softmmu/runstate-action.c
+++ b/softmmu/runstate-action.c
@@ -13,9 +13,9 @@
 #include "qapi/error.h"
 #include "qemu/option_int.h"
 
-RebootAction reboot_action = REBOOT_ACTION_NONE;
+RebootAction reboot_action = REBOOT_ACTION_RESET;
 ShutdownAction shutdown_action = SHUTDOWN_ACTION_POWEROFF;
-PanicAction panic_action = PANIC_ACTION_POWEROFF;
+PanicAction panic_action = PANIC_ACTION_SHUTDOWN;
 
 /*
  * Receives actions to be applied for specific guest events
diff --git a/softmmu/runstate.c b/softmmu/runstate.c
index 6177693a30..beee050815 100644
--- a/softmmu/runstate.c
+++ b/softmmu/runstate.c
@@ -471,14 +471,15 @@ void qemu_system_guest_panicked(GuestPanicInformation *info)
     }
     /*
      * TODO:  Currently the available panic actions are: none, pause, and
-     * poweroff, but in principle debug and reset could be supported as well.
+     * shutdown, but in principle debug and reset could be supported as well.
      * Investigate any potential use cases for the unimplemented actions.
      */
-    if (panic_action == PANIC_ACTION_PAUSE) {
+    if (panic_action == PANIC_ACTION_PAUSE
+        || (panic_action == PANIC_ACTION_SHUTDOWN && shutdown_action == SHUTDOWN_ACTION_PAUSE)) {
         qapi_event_send_guest_panicked(GUEST_PANIC_ACTION_PAUSE,
                                         !!info, info);
         vm_stop(RUN_STATE_GUEST_PANICKED);
-    } else if (panic_action == PANIC_ACTION_POWEROFF) {
+    } else if (panic_action == PANIC_ACTION_SHUTDOWN) {
         qapi_event_send_guest_panicked(GUEST_PANIC_ACTION_POWEROFF,
                                        !!info, info);
         vm_stop(RUN_STATE_GUEST_PANICKED);
diff --git a/softmmu/vl.c b/softmmu/vl.c
index 7ddf405d76..59304261cf 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -3202,7 +3202,7 @@ void qemu_init(int argc, char **argv, char **envp)
                 break;
             case QEMU_OPTION_no_shutdown:
                 olist = qemu_find_opts("action");
-                qemu_opts_parse_noisily(olist, "panic=pause,shutdown=pause", false);
+                qemu_opts_parse_noisily(olist, "shutdown=pause", false);
                 break;
             case QEMU_OPTION_uuid:
                 if (qemu_uuid_parse(optarg, &qemu_uuid) < 0) {
-- 
2.26.2




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

* [PULL 02/31] configure: MinGW respect --bindir argument
  2021-01-23 14:30 [PULL 00/31] Misc patches for 2020-01-21 Paolo Bonzini
  2021-01-23 14:30 ` [PULL 01/31] runstate: cleanup reboot and panic actions Paolo Bonzini
@ 2021-01-23 14:30 ` Paolo Bonzini
  2021-01-23 14:31 ` [PULL 03/31] x86/cpu: Use max host physical address if -cpu max option is applied Paolo Bonzini
                   ` (30 subsequent siblings)
  32 siblings, 0 replies; 53+ messages in thread
From: Paolo Bonzini @ 2021-01-23 14:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: Joshua Watt

From: Joshua Watt <jpewhacker@gmail.com>

There are two cases that need to be accounted for when compiling QEMU
for MinGW32:
 1) A standalone distribution, where QEMU is self contained and
    extracted by the user, such as a user would download from the QEMU
    website. In this case, all the QEMU executable files should be
    rooted in $prefix to ensure they can be easily found by the user
 2) QEMU integrated into a distribution image/sysroot/SDK and
    distributed with other programs. In this case, the provided
    arguments for bindir/datadir/etc. should be respected as they for a
    Linux build.

Restructures the MinGW path configuration so that all of the paths
except bindir use the same rules as when building for other platforms.
This satisfies #2 and #1 since these files do not need to be directly in
$prefix anyway.

The handling for --bindir is changed so that it defaults to $prefix on
MinGW (maintaining the compatibility with #1), but if the user specifies
a specific path when configuring it can also satisfy #2.

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Message-Id: <20210112210239.28836-1-JPEWhacker@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 configure | 17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)

diff --git a/configure b/configure
index 6f6a319c2f..f16fa99060 100755
--- a/configure
+++ b/configure
@@ -1571,20 +1571,15 @@ libexecdir="${libexecdir:-$prefix/libexec}"
 includedir="${includedir:-$prefix/include}"
 
 if test "$mingw32" = "yes" ; then
-    mandir="$prefix"
-    datadir="$prefix"
-    docdir="$prefix"
-    bindir="$prefix"
-    sysconfdir="$prefix"
-    local_statedir="$prefix"
+    bindir="${bindir:-$prefix}"
 else
-    mandir="${mandir:-$prefix/share/man}"
-    datadir="${datadir:-$prefix/share}"
-    docdir="${docdir:-$prefix/share/doc}"
     bindir="${bindir:-$prefix/bin}"
-    sysconfdir="${sysconfdir:-$prefix/etc}"
-    local_statedir="${local_statedir:-$prefix/var}"
 fi
+mandir="${mandir:-$prefix/share/man}"
+datadir="${datadir:-$prefix/share}"
+docdir="${docdir:-$prefix/share/doc}"
+sysconfdir="${sysconfdir:-$prefix/etc}"
+local_statedir="${local_statedir:-$prefix/var}"
 firmwarepath="${firmwarepath:-$datadir/qemu-firmware}"
 localedir="${localedir:-$datadir/locale}"
 
-- 
2.26.2




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

* [PULL 03/31] x86/cpu: Use max host physical address if -cpu max option is applied
  2021-01-23 14:30 [PULL 00/31] Misc patches for 2020-01-21 Paolo Bonzini
  2021-01-23 14:30 ` [PULL 01/31] runstate: cleanup reboot and panic actions Paolo Bonzini
  2021-01-23 14:30 ` [PULL 02/31] configure: MinGW respect --bindir argument Paolo Bonzini
@ 2021-01-23 14:31 ` Paolo Bonzini
  2021-01-23 14:31 ` [PULL 04/31] build-system: clean up TCG/TCI configury Paolo Bonzini
                   ` (29 subsequent siblings)
  32 siblings, 0 replies; 53+ messages in thread
From: Paolo Bonzini @ 2021-01-23 14:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Yang Weijiang

From: Yang Weijiang <weijiang.yang@intel.com>

QEMU option -cpu max(max_features) means "Enables all features supported by
the accelerator in the current host", this looks true for all the features
except guest max physical address width, so add this patch to enable it.

Signed-off-by: Yang Weijiang <weijiang.yang@intel.com>
Message-Id: <20210113090430.26394-1-weijiang.yang@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 target/i386/cpu.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 35459a38bb..72a79e6019 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -4319,6 +4319,7 @@ static void max_x86_cpu_initfn(Object *obj)
         if (lmce_supported()) {
             object_property_set_bool(OBJECT(cpu), "lmce", true, &error_abort);
         }
+        object_property_set_bool(OBJECT(cpu), "host-phys-bits", true, &error_abort);
     } else {
         object_property_set_str(OBJECT(cpu), "vendor", CPUID_VENDOR_AMD,
                                 &error_abort);
-- 
2.26.2




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

* [PULL 04/31] build-system: clean up TCG/TCI configury
  2021-01-23 14:30 [PULL 00/31] Misc patches for 2020-01-21 Paolo Bonzini
                   ` (2 preceding siblings ...)
  2021-01-23 14:31 ` [PULL 03/31] x86/cpu: Use max host physical address if -cpu max option is applied Paolo Bonzini
@ 2021-01-23 14:31 ` Paolo Bonzini
  2021-02-06 18:01   ` Philippe Mathieu-Daudé
  2021-01-23 14:31 ` [PULL 05/31] util/cacheflush: Fix error generated by clang Paolo Bonzini
                   ` (28 subsequent siblings)
  32 siblings, 1 reply; 53+ messages in thread
From: Paolo Bonzini @ 2021-01-23 14:31 UTC (permalink / raw)
  To: qemu-devel

Make CONFIG_TCG_INTERPRETER a Meson option, and enable TCI (though with
a warning) if the host CPU is unsupported, making it more similar to
other --enable-* options.

Remove TCG-specific include paths from !CONFIG_TCG builds.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 configure         | 11 +++--------
 disas/meson.build |  2 --
 meson.build       | 46 +++++++++++++++++++++++++---------------------
 meson_options.txt |  2 ++
 4 files changed, 30 insertions(+), 31 deletions(-)

diff --git a/configure b/configure
index f16fa99060..a84df7c4ad 100755
--- a/configure
+++ b/configure
@@ -359,7 +359,7 @@ sanitizers="no"
 tsan="no"
 fortify_source="$default_feature"
 strip_opt="yes"
-tcg_interpreter="no"
+tcg_interpreter="false"
 bigendian="no"
 mingw32="no"
 gcov="no"
@@ -1119,9 +1119,9 @@ for opt do
   ;;
   --enable-whpx) whpx="enabled"
   ;;
-  --disable-tcg-interpreter) tcg_interpreter="no"
+  --disable-tcg-interpreter) tcg_interpreter="true"
   ;;
-  --enable-tcg-interpreter) tcg_interpreter="yes"
+  --enable-tcg-interpreter) tcg_interpreter="false"
   ;;
   --disable-cap-ng)  cap_ng="disabled"
   ;;
@@ -5834,11 +5834,6 @@ fi
 if test "$optreset" = "yes" ; then
   echo "HAVE_OPTRESET=y" >> $config_host_mak
 fi
-if test "$tcg" = "enabled"; then
-  if test "$tcg_interpreter" = "yes" ; then
-    echo "CONFIG_TCG_INTERPRETER=y" >> $config_host_mak
-  fi
-fi
 if test "$fdatasync" = "yes" ; then
   echo "CONFIG_FDATASYNC=y" >> $config_host_mak
 fi
diff --git a/disas/meson.build b/disas/meson.build
index 09a852742e..da341a511e 100644
--- a/disas/meson.build
+++ b/disas/meson.build
@@ -22,5 +22,3 @@ common_ss.add(when: 'CONFIG_SH4_DIS', if_true: files('sh4.c'))
 common_ss.add(when: 'CONFIG_SPARC_DIS', if_true: files('sparc.c'))
 common_ss.add(when: 'CONFIG_XTENSA_DIS', if_true: files('xtensa.c'))
 common_ss.add(when: capstone, if_true: files('capstone.c'))
-
-specific_ss.add(when: 'CONFIG_TCG_INTERPRETER', if_true: files('tci.c'))
diff --git a/meson.build b/meson.build
index af2bc89741..2001e941f4 100644
--- a/meson.build
+++ b/meson.build
@@ -113,25 +113,8 @@ if targetos == 'linux'
                         language: ['c', 'cpp'])
 endif
 
-if 'CONFIG_TCG_INTERPRETER' in config_host
-  tcg_arch = 'tci'
-elif config_host['ARCH'] == 'sparc64'
-  tcg_arch = 'sparc'
-elif config_host['ARCH'] == 's390x'
-  tcg_arch = 's390'
-elif config_host['ARCH'] in ['x86_64', 'x32']
-  tcg_arch = 'i386'
-elif config_host['ARCH'] == 'ppc64'
-  tcg_arch = 'ppc'
-elif config_host['ARCH'] in ['riscv32', 'riscv64']
-  tcg_arch = 'riscv'
-else
-  tcg_arch = config_host['ARCH']
-endif
-add_project_arguments('-iquote', meson.current_source_dir() / 'tcg' / tcg_arch,
-                      '-iquote', '.',
+add_project_arguments('-iquote', '.',
                       '-iquote', meson.current_source_dir(),
-                      '-iquote', meson.current_source_dir() / 'accel/tcg',
                       '-iquote', meson.current_source_dir() / 'include',
                       '-iquote', meson.current_source_dir() / 'disas/libvixl',
                       language: ['c', 'cpp', 'objc'])
@@ -226,14 +209,33 @@ if not get_option('hax').disabled()
     accelerators += 'CONFIG_HAX'
   endif
 endif
+
+tcg_arch = config_host['ARCH']
 if not get_option('tcg').disabled()
   if cpu not in supported_cpus
-    if 'CONFIG_TCG_INTERPRETER' in config_host
+    if get_option('tcg_interpreter')
       warning('Unsupported CPU @0@, will use TCG with TCI (experimental)'.format(cpu))
     else
       error('Unsupported CPU @0@, try --enable-tcg-interpreter'.format(cpu))
     endif
   endif
+  if get_option('tcg_interpreter')
+    tcg_arch = 'tci'
+  elif config_host['ARCH'] == 'sparc64'
+    tcg_arch = 'sparc'
+  elif config_host['ARCH'] == 's390x'
+    tcg_arch = 's390'
+  elif config_host['ARCH'] in ['x86_64', 'x32']
+    tcg_arch = 'i386'
+  elif config_host['ARCH'] == 'ppc64'
+    tcg_arch = 'ppc'
+  elif config_host['ARCH'] in ['riscv32', 'riscv64']
+    tcg_arch = 'riscv'
+  endif
+  add_project_arguments('-iquote', meson.current_source_dir() / 'tcg' / tcg_arch,
+                        '-iquote', meson.current_source_dir() / 'accel/tcg',
+                        language: ['c', 'cpp', 'objc'])
+
   accelerators += 'CONFIG_TCG'
   config_host += { 'CONFIG_TCG': 'y' }
 endif
@@ -1234,7 +1236,9 @@ foreach target : target_dirs
     if sym == 'CONFIG_TCG' or target in accelerator_targets.get(sym, [])
       config_target += { sym: 'y' }
       config_all += { sym: 'y' }
-      if sym == 'CONFIG_XEN' and have_xen_pci_passthrough
+      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
       accel_kconfig += [ sym + '=y' ]
@@ -2411,7 +2415,7 @@ summary_info += {'WHPX support':      config_all.has_key('CONFIG_WHPX')}
 summary_info += {'TCG support':       config_all.has_key('CONFIG_TCG')}
 if config_all.has_key('CONFIG_TCG')
   summary_info += {'TCG debug enabled': config_host.has_key('CONFIG_DEBUG_TCG')}
-  summary_info += {'TCG interpreter':   config_host.has_key('CONFIG_TCG_INTERPRETER')}
+  summary_info += {'TCG interpreter':   tcg_arch == 'tci'}
 endif
 summary_info += {'malloc trim support': has_malloc_trim}
 summary_info += {'RDMA support':      config_host.has_key('CONFIG_RDMA')}
diff --git a/meson_options.txt b/meson_options.txt
index 72a3ca22d6..7dcd81c06a 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -37,6 +37,8 @@ option('xen_pci_passthrough', type: 'feature', value: 'auto',
        description: 'Xen PCI passthrough support')
 option('tcg', type: 'feature', value: 'auto',
        description: 'TCG support')
+option('tcg_interpreter', type: 'boolean', value: false,
+       description: 'TCG bytecode interpreter (TCI)')
 option('cfi', type: 'boolean', value: 'false',
        description: 'Control-Flow Integrity (CFI)')
 option('cfi_debug', type: 'boolean', value: 'false',
-- 
2.26.2




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

* [PULL 05/31] util/cacheflush: Fix error generated by clang
  2021-01-23 14:30 [PULL 00/31] Misc patches for 2020-01-21 Paolo Bonzini
                   ` (3 preceding siblings ...)
  2021-01-23 14:31 ` [PULL 04/31] build-system: clean up TCG/TCI configury Paolo Bonzini
@ 2021-01-23 14:31 ` Paolo Bonzini
  2021-01-23 14:31 ` [PULL 06/31] softmmu/physmem: Silence GCC 10 maybe-uninitialized error Paolo Bonzini
                   ` (27 subsequent siblings)
  32 siblings, 0 replies; 53+ messages in thread
From: Paolo Bonzini @ 2021-01-23 14:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Richard Henderson, Gan Qixin, Euler Robot

From: Gan Qixin <ganqixin@huawei.com>

When compiling qemu-fuzz-i386 on aarch64 host, clang reported the following
error:

../util/cacheflush.c:38:44: error: value size does not match register size
specified by the constraint and modifier [-Werror,-Wasm-operand-widths]
    asm volatile("mrs\t%0, ctr_el0" : "=r"(save_ctr_el0));
                                           ^
../util/cacheflush.c:38:24: note: use constraint modifier "w"
    asm volatile("mrs\t%0, ctr_el0" : "=r"(save_ctr_el0));
                       ^~
                       %w0

Modify the type of save_ctr_el0 to uint64_t to fix it.

Reported-by: Euler Robot <euler.robot@huawei.com>
Signed-off-by: Gan Qixin <ganqixin@huawei.com>
Message-Id: <20210115075656.717957-1-ganqixin@huawei.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
---
 util/cacheflush.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/util/cacheflush.c b/util/cacheflush.c
index 6a20723902..933355b0c9 100644
--- a/util/cacheflush.c
+++ b/util/cacheflush.c
@@ -32,7 +32,7 @@ void flush_idcache_range(uintptr_t rx, uintptr_t rw, size_t len)
  * We want to save the whole contents of CTR_EL0, so that we
  * have more than the linesize, but also IDC and DIC.
  */
-static unsigned int save_ctr_el0;
+static uint64_t save_ctr_el0;
 static void __attribute__((constructor)) init_ctr_el0(void)
 {
     asm volatile("mrs\t%0, ctr_el0" : "=r"(save_ctr_el0));
@@ -46,9 +46,9 @@ void flush_idcache_range(uintptr_t rx, uintptr_t rw, size_t len)
 {
     const unsigned CTR_IDC = 1u << 28;
     const unsigned CTR_DIC = 1u << 29;
-    const unsigned int ctr_el0 = save_ctr_el0;
-    const uintptr_t icache_lsize = 4 << extract32(ctr_el0, 0, 4);
-    const uintptr_t dcache_lsize = 4 << extract32(ctr_el0, 16, 4);
+    const uint64_t ctr_el0 = save_ctr_el0;
+    const uintptr_t icache_lsize = 4 << extract64(ctr_el0, 0, 4);
+    const uintptr_t dcache_lsize = 4 << extract64(ctr_el0, 16, 4);
     uintptr_t p;
 
     /*
-- 
2.26.2




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

* [PULL 06/31] softmmu/physmem: Silence GCC 10 maybe-uninitialized error
  2021-01-23 14:30 [PULL 00/31] Misc patches for 2020-01-21 Paolo Bonzini
                   ` (4 preceding siblings ...)
  2021-01-23 14:31 ` [PULL 05/31] util/cacheflush: Fix error generated by clang Paolo Bonzini
@ 2021-01-23 14:31 ` Paolo Bonzini
  2021-01-23 14:31 ` [PULL 07/31] ide: atapi: check logical block address and read size (CVE-2020-29443) Paolo Bonzini
                   ` (26 subsequent siblings)
  32 siblings, 0 replies; 53+ messages in thread
From: Paolo Bonzini @ 2021-01-23 14:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Philippe Mathieu-Daudé

From: Philippe Mathieu-Daudé <f4bug@amsat.org>

When building with GCC 10.2 configured with --extra-cflags=-Os, we get:

  softmmu/physmem.c: In function 'address_space_translate_for_iotlb':
  softmmu/physmem.c:643:26: error: 'notifier' may be used uninitialized in this function [-Werror=maybe-uninitialized]
    643 |         notifier->active = true;
        |                          ^
  softmmu/physmem.c:608:23: note: 'notifier' was declared here
    608 |     TCGIOMMUNotifier *notifier;
        |                       ^~~~~~~~

Initialize 'notifier' to silence the warning.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20210117170411.4106949-1-f4bug@amsat.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 softmmu/physmem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/softmmu/physmem.c b/softmmu/physmem.c
index 6301f4f0a5..cdcd197656 100644
--- a/softmmu/physmem.c
+++ b/softmmu/physmem.c
@@ -605,7 +605,7 @@ static void tcg_register_iommu_notifier(CPUState *cpu,
      * when the IOMMU tells us the mappings we've cached have changed.
      */
     MemoryRegion *mr = MEMORY_REGION(iommu_mr);
-    TCGIOMMUNotifier *notifier;
+    TCGIOMMUNotifier *notifier = NULL;
     int i;
 
     for (i = 0; i < cpu->iommu_notifiers->len; i++) {
-- 
2.26.2




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

* [PULL 07/31] ide: atapi: check logical block address and read size (CVE-2020-29443)
  2021-01-23 14:30 [PULL 00/31] Misc patches for 2020-01-21 Paolo Bonzini
                   ` (5 preceding siblings ...)
  2021-01-23 14:31 ` [PULL 06/31] softmmu/physmem: Silence GCC 10 maybe-uninitialized error Paolo Bonzini
@ 2021-01-23 14:31 ` Paolo Bonzini
  2021-01-23 14:31 ` [PULL 08/31] build-sys: remove unused LIBS Paolo Bonzini
                   ` (25 subsequent siblings)
  32 siblings, 0 replies; 53+ messages in thread
From: Paolo Bonzini @ 2021-01-23 14:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Wenxiang Qian, Prasad J Pandit

From: Prasad J Pandit <pjp@fedoraproject.org>

While processing ATAPI cmd_read/cmd_read_cd commands,
Logical Block Address (LBA) maybe invalid OR closer to the last block,
leading to an OOB access issues. Add range check to avoid it.

Fixes: CVE-2020-29443
Reported-by: Wenxiang Qian <leonwxqian@gmail.com>
Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
Message-Id: <20210118115130.457044-1-ppandit@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/ide/atapi.c | 30 ++++++++++++++++++++++++------
 1 file changed, 24 insertions(+), 6 deletions(-)

diff --git a/hw/ide/atapi.c b/hw/ide/atapi.c
index e79157863f..b626199e3d 100644
--- a/hw/ide/atapi.c
+++ b/hw/ide/atapi.c
@@ -322,6 +322,8 @@ static void ide_atapi_cmd_reply(IDEState *s, int size, int max_size)
 static void ide_atapi_cmd_read_pio(IDEState *s, int lba, int nb_sectors,
                                    int sector_size)
 {
+    assert(0 <= lba && lba < (s->nb_sectors >> 2));
+
     s->lba = lba;
     s->packet_transfer_size = nb_sectors * sector_size;
     s->elementary_transfer_size = 0;
@@ -420,6 +422,8 @@ eot:
 static void ide_atapi_cmd_read_dma(IDEState *s, int lba, int nb_sectors,
                                    int sector_size)
 {
+    assert(0 <= lba && lba < (s->nb_sectors >> 2));
+
     s->lba = lba;
     s->packet_transfer_size = nb_sectors * sector_size;
     s->io_buffer_size = 0;
@@ -973,35 +977,49 @@ static void cmd_prevent_allow_medium_removal(IDEState *s, uint8_t* buf)
 
 static void cmd_read(IDEState *s, uint8_t* buf)
 {
-    int nb_sectors, lba;
+    unsigned int nb_sectors, lba;
+
+    /* Total logical sectors of ATAPI_SECTOR_SIZE(=2048) bytes */
+    uint64_t total_sectors = s->nb_sectors >> 2;
 
     if (buf[0] == GPCMD_READ_10) {
         nb_sectors = lduw_be_p(buf + 7);
     } else {
         nb_sectors = ldl_be_p(buf + 6);
     }
-
-    lba = ldl_be_p(buf + 2);
     if (nb_sectors == 0) {
         ide_atapi_cmd_ok(s);
         return;
     }
 
+    lba = ldl_be_p(buf + 2);
+    if (lba >= total_sectors || lba + nb_sectors - 1 >= total_sectors) {
+        ide_atapi_cmd_error(s, ILLEGAL_REQUEST, ASC_LOGICAL_BLOCK_OOR);
+        return;
+    }
+
     ide_atapi_cmd_read(s, lba, nb_sectors, 2048);
 }
 
 static void cmd_read_cd(IDEState *s, uint8_t* buf)
 {
-    int nb_sectors, lba, transfer_request;
+    unsigned int nb_sectors, lba, transfer_request;
 
-    nb_sectors = (buf[6] << 16) | (buf[7] << 8) | buf[8];
-    lba = ldl_be_p(buf + 2);
+    /* Total logical sectors of ATAPI_SECTOR_SIZE(=2048) bytes */
+    uint64_t total_sectors = s->nb_sectors >> 2;
 
+    nb_sectors = (buf[6] << 16) | (buf[7] << 8) | buf[8];
     if (nb_sectors == 0) {
         ide_atapi_cmd_ok(s);
         return;
     }
 
+    lba = ldl_be_p(buf + 2);
+    if (lba >= total_sectors || lba + nb_sectors - 1 >= total_sectors) {
+        ide_atapi_cmd_error(s, ILLEGAL_REQUEST, ASC_LOGICAL_BLOCK_OOR);
+        return;
+    }
+
     transfer_request = buf[9] & 0xf8;
     if (transfer_request == 0x00) {
         /* nothing */
-- 
2.26.2




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

* [PULL 08/31] build-sys: remove unused LIBS
  2021-01-23 14:30 [PULL 00/31] Misc patches for 2020-01-21 Paolo Bonzini
                   ` (6 preceding siblings ...)
  2021-01-23 14:31 ` [PULL 07/31] ide: atapi: check logical block address and read size (CVE-2020-29443) Paolo Bonzini
@ 2021-01-23 14:31 ` Paolo Bonzini
  2021-01-23 14:31 ` [PULL 09/31] build-sys: set global arguments for cflags/ldflags Paolo Bonzini
                   ` (24 subsequent siblings)
  32 siblings, 0 replies; 53+ messages in thread
From: Paolo Bonzini @ 2021-01-23 14:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Marc-André Lureau

From: Marc-André Lureau <marcandre.lureau@redhat.com>

Since meson switch and commit feabc71dfa58 ("configure: do not include
dependency flags in QEMU_CFLAGS and LIBS"), LIBS is unused.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210114125605.1227742-2-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 configure | 32 --------------------------------
 1 file changed, 32 deletions(-)

diff --git a/configure b/configure
index a84df7c4ad..ff099cb8ca 100755
--- a/configure
+++ b/configure
@@ -3385,16 +3385,6 @@ else
   for pthread_lib in $PTHREADLIBS_LIST; do
     if compile_prog "" "$pthread_lib" ; then
       pthread=yes
-      found=no
-      for lib_entry in $LIBS; do
-        if test "$lib_entry" = "$pthread_lib"; then
-          found=yes
-          break
-        fi
-      done
-      if test "$found" = "no"; then
-        LIBS="$pthread_lib $LIBS"
-      fi
       break
     fi
   done
@@ -4083,28 +4073,6 @@ if compile_prog "" "" ; then
   bswap_h=yes
 fi
 
-##########################################
-# Do we need librt
-# uClibc provides 2 versions of clock_gettime(), one with realtime
-# support and one without. This means that the clock_gettime() don't
-# need -lrt. We still need it for timer_create() so we check for this
-# function in addition.
-cat > $TMPC <<EOF
-#include <signal.h>
-#include <time.h>
-int main(void) {
-  timer_create(CLOCK_REALTIME, NULL, NULL);
-  return clock_gettime(CLOCK_REALTIME, NULL);
-}
-EOF
-
-if compile_prog "" "" ; then
-  :
-# we need pthread for static linking. use previous pthread test result
-elif compile_prog "" "$pthread_lib -lrt" ; then
-  LIBS="$LIBS -lrt"
-fi
-
 # Check whether we have openpty() in either libc or libutil
 cat > $TMPC << EOF
 extern int openpty(int *am, int *as, char *name, void *termp, void *winp);
-- 
2.26.2




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

* [PULL 09/31] build-sys: set global arguments for cflags/ldflags
  2021-01-23 14:30 [PULL 00/31] Misc patches for 2020-01-21 Paolo Bonzini
                   ` (7 preceding siblings ...)
  2021-01-23 14:31 ` [PULL 08/31] build-sys: remove unused LIBS Paolo Bonzini
@ 2021-01-23 14:31 ` Paolo Bonzini
  2021-01-23 14:31 ` [PULL 10/31] build-sys: add libvhost-user missing dependencies Paolo Bonzini
                   ` (23 subsequent siblings)
  32 siblings, 0 replies; 53+ messages in thread
From: Paolo Bonzini @ 2021-01-23 14:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Marc-André Lureau

From: Marc-André Lureau <marcandre.lureau@redhat.com>

As we want subprojects to share those arguments

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

diff --git a/meson.build b/meson.build
index 2001e941f4..e813814fb0 100644
--- a/meson.build
+++ b/meson.build
@@ -100,12 +100,12 @@ if 'CONFIG_FUZZ' in config_host
                               native: false, language: ['c', 'cpp', 'objc'])
 endif
 
-add_project_arguments(config_host['QEMU_CFLAGS'].split(),
-                      native: false, language: ['c', 'objc'])
-add_project_arguments(config_host['QEMU_CXXFLAGS'].split(),
-                      native: false, language: 'cpp')
-add_project_link_arguments(config_host['QEMU_LDFLAGS'].split(),
-                           native: false, language: ['c', 'cpp', 'objc'])
+add_global_arguments(config_host['QEMU_CFLAGS'].split(),
+                     native: false, language: ['c', 'objc'])
+add_global_arguments(config_host['QEMU_CXXFLAGS'].split(),
+                     native: false, language: 'cpp')
+add_global_link_arguments(config_host['QEMU_LDFLAGS'].split(),
+                          native: false, language: ['c', 'cpp', 'objc'])
 
 if targetos == 'linux'
   add_project_arguments('-isystem', meson.current_source_dir() / 'linux-headers',
@@ -1021,8 +1021,8 @@ if get_option('cfi')
       error('-fno-sanitize-trap=cfi-icall is not supported by the compiler')
     endif
   endif
-  add_project_arguments(cfi_flags, native: false, language: ['c', 'cpp', 'objc'])
-  add_project_link_arguments(cfi_flags, native: false, language: ['c', 'cpp', 'objc'])
+  add_global_arguments(cfi_flags, native: false, language: ['c', 'cpp', 'objc'])
+  add_global_link_arguments(cfi_flags, native: false, language: ['c', 'cpp', 'objc'])
 endif
 
 #################
-- 
2.26.2




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

* [PULL 10/31] build-sys: add libvhost-user missing dependencies
  2021-01-23 14:30 [PULL 00/31] Misc patches for 2020-01-21 Paolo Bonzini
                   ` (8 preceding siblings ...)
  2021-01-23 14:31 ` [PULL 09/31] build-sys: set global arguments for cflags/ldflags Paolo Bonzini
@ 2021-01-23 14:31 ` Paolo Bonzini
  2021-01-23 14:31 ` [PULL 11/31] slirp: update to git master Paolo Bonzini
                   ` (22 subsequent siblings)
  32 siblings, 0 replies; 53+ messages in thread
From: Paolo Bonzini @ 2021-01-23 14:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Marc-André Lureau, Philippe Mathieu-Daudé

From: Marc-André Lureau <marcandre.lureau@redhat.com>

This help fixing static compilation issues.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210114125605.1227742-4-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 subprojects/libvhost-user/meson.build | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/subprojects/libvhost-user/meson.build b/subprojects/libvhost-user/meson.build
index c5d85c11d7..b03446e7cd 100644
--- a/subprojects/libvhost-user/meson.build
+++ b/subprojects/libvhost-user/meson.build
@@ -2,12 +2,14 @@ project('libvhost-user', 'c',
         license: 'GPL-2.0-or-later',
         default_options: ['c_std=gnu99'])
 
+threads = dependency('threads')
 glib = dependency('glib-2.0')
 inc = include_directories('../../include', '../../linux-headers')
 
 vhost_user = static_library('vhost-user',
                             files('libvhost-user.c'),
                             include_directories: inc,
+                            dependencies: threads,
                             c_args: '-D_GNU_SOURCE')
 
 executable('link-test', files('link-test.c'),
@@ -21,4 +23,5 @@ vhost_user_glib = static_library('vhost-user-glib',
                                  dependencies: glib)
 
 vhost_user_dep = declare_dependency(link_with: vhost_user_glib,
+                                    dependencies: glib,
                                     include_directories: include_directories('.'))
-- 
2.26.2




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

* [PULL 11/31] slirp: update to git master
  2021-01-23 14:30 [PULL 00/31] Misc patches for 2020-01-21 Paolo Bonzini
                   ` (9 preceding siblings ...)
  2021-01-23 14:31 ` [PULL 10/31] build-sys: add libvhost-user missing dependencies Paolo Bonzini
@ 2021-01-23 14:31 ` Paolo Bonzini
  2021-01-23 14:31 ` [PULL 12/31] meson: Declare have_virtfs_proxy_helper in main meson.build Paolo Bonzini
                   ` (21 subsequent siblings)
  32 siblings, 0 replies; 53+ messages in thread
From: Paolo Bonzini @ 2021-01-23 14:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Marc-André Lureau

From: Marc-André Lureau <marcandre.lureau@redhat.com>

git cherry-diff:

Commits on bacb71f1c3ed5f40e393afd8be81bedfba13a401 branch that is not on 8f43a99191afb47ca3f3c6972f6306209f367ece branch
+ 1021b0dc38d39f1dc95a296fe3e05a24a087cdc6 disable_dns option
+ 0f94ceec752592e4ac632a24e3c64a97dd09bf4c limit vnameserver_addr to port 53
+ b57bafa852ef16b133907a13678ec69e9531f177 libslirp.h: fix SlirpConfig v3 documentation
+ 1abf18b2b5edb462797629ed47ad4515a195686e Update CHANGELOG
+ ff4ecf9b6c6542b24b4ac6ea178be9d44e159f79 Release v4.3.0
+ 21f1d933050a40d62612c6274c32de60b811d9ea changelog: post-release
+ 376187c4b14c795763d472214812826eebe7e9c2 Release v4.3.1
+ 73336e08902a7e826f7d960453df037380266186 changelog: post-release
+ 5c1c9d43be61571608e9b14615045b67b830daf5 udp, udp6, icmp: handle TTL value
+ 73ed49ab71998d4288e71e954ef6214b70f23d79 icmp, icmp6: Add icmp_forward_error and icmp6_forward_error
+ 7a4840a57ec7dbc37cca1ab96f058a9610b26950 udp, udp6, icmp, icmp6: Enable forwarding errors on Linux
+ e9b2bc19ae652a2907f247e621b2e4773bdd2aab TCPIPHDR_DELTA: Fix potential negative value
+ 39f9a363eec082f04513413046321abd04163148 .gitlab-ci: add a Coverity stage
+ 1b0093b973cfa0dc041522e5d4e6f576b2df642e sosendoob: better document what urgc is used for
+ 5b9ad89ebbb8afa50162c9156fabd5fc56291088 Add G_GNUC_PRINTF to local function slirp_vsnprintf
+ 8a808aa493980e212b4d5f5465330905c8294e59 meson: remove meson-dist script
+ 0b669b5fbe4d3c25a682a67f1059d8633c963b3d meson: support compiling as subproject
+ 9f82a47b81f2864422b82c1e40e51a2ed9c6ac32 Add DNS resolving for iOS
+ c0eac03e8ce1b9a743231f2fe21e7cb579fc9339 Remove the QEMU-special make build-system
+ 1bfd4d9368f9fa2e4f0731e1266bec05bbc83a80 socket: consume empty packets
+ 92413be68914f8cae2f5bad4bf3ab8491dcbc5d7 Release v4.4.0
+ 07e8cfac69766081871ab620d9f16a630543d302 changelog: post-release
+ 4c4e035813313d02b63fdeb920d56fb2fdc0a5b1 Remove some needless (void)casts

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210114125605.1227742-5-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 .gitmodules          |  6 ++---
 configure            |  2 +-
 meson.build          | 62 +++-----------------------------------------
 slirp                |  1 -
 subprojects/libslirp |  1 +
 5 files changed, 9 insertions(+), 63 deletions(-)
 delete mode 160000 slirp
 create mode 160000 subprojects/libslirp

diff --git a/.gitmodules b/.gitmodules
index 2bdeeacef8..80fd9c7199 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -49,9 +49,6 @@
 [submodule "roms/edk2"]
 	path = roms/edk2
 	url = https://git.qemu.org/git/edk2.git
-[submodule "slirp"]
-	path = slirp
-	url = https://git.qemu.org/git/libslirp.git
 [submodule "roms/opensbi"]
 	path = roms/opensbi
 	url = 	https://git.qemu.org/git/opensbi.git
@@ -64,3 +61,6 @@
 [submodule "roms/vbootrom"]
 	path = roms/vbootrom
 	url = https://git.qemu.org/git/vbootrom.git
+[submodule "subprojects/libslirp"]
+	path = subprojects/libslirp
+	url = https://git.qemu.org/git/libslirp.git
diff --git a/configure b/configure
index ff099cb8ca..753d0dd18e 100755
--- a/configure
+++ b/configure
@@ -5206,7 +5206,7 @@ case "$slirp" in
   auto | enabled | internal)
     # Simpler to always update submodule, even if not needed.
     if test -e "${source_path}/.git" && test $git_update = 'yes' ; then
-      git_submodules="${git_submodules} slirp"
+      git_submodules="${git_submodules} subprojects/libslirp"
     fi
     ;;
 esac
diff --git a/meson.build b/meson.build
index e813814fb0..deda061c86 100644
--- a/meson.build
+++ b/meson.build
@@ -1460,7 +1460,7 @@ slirp_opt = 'disabled'
 if have_system
   slirp_opt = get_option('slirp')
   if slirp_opt in ['enabled', 'auto', 'system']
-    have_internal = fs.exists(meson.current_source_dir() / 'slirp/meson.build')
+    have_internal = fs.exists(meson.current_source_dir() / 'subprojects/libslirp/meson.build')
     slirp = dependency('slirp', static: enable_static,
                        method: 'pkg-config',
                        required: slirp_opt == 'system' or
@@ -1474,63 +1474,9 @@ if have_system
     endif
   endif
   if slirp_opt == 'internal'
-    slirp_deps = []
-    if targetos == 'windows'
-      slirp_deps = cc.find_library('iphlpapi')
-    endif
-    slirp_conf = configuration_data()
-    slirp_conf.set('SLIRP_MAJOR_VERSION', meson.project_version().split('.')[0])
-    slirp_conf.set('SLIRP_MINOR_VERSION', meson.project_version().split('.')[1])
-    slirp_conf.set('SLIRP_MICRO_VERSION', meson.project_version().split('.')[2])
-    slirp_conf.set_quoted('SLIRP_VERSION_STRING', meson.project_version())
-    slirp_cargs = ['-DG_LOG_DOMAIN="Slirp"']
-    slirp_files = [
-      'slirp/src/arp_table.c',
-      'slirp/src/bootp.c',
-      'slirp/src/cksum.c',
-      'slirp/src/dhcpv6.c',
-      'slirp/src/dnssearch.c',
-      'slirp/src/if.c',
-      'slirp/src/ip6_icmp.c',
-      'slirp/src/ip6_input.c',
-      'slirp/src/ip6_output.c',
-      'slirp/src/ip_icmp.c',
-      'slirp/src/ip_input.c',
-      'slirp/src/ip_output.c',
-      'slirp/src/mbuf.c',
-      'slirp/src/misc.c',
-      'slirp/src/ncsi.c',
-      'slirp/src/ndp_table.c',
-      'slirp/src/sbuf.c',
-      'slirp/src/slirp.c',
-      'slirp/src/socket.c',
-      'slirp/src/state.c',
-      'slirp/src/stream.c',
-      'slirp/src/tcp_input.c',
-      'slirp/src/tcp_output.c',
-      'slirp/src/tcp_subr.c',
-      'slirp/src/tcp_timer.c',
-      'slirp/src/tftp.c',
-      'slirp/src/udp.c',
-      'slirp/src/udp6.c',
-      'slirp/src/util.c',
-      'slirp/src/version.c',
-      'slirp/src/vmstate.c',
-    ]
-
-    configure_file(
-      input : 'slirp/src/libslirp-version.h.in',
-      output : 'libslirp-version.h',
-      configuration: slirp_conf)
-
-    slirp_inc = include_directories('slirp', 'slirp/src')
-    libslirp = static_library('slirp',
-                              sources: slirp_files,
-                              c_args: slirp_cargs,
-                              include_directories: slirp_inc)
-    slirp = declare_dependency(link_with: libslirp,
-                               dependencies: slirp_deps,
-                               include_directories: slirp_inc)
+    libslirp = subproject('libslirp',
+                          default_options: ['default_library=static'])
+    slirp = libslirp.get_variable('libslirp_dep')
   endif
 endif
 
diff --git a/slirp b/slirp
deleted file mode 160000
index 8f43a99191..0000000000
--- a/slirp
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 8f43a99191afb47ca3f3c6972f6306209f367ece
diff --git a/subprojects/libslirp b/subprojects/libslirp
new file mode 160000
index 0000000000..bacb71f1c3
--- /dev/null
+++ b/subprojects/libslirp
@@ -0,0 +1 @@
+Subproject commit bacb71f1c3ed5f40e393afd8be81bedfba13a401
-- 
2.26.2




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

* [PULL 12/31] meson: Declare have_virtfs_proxy_helper in main meson.build
  2021-01-23 14:30 [PULL 00/31] Misc patches for 2020-01-21 Paolo Bonzini
                   ` (10 preceding siblings ...)
  2021-01-23 14:31 ` [PULL 11/31] slirp: update to git master Paolo Bonzini
@ 2021-01-23 14:31 ` Paolo Bonzini
  2021-01-23 14:31 ` [PULL 13/31] nsis: adjust for new MinGW paths Paolo Bonzini
                   ` (20 subsequent siblings)
  32 siblings, 0 replies; 53+ messages in thread
From: Paolo Bonzini @ 2021-01-23 14:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Philippe Mathieu-Daudé

From: Philippe Mathieu-Daudé <philmd@redhat.com>

have_virtfs_proxy_helper is used from docs/meson.build, and can be
not declared when including it before fsdev/meson.build. This fixes:

  ../docs/meson.build:54:2: ERROR: Unknown variable "have_virtfs_proxy_helper".

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210120151539.1166252-1-philmd@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 fsdev/meson.build | 1 -
 meson.build       | 2 ++
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/fsdev/meson.build b/fsdev/meson.build
index 65455a179e..adf57cc43e 100644
--- a/fsdev/meson.build
+++ b/fsdev/meson.build
@@ -8,7 +8,6 @@ fsdev_ss.add(when: ['CONFIG_FSDEV_9P'], if_true: files(
 ), if_false: files('qemu-fsdev-dummy.c'))
 softmmu_ss.add_all(when: 'CONFIG_LINUX', if_true: fsdev_ss)
 
-have_virtfs_proxy_helper = have_tools and libattr.found() and libcap_ng.found() and have_virtfs
 if have_virtfs_proxy_helper
   executable('virtfs-proxy-helper',
              files('virtfs-proxy-helper.c', '9p-marshal.c', '9p-iov-marshal.c'),
diff --git a/meson.build b/meson.build
index deda061c86..4a5f265bd0 100644
--- a/meson.build
+++ b/meson.build
@@ -1034,6 +1034,8 @@ have_virtfs = (targetos == 'linux' and
     libattr.found() and
     libcap_ng.found())
 
+have_virtfs_proxy_helper = have_virtfs and have_tools
+
 if get_option('virtfs').enabled()
   if not have_virtfs
     if targetos != 'linux'
-- 
2.26.2




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

* [PULL 13/31] nsis: adjust for new MinGW paths
  2021-01-23 14:30 [PULL 00/31] Misc patches for 2020-01-21 Paolo Bonzini
                   ` (11 preceding siblings ...)
  2021-01-23 14:31 ` [PULL 12/31] meson: Declare have_virtfs_proxy_helper in main meson.build Paolo Bonzini
@ 2021-01-23 14:31 ` Paolo Bonzini
  2021-01-23 14:31 ` [PULL 14/31] meson: convert wixl detection to Meson Paolo Bonzini
                   ` (19 subsequent siblings)
  32 siblings, 0 replies; 53+ messages in thread
From: Paolo Bonzini @ 2021-01-23 14:31 UTC (permalink / raw)
  To: qemu-devel

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 qemu.nsi | 42 ++++--------------------------------------
 1 file changed, 4 insertions(+), 38 deletions(-)

diff --git a/qemu.nsi b/qemu.nsi
index 1a0112265b..c3df8c9d3b 100644
--- a/qemu.nsi
+++ b/qemu.nsi
@@ -35,11 +35,6 @@
 !define OUTFILE "qemu-setup.exe"
 !endif
 
-; Optionally install documentation.
-!ifndef CONFIG_DOCUMENTATION
-!define CONFIG_DOCUMENTATION
-!endif
-
 ; Use maximum compression.
 SetCompressor /SOLID lzma
 
@@ -116,26 +111,13 @@ Section "${PRODUCT} (required)"
     ; Set output path to the installation directory.
     SetOutPath "$INSTDIR"
 
-    File "${SRCDIR}\Changelog"
     File "${SRCDIR}\COPYING"
     File "${SRCDIR}\COPYING.LIB"
     File "${SRCDIR}\README.rst"
     File "${SRCDIR}\VERSION"
 
-    File "${BINDIR}\*.bmp"
-    File "${BINDIR}\*.bin"
-    File "${BINDIR}\*.dtb"
-    File "${BINDIR}\*.fd"
-    File "${BINDIR}\*.img"
-    File "${BINDIR}\*.lid"
-    File "${BINDIR}\*.ndrv"
-    File "${BINDIR}\*.rom"
-    File "${BINDIR}\openbios-*"
-
     File /r "${BINDIR}\keymaps"
-!ifdef CONFIG_GTK
     File /r "${BINDIR}\share"
-!endif
 
 !ifdef W64
     SetRegView 64
@@ -176,21 +158,11 @@ SectionEnd
 
 !ifdef CONFIG_DOCUMENTATION
 Section "Documentation" SectionDoc
-    SetOutPath "$INSTDIR"
-    File "${BINDIR}\index.html"
-    SetOutPath "$INSTDIR\interop"
-    FILE /r "${BINDIR}\interop\*.*"
-    SetOutPath "$INSTDIR\specs"
-    FILE /r "${BINDIR}\specs\*.*"
-    SetOutPath "$INSTDIR\system"
-    FILE /r "${BINDIR}\system\*.*"
-    SetOutPath "$INSTDIR\tools"
-    FILE /r "${BINDIR}\tools\*.*"
-    SetOutPath "$INSTDIR\user"
-    FILE /r "${BINDIR}\user\*.*"
+    SetOutPath "$INSTDIR\doc"
+    File /r "${BINDIR}\doc"
     SetOutPath "$INSTDIR"
     CreateDirectory "$SMPROGRAMS\${PRODUCT}"
-    CreateShortCut "$SMPROGRAMS\${PRODUCT}\User Documentation.lnk" "$INSTDIR\index.html" "" "$INSTDIR\index.html" 0
+    CreateShortCut "$SMPROGRAMS\${PRODUCT}\User Documentation.lnk" "$INSTDIR\doc\index.html" "" "$INSTDIR\doc\index.html" 0
 SectionEnd
 !endif
 
@@ -238,13 +210,7 @@ Section "Uninstall"
     Delete "$INSTDIR\qemu-io.exe"
     Delete "$INSTDIR\qemu.exe"
     Delete "$INSTDIR\qemu-system-*.exe"
-    Delete "$INSTDIR\index.html"
-    RMDir /r "$INSTDIR\interop"
-    RMDir /r "$INSTDIR\specs"
-    RMDir /r "$INSTDIR\system"
-    RMDir /r "$INSTDIR\tools"
-    RMDir /r "$INSTDIR\user"
-    RMDir /r "$INSTDIR\keymaps"
+    RMDir /r "$INSTDIR\doc"
     RMDir /r "$INSTDIR\share"
     ; Remove generated files
     Delete "$INSTDIR\stderr.txt"
-- 
2.26.2




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

* [PULL 14/31] meson: convert wixl detection to Meson
  2021-01-23 14:30 [PULL 00/31] Misc patches for 2020-01-21 Paolo Bonzini
                   ` (12 preceding siblings ...)
  2021-01-23 14:31 ` [PULL 13/31] nsis: adjust for new MinGW paths Paolo Bonzini
@ 2021-01-23 14:31 ` Paolo Bonzini
  2021-01-23 14:31 ` [PULL 15/31] meson: Summarize information related to directories first Paolo Bonzini
                   ` (18 subsequent siblings)
  32 siblings, 0 replies; 53+ messages in thread
From: Paolo Bonzini @ 2021-01-23 14:31 UTC (permalink / raw)
  To: qemu-devel

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 Makefile          |  2 --
 configure         | 84 ++++++++++-------------------------------------
 meson.build       | 10 ++++--
 meson_options.txt |  2 ++
 qga/meson.build   | 55 +++++++++++++++++++------------
 5 files changed, 61 insertions(+), 92 deletions(-)

diff --git a/Makefile b/Makefile
index 2a926aaeb0..a380bbfa12 100644
--- a/Makefile
+++ b/Makefile
@@ -335,9 +335,7 @@ endif
 ifdef CONFIG_WIN32
 	@echo  'Windows targets:'
 	$(call print-help,installer,Build NSIS-based installer for QEMU)
-ifdef CONFIG_QGA_MSI
 	$(call print-help,msi,Build MSI-based installer for qemu-ga)
-endif
 	@echo  ''
 endif
 	$(call print-help,$(MAKE) [targets],(quiet build, default))
diff --git a/configure b/configure
index 753d0dd18e..6c98552452 100755
--- a/configure
+++ b/configure
@@ -404,7 +404,7 @@ zstd="auto"
 guest_agent="$default_feature"
 guest_agent_with_vss="no"
 guest_agent_ntddscsi="no"
-guest_agent_msi="$default_feature"
+guest_agent_msi="auto"
 vss_win32_sdk="$default_feature"
 win_sdk="no"
 want_tools="$default_feature"
@@ -1334,9 +1334,9 @@ for opt do
   ;;
   --disable-guest-agent) guest_agent="no"
   ;;
-  --enable-guest-agent-msi) guest_agent_msi="yes"
+  --enable-guest-agent-msi) guest_agent_msi="enabled"
   ;;
-  --disable-guest-agent-msi) guest_agent_msi="no"
+  --disable-guest-agent-msi) guest_agent_msi="disabled"
   ;;
   --with-vss-sdk) vss_win32_sdk=""
   ;;
@@ -5341,62 +5341,19 @@ if [ "$guest_agent" != "no" ]; then
   fi
 fi
 
-# Guest agent Window MSI  package
+# Guest agent Windows MSI package
 
-if test "$guest_agent" != yes; then
-  if test "$guest_agent_msi" = yes; then
-    error_exit "MSI guest agent package requires guest agent enabled"
-  fi
-  guest_agent_msi=no
-elif test "$mingw32" != "yes"; then
-  if test "$guest_agent_msi" = "yes"; then
-    error_exit "MSI guest agent package is available only for MinGW Windows cross-compilation"
-  fi
-  guest_agent_msi=no
-elif ! has wixl; then
-  if test "$guest_agent_msi" = "yes"; then
-    error_exit "MSI guest agent package requires wixl tool installed ( usually from msitools package )"
-  fi
-  guest_agent_msi=no
-else
-  # we support qemu-ga, mingw32, and wixl: default to MSI enabled if it wasn't
-  # disabled explicitly
-  if test "$guest_agent_msi" != "no"; then
-    guest_agent_msi=yes
-  fi
+if test "$QEMU_GA_MANUFACTURER" = ""; then
+  QEMU_GA_MANUFACTURER=QEMU
 fi
-
-if test "$guest_agent_msi" = "yes"; then
-  if test "$guest_agent_with_vss" = "yes"; then
-    QEMU_GA_MSI_WITH_VSS="-D InstallVss"
-  fi
-
-  if test "$QEMU_GA_MANUFACTURER" = ""; then
-    QEMU_GA_MANUFACTURER=QEMU
-  fi
-
-  if test "$QEMU_GA_DISTRO" = ""; then
-    QEMU_GA_DISTRO=Linux
-  fi
-
-  if test "$QEMU_GA_VERSION" = ""; then
-      QEMU_GA_VERSION=$(cat $source_path/VERSION)
-  fi
-
-  QEMU_GA_MSI_MINGW_DLL_PATH="-D Mingw_dlls=$($pkg_config --variable=prefix glib-2.0)/bin"
-
-  case "$cpu" in
-  x86_64)
-    QEMU_GA_MSI_ARCH="-a x64 -D Arch=64"
-    ;;
-  i386)
-    QEMU_GA_MSI_ARCH="-D Arch=32"
-    ;;
-  *)
-    error_exit "CPU $cpu not supported for building installation package"
-    ;;
-  esac
+if test "$QEMU_GA_DISTRO" = ""; then
+  QEMU_GA_DISTRO=Linux
 fi
+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"
 
 # Mac OS X ships with a broken assembler
 roms=
@@ -5495,15 +5452,10 @@ if test "$mingw32" = "yes" ; then
   if test "$guest_agent_ntddscsi" = "yes" ; then
     echo "CONFIG_QGA_NTDDSCSI=y" >> $config_host_mak
   fi
-  if test "$guest_agent_msi" = "yes"; then
-    echo "CONFIG_QGA_MSI=y" >> $config_host_mak
-    echo "QEMU_GA_MSI_MINGW_DLL_PATH=${QEMU_GA_MSI_MINGW_DLL_PATH}" >> $config_host_mak
-    echo "QEMU_GA_MSI_WITH_VSS=${QEMU_GA_MSI_WITH_VSS}" >> $config_host_mak
-    echo "QEMU_GA_MSI_ARCH=${QEMU_GA_MSI_ARCH}" >> $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
-  fi
+  echo "QEMU_GA_MSI_MINGW_DLL_PATH=${QEMU_GA_MSI_MINGW_DLL_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
 else
   echo "CONFIG_POSIX=y" >> $config_host_mak
 fi
@@ -6420,7 +6372,7 @@ NINJA=$ninja $meson setup \
         -Dattr=$attr -Ddefault_devices=$default_devices \
         -Ddocs=$docs -Dsphinx_build=$sphinx_build -Dinstall_blobs=$blobs \
         -Dvhost_user_blk_server=$vhost_user_blk_server \
-        -Dfuse=$fuse -Dfuse_lseek=$fuse_lseek \
+        -Dfuse=$fuse -Dfuse_lseek=$fuse_lseek -Dguest_agent_msi=$guest_agent_msi \
         $(if test "$default_features" = no; then echo "-Dauto_features=disabled"; fi) \
         $cross_arg \
         "$PWD" "$source_path"
diff --git a/meson.build b/meson.build
index 4a5f265bd0..49dd0c185f 100644
--- a/meson.build
+++ b/meson.build
@@ -2142,6 +2142,8 @@ endif
 
 if 'CONFIG_GUEST_AGENT' in config_host
   subdir('qga')
+elif get_option('guest_agent_msi').enabled()
+  error('Guest agent MSI requested, but the guest agent is not being built')
 endif
 
 # Don't build qemu-keymap if xkbcommon is not explicitly enabled
@@ -2406,9 +2408,11 @@ if targetos == 'windows'
   if 'WIN_SDK' in config_host
     summary_info += {'Windows SDK':       config_host['WIN_SDK']}
   endif
-  summary_info += {'QGA VSS support':   config_host.has_key('CONFIG_QGA_VSS')}
-  summary_info += {'QGA w32 disk info': config_host.has_key('CONFIG_QGA_NTDDSCSI')}
-  summary_info += {'QGA MSI support':   config_host.has_key('CONFIG_QGA_MSI')}
+  if config_host.has_key('CONFIG_GUEST_AGENT')
+    summary_info += {'QGA VSS support':   config_host.has_key('CONFIG_QGA_VSS')}
+    summary_info += {'QGA w32 disk info': config_host.has_key('CONFIG_QGA_NTDDSCSI')}
+    summary_info += {'QGA MSI support':   wixl.found()}
+  endif
 endif
 summary_info += {'seccomp support':   seccomp.found()}
 summary_info += {'CFI support':       get_option('cfi')}
diff --git a/meson_options.txt b/meson_options.txt
index 7dcd81c06a..95f1079829 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -17,6 +17,8 @@ option('install_blobs', type : 'boolean', value : true,
        description: 'install provided firmware blobs')
 option('sparse', type : 'feature', value : 'auto',
        description: 'sparse checker')
+option('guest_agent_msi', type : 'feature', value : 'auto',
+       description: 'Build MSI package for the QEMU Guest Agent')
 
 option('malloc_trim', type : 'feature', value : 'auto',
        description: 'enable libc malloc_trim() for memory optimization')
diff --git a/qga/meson.build b/qga/meson.build
index 520af6ce9b..cfb1fbc085 100644
--- a/qga/meson.build
+++ b/qga/meson.build
@@ -55,33 +55,46 @@ if targetos == 'windows'
     gen_tlb = []
   endif
 
-  wixl = find_program('wixl', required: false)
+  qemu_ga_msi_arch = {
+    'x86': ['-D', 'Arch=32'],
+    'x86_64': ['-a', 'x64', '-D', 'Arch=64']
+  }
+  wixl = not_found
+  if cpu in qemu_ga_msi_arch
+    wixl = find_program('wixl', required: get_option('guest_agent_msi'))
+  elif get_option('guest_agent_msi').enabled()
+    error('CPU not supported for building guest agent installation package')
+  endif
+
   if wixl.found()
     deps = [gen_tlb, qga]
-    if 'CONFIG_QGA_VSS' in config_host and 'QEMU_GA_MSI_WITH_VSS' in config_host
+    qemu_ga_msi_vss = []
+    if 'CONFIG_QGA_VSS' in config_host
+      qemu_ga_msi_vss = ['-D', 'InstallVss']
       deps += qga_vss
     endif
-    if 'CONFIG_QGA_MSI' in config_host
-      qga_msi = custom_target('QGA MSI',
-                              input: files('installer/qemu-ga.wxs'),
-                              output: 'qemu-ga-@0@.msi'.format(config_host['ARCH']),
-                              depends: deps,
-                              command: [
-                                find_program('env'),
-                                'QEMU_GA_VERSION=' + config_host['QEMU_GA_VERSION'],
-                                'QEMU_GA_MANUFACTURER=' + config_host['QEMU_GA_MANUFACTURER'],
-                                'QEMU_GA_DISTRO=' + config_host['QEMU_GA_DISTRO'],
-                                'BUILD_DIR=' + meson.build_root(),
-                                wixl, '-o', '@OUTPUT0@', '@INPUT0@',
-                                config_host['QEMU_GA_MSI_ARCH'].split(),
-                                config_host['QEMU_GA_MSI_WITH_VSS'].split(),
-                                config_host['QEMU_GA_MSI_MINGW_DLL_PATH'].split(),
-                              ])
-      all_qga += [qga_msi]
-      alias_target('msi', qga_msi)
-    endif
+    qga_msi = custom_target('QGA MSI',
+                            input: files('installer/qemu-ga.wxs'),
+                            output: 'qemu-ga-@0@.msi'.format(config_host['ARCH']),
+                            depends: deps,
+                            command: [
+                              find_program('env'),
+                              'QEMU_GA_VERSION=' + config_host['QEMU_GA_VERSION'],
+                              'QEMU_GA_MANUFACTURER=' + config_host['QEMU_GA_MANUFACTURER'],
+                              'QEMU_GA_DISTRO=' + config_host['QEMU_GA_DISTRO'],
+                              'BUILD_DIR=' + meson.build_root(),
+                              wixl, '-o', '@OUTPUT0@', '@INPUT0@',
+                              qemu_ga_msi_arch[cpu],
+                              qemu_ga_msi_vss,
+                              '-D', 'Mingw_dlls=' + config_host['QEMU_GA_MSI_MINGW_DLL_PATH'],
+                            ])
+    all_qga += [qga_msi]
+    alias_target('msi', qga_msi)
   endif
 else
+  if get_option('guest_agent_msi').enabled()
+    error('MSI guest agent package is available only for MinGW Windows cross-compilation')
+  endif
   install_subdir('run', install_dir: get_option('localstatedir'))
 endif
 
-- 
2.26.2




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

* [PULL 15/31] meson: Summarize information related to directories first
  2021-01-23 14:30 [PULL 00/31] Misc patches for 2020-01-21 Paolo Bonzini
                   ` (13 preceding siblings ...)
  2021-01-23 14:31 ` [PULL 14/31] meson: convert wixl detection to Meson Paolo Bonzini
@ 2021-01-23 14:31 ` Paolo Bonzini
  2021-01-23 14:31 ` [PULL 16/31] meson: Display host binaries information altogether Paolo Bonzini
                   ` (17 subsequent siblings)
  32 siblings, 0 replies; 53+ messages in thread
From: Paolo Bonzini @ 2021-01-23 14:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Philippe Mathieu-Daudé

From: Philippe Mathieu-Daudé <philmd@redhat.com>

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210121095616.1471869-2-philmd@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 meson.build | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/meson.build b/meson.build
index 49dd0c185f..f50a85e728 100644
--- a/meson.build
+++ b/meson.build
@@ -2233,6 +2233,7 @@ endif
 # Configuration summary #
 #########################
 
+# Directories
 summary_info = {}
 summary_info += {'Install prefix':    get_option('prefix')}
 summary_info += {'BIOS directory':    qemu_datadir}
@@ -2252,8 +2253,11 @@ endif
 summary_info += {'Doc directory':     get_option('docdir')}
 summary_info += {'Build directory':   meson.current_build_dir()}
 summary_info += {'Source path':       meson.current_source_dir()}
-summary_info += {'GIT binary':        config_host['GIT']}
 summary_info += {'GIT submodules':    config_host['GIT_SUBMODULES']}
+summary(summary_info, bool_yn: true, section: 'Directories')
+
+summary_info = {}
+summary_info += {'GIT binary':        config_host['GIT']}
 summary_info += {'C compiler':        meson.get_compiler('c').cmd_array()[0]}
 summary_info += {'Host C compiler':   meson.get_compiler('c', native: true).cmd_array()[0]}
 if link_language == 'cpp'
-- 
2.26.2




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

* [PULL 16/31] meson: Display host binaries information altogether
  2021-01-23 14:30 [PULL 00/31] Misc patches for 2020-01-21 Paolo Bonzini
                   ` (14 preceding siblings ...)
  2021-01-23 14:31 ` [PULL 15/31] meson: Summarize information related to directories first Paolo Bonzini
@ 2021-01-23 14:31 ` Paolo Bonzini
  2021-01-23 14:31 ` [PULL 17/31] meson: Summarize overall features altogether Paolo Bonzini
                   ` (16 subsequent siblings)
  32 siblings, 0 replies; 53+ messages in thread
From: Paolo Bonzini @ 2021-01-23 14:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Philippe Mathieu-Daudé

From: Philippe Mathieu-Daudé <philmd@redhat.com>

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210121095616.1471869-3-philmd@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 meson.build | 30 ++++++++++++++++++------------
 1 file changed, 18 insertions(+), 12 deletions(-)

diff --git a/meson.build b/meson.build
index f50a85e728..bda28de52c 100644
--- a/meson.build
+++ b/meson.build
@@ -2256,8 +2256,25 @@ summary_info += {'Source path':       meson.current_source_dir()}
 summary_info += {'GIT submodules':    config_host['GIT_SUBMODULES']}
 summary(summary_info, bool_yn: true, section: 'Directories')
 
+# Host binaries
+summary_info = {}
+summary_info += {'git':               config_host['GIT']}
+summary_info += {'make':              config_host['MAKE']}
+summary_info += {'python':            '@0@ (version: @1@)'.format(python.full_path(), python.language_version())}
+summary_info += {'sphinx-build':      sphinx_build.found()}
+if config_host.has_key('HAVE_GDB_BIN')
+  summary_info += {'gdb':             config_host['HAVE_GDB_BIN']}
+endif
+summary_info += {'genisoimage':       config_host['GENISOIMAGE']}
+if targetos == 'windows' and config_host.has_key('CONFIG_GUEST_AGENT')
+  summary_info += {'wixl':            wixl.found() ? wixl.full_path() : false}
+endif
+if slirp_opt != 'disabled'
+  summary_info += {'smbd':            config_host['CONFIG_SMBD_COMMAND']}
+endif
+summary(summary_info, bool_yn: true, section: 'Host binaries')
+
 summary_info = {}
-summary_info += {'GIT binary':        config_host['GIT']}
 summary_info += {'C compiler':        meson.get_compiler('c').cmd_array()[0]}
 summary_info += {'Host C compiler':   meson.get_compiler('c', native: true).cmd_array()[0]}
 if link_language == 'cpp'
@@ -2283,15 +2300,8 @@ if link_args.length() > 0
 endif
 summary_info += {'QEMU_CFLAGS':       config_host['QEMU_CFLAGS']}
 summary_info += {'QEMU_LDFLAGS':      config_host['QEMU_LDFLAGS']}
-summary_info += {'make':              config_host['MAKE']}
-summary_info += {'python':            '@0@ (version: @1@)'.format(python.full_path(), python.language_version())}
-summary_info += {'sphinx-build':      sphinx_build.found()}
-summary_info += {'genisoimage':       config_host['GENISOIMAGE']}
 # TODO: add back version
 summary_info += {'slirp support':     slirp_opt == 'disabled' ? false : slirp_opt}
-if slirp_opt != 'disabled'
-  summary_info += {'smbd':            config_host['CONFIG_SMBD_COMMAND']}
-endif
 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')}
@@ -2415,7 +2425,6 @@ if targetos == 'windows'
   if config_host.has_key('CONFIG_GUEST_AGENT')
     summary_info += {'QGA VSS support':   config_host.has_key('CONFIG_QGA_VSS')}
     summary_info += {'QGA w32 disk info': config_host.has_key('CONFIG_QGA_NTDDSCSI')}
-    summary_info += {'QGA MSI support':   wixl.found()}
   endif
 endif
 summary_info += {'seccomp support':   seccomp.found()}
@@ -2459,9 +2468,6 @@ summary_info += {'libudev':           libudev.found()}
 summary_info += {'default devices':   get_option('default_devices')}
 summary_info += {'plugin support':    config_host.has_key('CONFIG_PLUGIN')}
 summary_info += {'fuzzing support':   config_host.has_key('CONFIG_FUZZ')}
-if config_host.has_key('HAVE_GDB_BIN')
-  summary_info += {'gdb':             config_host['HAVE_GDB_BIN']}
-endif
 summary_info += {'thread sanitizer':  config_host.has_key('CONFIG_TSAN')}
 summary_info += {'rng-none':          config_host.has_key('CONFIG_RNG_NONE')}
 summary_info += {'Linux keyring':     config_host.has_key('CONFIG_SECRET_KEYRING')}
-- 
2.26.2




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

* [PULL 17/31] meson: Summarize overall features altogether
  2021-01-23 14:30 [PULL 00/31] Misc patches for 2020-01-21 Paolo Bonzini
                   ` (15 preceding siblings ...)
  2021-01-23 14:31 ` [PULL 16/31] meson: Display host binaries information altogether Paolo Bonzini
@ 2021-01-23 14:31 ` Paolo Bonzini
  2021-01-23 14:31 ` [PULL 18/31] meson: Summarize compilation-related information altogether Paolo Bonzini
                   ` (15 subsequent siblings)
  32 siblings, 0 replies; 53+ messages in thread
From: Paolo Bonzini @ 2021-01-23 14:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Philippe Mathieu-Daudé

From: Philippe Mathieu-Daudé <philmd@redhat.com>

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210121095616.1471869-4-philmd@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 meson.build | 54 +++++++++++++++++++++++++++++------------------------
 1 file changed, 30 insertions(+), 24 deletions(-)

diff --git a/meson.build b/meson.build
index bda28de52c..b1d12d8c74 100644
--- a/meson.build
+++ b/meson.build
@@ -2274,6 +2274,36 @@ if slirp_opt != 'disabled'
 endif
 summary(summary_info, bool_yn: true, section: 'Host binaries')
 
+# Configurable features
+summary_info = {}
+summary_info += {'Documentation':     build_docs}
+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')}
+endif
+summary_info += {'plugin support':    config_host.has_key('CONFIG_PLUGIN')}
+summary_info += {'fuzzing support':   config_host.has_key('CONFIG_FUZZ')}
+if have_system
+  summary_info += {'Audio drivers':     config_host['CONFIG_AUDIO_DRIVERS']}
+endif
+summary_info += {'Trace backends':    config_host['TRACE_BACKENDS']}
+if config_host['TRACE_BACKENDS'].split().contains('simple')
+  summary_info += {'Trace output file': config_host['CONFIG_TRACE_FILE'] + '-<pid>'}
+endif
+summary_info += {'QOM debugging':     config_host.has_key('CONFIG_QOM_CAST_DEBUG')}
+summary_info += {'vhost-kernel support': config_host.has_key('CONFIG_VHOST_KERNEL')}
+summary_info += {'vhost-net support': config_host.has_key('CONFIG_VHOST_NET')}
+summary_info += {'vhost-crypto support': config_host.has_key('CONFIG_VHOST_CRYPTO')}
+summary_info += {'vhost-scsi support': config_host.has_key('CONFIG_VHOST_SCSI')}
+summary_info += {'vhost-vsock support': config_host.has_key('CONFIG_VHOST_VSOCK')}
+summary_info += {'vhost-user support': config_host.has_key('CONFIG_VHOST_USER')}
+summary_info += {'vhost-user-blk server support': have_vhost_user_blk_server}
+summary_info += {'vhost-user-fs support': config_host.has_key('CONFIG_VHOST_USER_FS')}
+summary_info += {'vhost-vdpa support': config_host.has_key('CONFIG_VHOST_VDPA')}
+summary_info += {'build guest agent': config_host.has_key('CONFIG_GUEST_AGENT')}
+summary(summary_info, bool_yn: true, section: 'Configurable features')
+
 summary_info = {}
 summary_info += {'C compiler':        meson.get_compiler('c').cmd_array()[0]}
 summary_info += {'Host C compiler':   meson.get_compiler('c', native: true).cmd_array()[0]}
@@ -2302,10 +2332,6 @@ summary_info += {'QEMU_CFLAGS':       config_host['QEMU_CFLAGS']}
 summary_info += {'QEMU_LDFLAGS':      config_host['QEMU_LDFLAGS']}
 # TODO: add back version
 summary_info += {'slirp support':     slirp_opt == 'disabled' ? false : slirp_opt}
-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')}
-endif
 summary_info += {'host CPU':          cpu}
 summary_info += {'host endianness':   build_machine.endian()}
 summary_info += {'target list':       ' '.join(target_dirs)}
@@ -2347,7 +2373,6 @@ summary_info += {'curses support':    curses.found()}
 summary_info += {'virgl support':     config_host.has_key('CONFIG_VIRGL')}
 summary_info += {'curl support':      curl.found()}
 summary_info += {'mingw32 support':   targetos == 'windows'}
-summary_info += {'Audio drivers':     config_host['CONFIG_AUDIO_DRIVERS']}
 summary_info += {'Block whitelist (rw)': config_host['CONFIG_BDRV_RW_WHITELIST']}
 summary_info += {'Block whitelist (ro)': config_host['CONFIG_BDRV_RO_WHITELIST']}
 summary_info += {'VirtFS support':    have_virtfs}
@@ -2364,14 +2389,12 @@ if config_host.has_key('CONFIG_XEN_BACKEND')
   summary_info += {'xen ctrl version':  config_host['CONFIG_XEN_CTRL_INTERFACE_VERSION']}
 endif
 summary_info += {'brlapi support':    brlapi.found()}
-summary_info += {'Documentation':     build_docs}
 summary_info += {'PIE':               get_option('b_pie')}
 summary_info += {'vde support':       config_host.has_key('CONFIG_VDE')}
 summary_info += {'netmap support':    config_host.has_key('CONFIG_NETMAP')}
 summary_info += {'Linux AIO support': config_host.has_key('CONFIG_LINUX_AIO')}
 summary_info += {'Linux io_uring support': config_host.has_key('CONFIG_LINUX_IO_URING')}
 summary_info += {'ATTR/XATTR support': libattr.found()}
-summary_info += {'Install blobs':     get_option('install_blobs')}
 summary_info += {'KVM support':       config_all.has_key('CONFIG_KVM')}
 summary_info += {'HAX support':       config_all.has_key('CONFIG_HAX')}
 summary_info += {'HVF support':       config_all.has_key('CONFIG_HVF')}
@@ -2392,19 +2415,6 @@ summary_info += {'madvise':           config_host.has_key('CONFIG_MADVISE')}
 summary_info += {'posix_madvise':     config_host.has_key('CONFIG_POSIX_MADVISE')}
 summary_info += {'posix_memalign':    config_host.has_key('CONFIG_POSIX_MEMALIGN')}
 summary_info += {'libcap-ng support': libcap_ng.found()}
-summary_info += {'vhost-kernel support': config_host.has_key('CONFIG_VHOST_KERNEL')}
-summary_info += {'vhost-net support': config_host.has_key('CONFIG_VHOST_NET')}
-summary_info += {'vhost-crypto support': config_host.has_key('CONFIG_VHOST_CRYPTO')}
-summary_info += {'vhost-scsi support': config_host.has_key('CONFIG_VHOST_SCSI')}
-summary_info += {'vhost-vsock support': config_host.has_key('CONFIG_VHOST_VSOCK')}
-summary_info += {'vhost-user support': config_host.has_key('CONFIG_VHOST_USER')}
-summary_info += {'vhost-user-blk server support': have_vhost_user_blk_server}
-summary_info += {'vhost-user-fs support': config_host.has_key('CONFIG_VHOST_USER_FS')}
-summary_info += {'vhost-vdpa support': config_host.has_key('CONFIG_VHOST_VDPA')}
-summary_info += {'Trace backends':    config_host['TRACE_BACKENDS']}
-if config_host['TRACE_BACKENDS'].split().contains('simple')
-  summary_info += {'Trace output file': config_host['CONFIG_TRACE_FILE'] + '-<pid>'}
-endif
 # TODO: add back protocol and server version
 summary_info += {'spice support':     config_host.has_key('CONFIG_SPICE')}
 summary_info += {'rbd support':       rbd.found()}
@@ -2417,7 +2427,6 @@ summary_info += {'OpenGL support':    config_host.has_key('CONFIG_OPENGL')}
 summary_info += {'OpenGL dmabufs':    config_host.has_key('CONFIG_OPENGL_DMABUF')}
 summary_info += {'libiscsi support':  libiscsi.found()}
 summary_info += {'libnfs support':    libnfs.found()}
-summary_info += {'build guest agent': config_host.has_key('CONFIG_GUEST_AGENT')}
 if targetos == 'windows'
   if 'WIN_SDK' in config_host
     summary_info += {'Windows SDK':       config_host['WIN_SDK']}
@@ -2439,7 +2448,6 @@ summary_info += {'GlusterFS support': glusterfs.found()}
 summary_info += {'gcov':              get_option('b_coverage')}
 summary_info += {'TPM support':       config_host.has_key('CONFIG_TPM')}
 summary_info += {'libssh support':    config_host.has_key('CONFIG_LIBSSH')}
-summary_info += {'QOM debugging':     config_host.has_key('CONFIG_QOM_CAST_DEBUG')}
 summary_info += {'Live block migration': config_host.has_key('CONFIG_LIVE_BLOCK_MIGRATION')}
 summary_info += {'lzo support':       lzo.found()}
 summary_info += {'snappy support':    snappy.found()}
@@ -2466,8 +2474,6 @@ summary_info += {'libpmem support':   config_host.has_key('CONFIG_LIBPMEM')}
 summary_info += {'libdaxctl support': config_host.has_key('CONFIG_LIBDAXCTL')}
 summary_info += {'libudev':           libudev.found()}
 summary_info += {'default devices':   get_option('default_devices')}
-summary_info += {'plugin support':    config_host.has_key('CONFIG_PLUGIN')}
-summary_info += {'fuzzing support':   config_host.has_key('CONFIG_FUZZ')}
 summary_info += {'thread sanitizer':  config_host.has_key('CONFIG_TSAN')}
 summary_info += {'rng-none':          config_host.has_key('CONFIG_RNG_NONE')}
 summary_info += {'Linux keyring':     config_host.has_key('CONFIG_SECRET_KEYRING')}
-- 
2.26.2




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

* [PULL 18/31] meson: Summarize compilation-related information altogether
  2021-01-23 14:30 [PULL 00/31] Misc patches for 2020-01-21 Paolo Bonzini
                   ` (16 preceding siblings ...)
  2021-01-23 14:31 ` [PULL 17/31] meson: Summarize overall features altogether Paolo Bonzini
@ 2021-01-23 14:31 ` Paolo Bonzini
  2021-01-23 14:31 ` [PULL 19/31] meson: Display accelerators and selected targets altogether Paolo Bonzini
                   ` (14 subsequent siblings)
  32 siblings, 0 replies; 53+ messages in thread
From: Paolo Bonzini @ 2021-01-23 14:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Philippe Mathieu-Daudé

From: Philippe Mathieu-Daudé <philmd@redhat.com>

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210121095616.1471869-5-philmd@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 meson.build | 66 ++++++++++++++++++++++++++++++-----------------------
 1 file changed, 37 insertions(+), 29 deletions(-)

diff --git a/meson.build b/meson.build
index b1d12d8c74..3b2332b94d 100644
--- a/meson.build
+++ b/meson.build
@@ -2304,7 +2304,10 @@ summary_info += {'vhost-vdpa support': config_host.has_key('CONFIG_VHOST_VDPA')}
 summary_info += {'build guest agent': config_host.has_key('CONFIG_GUEST_AGENT')}
 summary(summary_info, bool_yn: true, section: 'Configurable features')
 
+# Compilation information
 summary_info = {}
+summary_info += {'host CPU':          cpu}
+summary_info += {'host endianness':   build_machine.endian()}
 summary_info += {'C compiler':        meson.get_compiler('c').cmd_array()[0]}
 summary_info += {'Host C compiler':   meson.get_compiler('c', native: true).cmd_array()[0]}
 if link_language == 'cpp'
@@ -2315,6 +2318,11 @@ endif
 if targetos == 'darwin'
   summary_info += {'Objective-C compiler': meson.get_compiler('objc').cmd_array()[0]}
 endif
+if targetos == 'windows'
+  if 'WIN_SDK' in config_host
+    summary_info += {'Windows SDK':   config_host['WIN_SDK']}
+  endif
+endif
 summary_info += {'ARFLAGS':           config_host['ARFLAGS']}
 summary_info += {'CFLAGS':            ' '.join(get_option('c_args')
                                                + ['-O' + get_option('optimization')]
@@ -2330,17 +2338,36 @@ if link_args.length() > 0
 endif
 summary_info += {'QEMU_CFLAGS':       config_host['QEMU_CFLAGS']}
 summary_info += {'QEMU_LDFLAGS':      config_host['QEMU_LDFLAGS']}
-# TODO: add back version
-summary_info += {'slirp support':     slirp_opt == 'disabled' ? false : slirp_opt}
-summary_info += {'host CPU':          cpu}
-summary_info += {'host endianness':   build_machine.endian()}
-summary_info += {'target list':       ' '.join(target_dirs)}
-summary_info += {'gprof enabled':     config_host.has_key('CONFIG_GPROF')}
-summary_info += {'sparse enabled':    sparse.found()}
-summary_info += {'strip binaries':    get_option('strip')}
 summary_info += {'profiler':          config_host.has_key('CONFIG_PROFILER')}
 summary_info += {'link-time optimization (LTO)': get_option('b_lto')}
+summary_info += {'PIE':               get_option('b_pie')}
 summary_info += {'static build':      config_host.has_key('CONFIG_STATIC')}
+summary_info += {'malloc trim support': has_malloc_trim}
+summary_info += {'membarrier':        config_host.has_key('CONFIG_MEMBARRIER')}
+summary_info += {'preadv support':    config_host.has_key('CONFIG_PREADV')}
+summary_info += {'fdatasync':         config_host.has_key('CONFIG_FDATASYNC')}
+summary_info += {'madvise':           config_host.has_key('CONFIG_MADVISE')}
+summary_info += {'posix_madvise':     config_host.has_key('CONFIG_POSIX_MADVISE')}
+summary_info += {'posix_memalign':    config_host.has_key('CONFIG_POSIX_MEMALIGN')}
+summary_info += {'debug stack usage': config_host.has_key('CONFIG_DEBUG_STACK_USAGE')}
+summary_info += {'mutex debugging':   config_host.has_key('CONFIG_DEBUG_MUTEX')}
+summary_info += {'memory allocator':  get_option('malloc')}
+summary_info += {'avx2 optimization': config_host.has_key('CONFIG_AVX2_OPT')}
+summary_info += {'avx512f optimization': config_host.has_key('CONFIG_AVX512F_OPT')}
+summary_info += {'gprof enabled':     config_host.has_key('CONFIG_GPROF')}
+summary_info += {'gcov':              get_option('b_coverage')}
+summary_info += {'thread sanitizer':  config_host.has_key('CONFIG_TSAN')}
+summary_info += {'CFI support':       get_option('cfi')}
+if get_option('cfi')
+  summary_info += {'CFI debug support': get_option('cfi_debug')}
+endif
+summary_info += {'strip binaries':    get_option('strip')}
+summary_info += {'sparse':            sparse.found() ? sparse.full_path() : false}
+summary_info += {'mingw32 support':   targetos == 'windows'}
+summary(summary_info, bool_yn: true, section: 'Compilation')
+
+summary_info = {}
+summary_info += {'target list':       ' '.join(target_dirs)}
 if targetos == 'darwin'
   summary_info += {'Cocoa support':   cocoa.found()}
 endif
@@ -2365,6 +2392,8 @@ summary_info += {'nettle':            config_host.has_key('CONFIG_NETTLE')}
 if config_host.has_key('CONFIG_NETTLE')
    summary_info += {'  XTS':             not config_host.has_key('CONFIG_QEMU_PRIVATE_XTS')}
 endif
+# TODO: add back version
+summary_info += {'slirp support':     slirp_opt == 'disabled' ? false : slirp_opt}
 summary_info += {'libtasn1':          config_host.has_key('CONFIG_TASN1')}
 summary_info += {'PAM':               config_host.has_key('CONFIG_AUTH_PAM')}
 summary_info += {'iconv support':     iconv.found()}
@@ -2372,7 +2401,6 @@ summary_info += {'curses support':    curses.found()}
 # TODO: add back version
 summary_info += {'virgl support':     config_host.has_key('CONFIG_VIRGL')}
 summary_info += {'curl support':      curl.found()}
-summary_info += {'mingw32 support':   targetos == 'windows'}
 summary_info += {'Block whitelist (rw)': config_host['CONFIG_BDRV_RW_WHITELIST']}
 summary_info += {'Block whitelist (ro)': config_host['CONFIG_BDRV_RO_WHITELIST']}
 summary_info += {'VirtFS support':    have_virtfs}
@@ -2389,7 +2417,6 @@ if config_host.has_key('CONFIG_XEN_BACKEND')
   summary_info += {'xen ctrl version':  config_host['CONFIG_XEN_CTRL_INTERFACE_VERSION']}
 endif
 summary_info += {'brlapi support':    brlapi.found()}
-summary_info += {'PIE':               get_option('b_pie')}
 summary_info += {'vde support':       config_host.has_key('CONFIG_VDE')}
 summary_info += {'netmap support':    config_host.has_key('CONFIG_NETMAP')}
 summary_info += {'Linux AIO support': config_host.has_key('CONFIG_LINUX_AIO')}
@@ -2404,16 +2431,9 @@ if config_all.has_key('CONFIG_TCG')
   summary_info += {'TCG debug enabled': config_host.has_key('CONFIG_DEBUG_TCG')}
   summary_info += {'TCG interpreter':   tcg_arch == 'tci'}
 endif
-summary_info += {'malloc trim support': has_malloc_trim}
 summary_info += {'RDMA support':      config_host.has_key('CONFIG_RDMA')}
 summary_info += {'PVRDMA support':    config_host.has_key('CONFIG_PVRDMA')}
 summary_info += {'fdt support':       fdt_opt == 'disabled' ? false : fdt_opt}
-summary_info += {'membarrier':        config_host.has_key('CONFIG_MEMBARRIER')}
-summary_info += {'preadv support':    config_host.has_key('CONFIG_PREADV')}
-summary_info += {'fdatasync':         config_host.has_key('CONFIG_FDATASYNC')}
-summary_info += {'madvise':           config_host.has_key('CONFIG_MADVISE')}
-summary_info += {'posix_madvise':     config_host.has_key('CONFIG_POSIX_MADVISE')}
-summary_info += {'posix_memalign':    config_host.has_key('CONFIG_POSIX_MEMALIGN')}
 summary_info += {'libcap-ng support': libcap_ng.found()}
 # TODO: add back protocol and server version
 summary_info += {'spice support':     config_host.has_key('CONFIG_SPICE')}
@@ -2428,24 +2448,16 @@ summary_info += {'OpenGL dmabufs':    config_host.has_key('CONFIG_OPENGL_DMABUF'
 summary_info += {'libiscsi support':  libiscsi.found()}
 summary_info += {'libnfs support':    libnfs.found()}
 if targetos == 'windows'
-  if 'WIN_SDK' in config_host
-    summary_info += {'Windows SDK':       config_host['WIN_SDK']}
-  endif
   if config_host.has_key('CONFIG_GUEST_AGENT')
     summary_info += {'QGA VSS support':   config_host.has_key('CONFIG_QGA_VSS')}
     summary_info += {'QGA w32 disk info': config_host.has_key('CONFIG_QGA_NTDDSCSI')}
   endif
 endif
 summary_info += {'seccomp support':   seccomp.found()}
-summary_info += {'CFI support':       get_option('cfi')}
-summary_info += {'CFI debug support': get_option('cfi_debug')}
 summary_info += {'coroutine backend': config_host['CONFIG_COROUTINE_BACKEND']}
 summary_info += {'coroutine pool':    config_host['CONFIG_COROUTINE_POOL'] == '1'}
-summary_info += {'debug stack usage': config_host.has_key('CONFIG_DEBUG_STACK_USAGE')}
-summary_info += {'mutex debugging':   config_host.has_key('CONFIG_DEBUG_MUTEX')}
 summary_info += {'crypto afalg':      config_host.has_key('CONFIG_AF_ALG')}
 summary_info += {'GlusterFS support': glusterfs.found()}
-summary_info += {'gcov':              get_option('b_coverage')}
 summary_info += {'TPM support':       config_host.has_key('CONFIG_TPM')}
 summary_info += {'libssh support':    config_host.has_key('CONFIG_LIBSSH')}
 summary_info += {'Live block migration': config_host.has_key('CONFIG_LIVE_BLOCK_MIGRATION')}
@@ -2456,9 +2468,6 @@ summary_info += {'lzfse support':     liblzfse.found()}
 summary_info += {'zstd support':      zstd.found()}
 summary_info += {'NUMA host support': config_host.has_key('CONFIG_NUMA')}
 summary_info += {'libxml2':           config_host.has_key('CONFIG_LIBXML2')}
-summary_info += {'memory allocator':  get_option('malloc')}
-summary_info += {'avx2 optimization': config_host.has_key('CONFIG_AVX2_OPT')}
-summary_info += {'avx512f optimization': config_host.has_key('CONFIG_AVX512F_OPT')}
 summary_info += {'replication support': config_host.has_key('CONFIG_REPLICATION')}
 summary_info += {'bochs support':     config_host.has_key('CONFIG_BOCHS')}
 summary_info += {'cloop support':     config_host.has_key('CONFIG_CLOOP')}
@@ -2474,7 +2483,6 @@ summary_info += {'libpmem support':   config_host.has_key('CONFIG_LIBPMEM')}
 summary_info += {'libdaxctl support': config_host.has_key('CONFIG_LIBDAXCTL')}
 summary_info += {'libudev':           libudev.found()}
 summary_info += {'default devices':   get_option('default_devices')}
-summary_info += {'thread sanitizer':  config_host.has_key('CONFIG_TSAN')}
 summary_info += {'rng-none':          config_host.has_key('CONFIG_RNG_NONE')}
 summary_info += {'Linux keyring':     config_host.has_key('CONFIG_SECRET_KEYRING')}
 summary_info += {'FUSE exports':      fuse.found()}
-- 
2.26.2




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

* [PULL 19/31] meson: Display accelerators and selected targets altogether
  2021-01-23 14:30 [PULL 00/31] Misc patches for 2020-01-21 Paolo Bonzini
                   ` (17 preceding siblings ...)
  2021-01-23 14:31 ` [PULL 18/31] meson: Summarize compilation-related information altogether Paolo Bonzini
@ 2021-01-23 14:31 ` Paolo Bonzini
  2021-01-23 14:31 ` [PULL 20/31] meson: Display block layer information altogether Paolo Bonzini
                   ` (13 subsequent siblings)
  32 siblings, 0 replies; 53+ messages in thread
From: Paolo Bonzini @ 2021-01-23 14:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Philippe Mathieu-Daudé

From: Philippe Mathieu-Daudé <philmd@redhat.com>

Display accelerators and selected targets altogether,
avoid to display unuseful information when not relevant.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210121095616.1471869-6-philmd@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 meson.build | 38 ++++++++++++++++++++++++--------------
 1 file changed, 24 insertions(+), 14 deletions(-)

diff --git a/meson.build b/meson.build
index 3b2332b94d..7bd96f8a8a 100644
--- a/meson.build
+++ b/meson.build
@@ -2277,6 +2277,8 @@ summary(summary_info, bool_yn: true, section: 'Host binaries')
 # Configurable features
 summary_info = {}
 summary_info += {'Documentation':     build_docs}
+summary_info += {'system-mode emulation': have_system}
+summary_info += {'user-mode emulation': have_user}
 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')
@@ -2366,8 +2368,30 @@ summary_info += {'sparse':            sparse.found() ? sparse.full_path() : fals
 summary_info += {'mingw32 support':   targetos == 'windows'}
 summary(summary_info, bool_yn: true, section: 'Compilation')
 
+# Targets and accelerators
 summary_info = {}
+if have_system
+  summary_info += {'KVM support':       config_all.has_key('CONFIG_KVM')}
+  summary_info += {'HAX support':       config_all.has_key('CONFIG_HAX')}
+  summary_info += {'HVF support':       config_all.has_key('CONFIG_HVF')}
+  summary_info += {'WHPX support':      config_all.has_key('CONFIG_WHPX')}
+  summary_info += {'Xen support':       config_host.has_key('CONFIG_XEN_BACKEND')}
+  if config_host.has_key('CONFIG_XEN_BACKEND')
+    summary_info += {'xen ctrl version':  config_host['CONFIG_XEN_CTRL_INTERFACE_VERSION']}
+  endif
+endif
+summary_info += {'TCG support':       config_all.has_key('CONFIG_TCG')}
+if config_all.has_key('CONFIG_TCG')
+  summary_info += {'TCG debug enabled': config_host.has_key('CONFIG_DEBUG_TCG')}
+  summary_info += {'TCG interpreter':   tcg_arch == 'tci'}
+endif
 summary_info += {'target list':       ' '.join(target_dirs)}
+if have_system
+  summary_info += {'default devices':   get_option('default_devices')}
+endif
+summary(summary_info, bool_yn: true, section: 'Targets and accelerators')
+
+summary_info = {}
 if targetos == 'darwin'
   summary_info += {'Cocoa support':   cocoa.found()}
 endif
@@ -2412,25 +2436,12 @@ if vnc.found()
   summary_info += {'VNC JPEG support':  jpeg.found()}
   summary_info += {'VNC PNG support':   png.found()}
 endif
-summary_info += {'xen support':       config_host.has_key('CONFIG_XEN_BACKEND')}
-if config_host.has_key('CONFIG_XEN_BACKEND')
-  summary_info += {'xen ctrl version':  config_host['CONFIG_XEN_CTRL_INTERFACE_VERSION']}
-endif
 summary_info += {'brlapi support':    brlapi.found()}
 summary_info += {'vde support':       config_host.has_key('CONFIG_VDE')}
 summary_info += {'netmap support':    config_host.has_key('CONFIG_NETMAP')}
 summary_info += {'Linux AIO support': config_host.has_key('CONFIG_LINUX_AIO')}
 summary_info += {'Linux io_uring support': config_host.has_key('CONFIG_LINUX_IO_URING')}
 summary_info += {'ATTR/XATTR support': libattr.found()}
-summary_info += {'KVM support':       config_all.has_key('CONFIG_KVM')}
-summary_info += {'HAX support':       config_all.has_key('CONFIG_HAX')}
-summary_info += {'HVF support':       config_all.has_key('CONFIG_HVF')}
-summary_info += {'WHPX support':      config_all.has_key('CONFIG_WHPX')}
-summary_info += {'TCG support':       config_all.has_key('CONFIG_TCG')}
-if config_all.has_key('CONFIG_TCG')
-  summary_info += {'TCG debug enabled': config_host.has_key('CONFIG_DEBUG_TCG')}
-  summary_info += {'TCG interpreter':   tcg_arch == 'tci'}
-endif
 summary_info += {'RDMA support':      config_host.has_key('CONFIG_RDMA')}
 summary_info += {'PVRDMA support':    config_host.has_key('CONFIG_PVRDMA')}
 summary_info += {'fdt support':       fdt_opt == 'disabled' ? false : fdt_opt}
@@ -2482,7 +2493,6 @@ summary_info += {'capstone':          capstone_opt == 'disabled' ? false : capst
 summary_info += {'libpmem support':   config_host.has_key('CONFIG_LIBPMEM')}
 summary_info += {'libdaxctl support': config_host.has_key('CONFIG_LIBDAXCTL')}
 summary_info += {'libudev':           libudev.found()}
-summary_info += {'default devices':   get_option('default_devices')}
 summary_info += {'rng-none':          config_host.has_key('CONFIG_RNG_NONE')}
 summary_info += {'Linux keyring':     config_host.has_key('CONFIG_SECRET_KEYRING')}
 summary_info += {'FUSE exports':      fuse.found()}
-- 
2.26.2




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

* [PULL 20/31] meson: Display block layer information altogether
  2021-01-23 14:30 [PULL 00/31] Misc patches for 2020-01-21 Paolo Bonzini
                   ` (18 preceding siblings ...)
  2021-01-23 14:31 ` [PULL 19/31] meson: Display accelerators and selected targets altogether Paolo Bonzini
@ 2021-01-23 14:31 ` Paolo Bonzini
  2021-01-23 14:31 ` [PULL 21/31] meson: Display crypto-related " Paolo Bonzini
                   ` (12 subsequent siblings)
  32 siblings, 0 replies; 53+ messages in thread
From: Paolo Bonzini @ 2021-01-23 14:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Philippe Mathieu-Daudé

From: Philippe Mathieu-Daudé <philmd@redhat.com>

Display block layer information altogether,
when it is relevant.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210121095616.1471869-7-philmd@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 meson.build | 43 +++++++++++++++++++++++++------------------
 1 file changed, 25 insertions(+), 18 deletions(-)

diff --git a/meson.build b/meson.build
index 7bd96f8a8a..dbac95890d 100644
--- a/meson.build
+++ b/meson.build
@@ -2279,6 +2279,7 @@ summary_info = {}
 summary_info += {'Documentation':     build_docs}
 summary_info += {'system-mode emulation': have_system}
 summary_info += {'user-mode emulation': have_user}
+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')
@@ -2391,6 +2392,30 @@ if have_system
 endif
 summary(summary_info, bool_yn: true, section: 'Targets and accelerators')
 
+# Block layer
+summary_info = {}
+summary_info += {'coroutine backend': config_host['CONFIG_COROUTINE_BACKEND']}
+summary_info += {'coroutine pool':    config_host['CONFIG_COROUTINE_POOL'] == '1'}
+if have_block
+  summary_info += {'Block whitelist (rw)': config_host['CONFIG_BDRV_RW_WHITELIST']}
+  summary_info += {'Block whitelist (ro)': config_host['CONFIG_BDRV_RO_WHITELIST']}
+  summary_info += {'VirtFS support':    have_virtfs}
+  summary_info += {'build virtiofs daemon': have_virtiofsd}
+  summary_info += {'Live block migration': config_host.has_key('CONFIG_LIVE_BLOCK_MIGRATION')}
+  summary_info += {'replication support': config_host.has_key('CONFIG_REPLICATION')}
+  summary_info += {'bochs support':     config_host.has_key('CONFIG_BOCHS')}
+  summary_info += {'cloop support':     config_host.has_key('CONFIG_CLOOP')}
+  summary_info += {'dmg support':       config_host.has_key('CONFIG_DMG')}
+  summary_info += {'qcow v1 support':   config_host.has_key('CONFIG_QCOW1')}
+  summary_info += {'vdi support':       config_host.has_key('CONFIG_VDI')}
+  summary_info += {'vvfat support':     config_host.has_key('CONFIG_VVFAT')}
+  summary_info += {'qed support':       config_host.has_key('CONFIG_QED')}
+  summary_info += {'parallels support': config_host.has_key('CONFIG_PARALLELS')}
+  summary_info += {'sheepdog support':  config_host.has_key('CONFIG_SHEEPDOG')}
+  summary_info += {'FUSE exports':      fuse.found()}
+endif
+summary(summary_info, bool_yn: true, section: 'Block layer support')
+
 summary_info = {}
 if targetos == 'darwin'
   summary_info += {'Cocoa support':   cocoa.found()}
@@ -2425,10 +2450,6 @@ summary_info += {'curses support':    curses.found()}
 # TODO: add back version
 summary_info += {'virgl support':     config_host.has_key('CONFIG_VIRGL')}
 summary_info += {'curl support':      curl.found()}
-summary_info += {'Block whitelist (rw)': config_host['CONFIG_BDRV_RW_WHITELIST']}
-summary_info += {'Block whitelist (ro)': config_host['CONFIG_BDRV_RO_WHITELIST']}
-summary_info += {'VirtFS support':    have_virtfs}
-summary_info += {'build virtiofs daemon': have_virtiofsd}
 summary_info += {'Multipath support': mpathpersist.found()}
 summary_info += {'VNC support':       vnc.found()}
 if vnc.found()
@@ -2465,13 +2486,10 @@ if targetos == 'windows'
   endif
 endif
 summary_info += {'seccomp support':   seccomp.found()}
-summary_info += {'coroutine backend': config_host['CONFIG_COROUTINE_BACKEND']}
-summary_info += {'coroutine pool':    config_host['CONFIG_COROUTINE_POOL'] == '1'}
 summary_info += {'crypto afalg':      config_host.has_key('CONFIG_AF_ALG')}
 summary_info += {'GlusterFS support': glusterfs.found()}
 summary_info += {'TPM support':       config_host.has_key('CONFIG_TPM')}
 summary_info += {'libssh support':    config_host.has_key('CONFIG_LIBSSH')}
-summary_info += {'Live block migration': config_host.has_key('CONFIG_LIVE_BLOCK_MIGRATION')}
 summary_info += {'lzo support':       lzo.found()}
 summary_info += {'snappy support':    snappy.found()}
 summary_info += {'bzip2 support':     libbzip2.found()}
@@ -2479,23 +2497,12 @@ summary_info += {'lzfse support':     liblzfse.found()}
 summary_info += {'zstd support':      zstd.found()}
 summary_info += {'NUMA host support': config_host.has_key('CONFIG_NUMA')}
 summary_info += {'libxml2':           config_host.has_key('CONFIG_LIBXML2')}
-summary_info += {'replication support': config_host.has_key('CONFIG_REPLICATION')}
-summary_info += {'bochs support':     config_host.has_key('CONFIG_BOCHS')}
-summary_info += {'cloop support':     config_host.has_key('CONFIG_CLOOP')}
-summary_info += {'dmg support':       config_host.has_key('CONFIG_DMG')}
-summary_info += {'qcow v1 support':   config_host.has_key('CONFIG_QCOW1')}
-summary_info += {'vdi support':       config_host.has_key('CONFIG_VDI')}
-summary_info += {'vvfat support':     config_host.has_key('CONFIG_VVFAT')}
-summary_info += {'qed support':       config_host.has_key('CONFIG_QED')}
-summary_info += {'parallels support': config_host.has_key('CONFIG_PARALLELS')}
-summary_info += {'sheepdog support':  config_host.has_key('CONFIG_SHEEPDOG')}
 summary_info += {'capstone':          capstone_opt == 'disabled' ? false : capstone_opt}
 summary_info += {'libpmem support':   config_host.has_key('CONFIG_LIBPMEM')}
 summary_info += {'libdaxctl support': config_host.has_key('CONFIG_LIBDAXCTL')}
 summary_info += {'libudev':           libudev.found()}
 summary_info += {'rng-none':          config_host.has_key('CONFIG_RNG_NONE')}
 summary_info += {'Linux keyring':     config_host.has_key('CONFIG_SECRET_KEYRING')}
-summary_info += {'FUSE exports':      fuse.found()}
 summary_info += {'FUSE lseek':        fuse_lseek.found()}
 summary(summary_info, bool_yn: true)
 
-- 
2.26.2




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

* [PULL 21/31] meson: Display crypto-related information altogether
  2021-01-23 14:30 [PULL 00/31] Misc patches for 2020-01-21 Paolo Bonzini
                   ` (19 preceding siblings ...)
  2021-01-23 14:31 ` [PULL 20/31] meson: Display block layer information altogether Paolo Bonzini
@ 2021-01-23 14:31 ` Paolo Bonzini
  2021-01-23 14:31 ` [PULL 22/31] meson: Add a section header for library dependencies Paolo Bonzini
                   ` (11 subsequent siblings)
  32 siblings, 0 replies; 53+ messages in thread
From: Paolo Bonzini @ 2021-01-23 14:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Philippe Mathieu-Daudé

From: Philippe Mathieu-Daudé <philmd@redhat.com>

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210121095616.1471869-8-philmd@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 meson.build | 32 ++++++++++++++++++--------------
 1 file changed, 18 insertions(+), 14 deletions(-)

diff --git a/meson.build b/meson.build
index dbac95890d..abd2c05a82 100644
--- a/meson.build
+++ b/meson.build
@@ -2416,18 +2416,8 @@ if have_block
 endif
 summary(summary_info, bool_yn: true, section: 'Block layer support')
 
+# Crypto
 summary_info = {}
-if targetos == 'darwin'
-  summary_info += {'Cocoa support':   cocoa.found()}
-endif
-# TODO: add back version
-summary_info += {'SDL support':       sdl.found()}
-summary_info += {'SDL image support': sdl_image.found()}
-# TODO: add back version
-summary_info += {'GTK support':       gtk.found()}
-summary_info += {'pixman':            pixman.found()}
-# TODO: add back version
-summary_info += {'VTE support':       config_host.has_key('CONFIG_VTE')}
 summary_info += {'TLS priority':      config_host['CONFIG_TLS_PRIORITY']}
 summary_info += {'GNUTLS support':    config_host.has_key('CONFIG_GNUTLS')}
 # TODO: add back version
@@ -2441,6 +2431,23 @@ summary_info += {'nettle':            config_host.has_key('CONFIG_NETTLE')}
 if config_host.has_key('CONFIG_NETTLE')
    summary_info += {'  XTS':             not config_host.has_key('CONFIG_QEMU_PRIVATE_XTS')}
 endif
+summary_info += {'crypto afalg':      config_host.has_key('CONFIG_AF_ALG')}
+summary_info += {'rng-none':          config_host.has_key('CONFIG_RNG_NONE')}
+summary_info += {'Linux keyring':     config_host.has_key('CONFIG_SECRET_KEYRING')}
+summary(summary_info, bool_yn: true, section: 'Crypto')
+
+summary_info = {}
+if targetos == 'darwin'
+  summary_info += {'Cocoa support':   cocoa.found()}
+endif
+# TODO: add back version
+summary_info += {'SDL support':       sdl.found()}
+summary_info += {'SDL image support': sdl_image.found()}
+# TODO: add back version
+summary_info += {'GTK support':       gtk.found()}
+summary_info += {'pixman':            pixman.found()}
+# TODO: add back version
+summary_info += {'VTE support':       config_host.has_key('CONFIG_VTE')}
 # TODO: add back version
 summary_info += {'slirp support':     slirp_opt == 'disabled' ? false : slirp_opt}
 summary_info += {'libtasn1':          config_host.has_key('CONFIG_TASN1')}
@@ -2486,7 +2493,6 @@ if targetos == 'windows'
   endif
 endif
 summary_info += {'seccomp support':   seccomp.found()}
-summary_info += {'crypto afalg':      config_host.has_key('CONFIG_AF_ALG')}
 summary_info += {'GlusterFS support': glusterfs.found()}
 summary_info += {'TPM support':       config_host.has_key('CONFIG_TPM')}
 summary_info += {'libssh support':    config_host.has_key('CONFIG_LIBSSH')}
@@ -2501,8 +2507,6 @@ summary_info += {'capstone':          capstone_opt == 'disabled' ? false : capst
 summary_info += {'libpmem support':   config_host.has_key('CONFIG_LIBPMEM')}
 summary_info += {'libdaxctl support': config_host.has_key('CONFIG_LIBDAXCTL')}
 summary_info += {'libudev':           libudev.found()}
-summary_info += {'rng-none':          config_host.has_key('CONFIG_RNG_NONE')}
-summary_info += {'Linux keyring':     config_host.has_key('CONFIG_SECRET_KEYRING')}
 summary_info += {'FUSE lseek':        fuse_lseek.found()}
 summary(summary_info, bool_yn: true)
 
-- 
2.26.2




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

* [PULL 22/31] meson: Add a section header for library dependencies
  2021-01-23 14:30 [PULL 00/31] Misc patches for 2020-01-21 Paolo Bonzini
                   ` (20 preceding siblings ...)
  2021-01-23 14:31 ` [PULL 21/31] meson: Display crypto-related " Paolo Bonzini
@ 2021-01-23 14:31 ` Paolo Bonzini
  2021-01-23 14:31 ` [PULL 23/31] meson.build: Declare global edk2_targets / install_edk2_blobs variables Paolo Bonzini
                   ` (10 subsequent siblings)
  32 siblings, 0 replies; 53+ messages in thread
From: Paolo Bonzini @ 2021-01-23 14:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Philippe Mathieu-Daudé

From: Philippe Mathieu-Daudé <philmd@redhat.com>

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210121095616.1471869-9-philmd@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 meson.build | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/meson.build b/meson.build
index abd2c05a82..bd6ad06d58 100644
--- a/meson.build
+++ b/meson.build
@@ -2436,6 +2436,7 @@ summary_info += {'rng-none':          config_host.has_key('CONFIG_RNG_NONE')}
 summary_info += {'Linux keyring':     config_host.has_key('CONFIG_SECRET_KEYRING')}
 summary(summary_info, bool_yn: true, section: 'Crypto')
 
+# Libraries
 summary_info = {}
 if targetos == 'darwin'
   summary_info += {'Cocoa support':   cocoa.found()}
@@ -2508,7 +2509,7 @@ summary_info += {'libpmem support':   config_host.has_key('CONFIG_LIBPMEM')}
 summary_info += {'libdaxctl support': config_host.has_key('CONFIG_LIBDAXCTL')}
 summary_info += {'libudev':           libudev.found()}
 summary_info += {'FUSE lseek':        fuse_lseek.found()}
-summary(summary_info, bool_yn: true)
+summary(summary_info, bool_yn: true, section: 'Dependencies')
 
 if not supported_cpus.contains(cpu)
   message()
-- 
2.26.2




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

* [PULL 23/31] meson.build: Declare global edk2_targets / install_edk2_blobs variables
  2021-01-23 14:30 [PULL 00/31] Misc patches for 2020-01-21 Paolo Bonzini
                   ` (21 preceding siblings ...)
  2021-01-23 14:31 ` [PULL 22/31] meson: Add a section header for library dependencies Paolo Bonzini
@ 2021-01-23 14:31 ` Paolo Bonzini
  2021-01-23 14:31 ` [PULL 24/31] meson.build: Detect bzip2 program Paolo Bonzini
                   ` (9 subsequent siblings)
  32 siblings, 0 replies; 53+ messages in thread
From: Paolo Bonzini @ 2021-01-23 14:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Philippe Mathieu-Daudé

From: Philippe Mathieu-Daudé <philmd@redhat.com>

Globally declare in the main meson.build:
- the list of EDK2 targets,
- whether the EDK2 blobs have to be installed.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210114174509.2944817-2-philmd@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 meson.build                     |  8 ++++++++
 pc-bios/descriptors/meson.build | 30 ++++++++++++++++--------------
 pc-bios/meson.build             |  5 +----
 3 files changed, 25 insertions(+), 18 deletions(-)

diff --git a/meson.build b/meson.build
index bd6ad06d58..ed4eb70cb5 100644
--- a/meson.build
+++ b/meson.build
@@ -88,6 +88,14 @@ if cpu in ['x86', 'x86_64']
   }
 endif
 
+edk2_targets = [ 'arm-softmmu', 'aarch64-softmmu', 'i386-softmmu', 'x86_64-softmmu' ]
+install_edk2_blobs = false
+if get_option('install_blobs')
+  foreach target : target_dirs
+    install_edk2_blobs = install_edk2_blobs or target in edk2_targets
+  endforeach
+endif
+
 ##################
 # Compiler flags #
 ##################
diff --git a/pc-bios/descriptors/meson.build b/pc-bios/descriptors/meson.build
index 7040834573..ac6ec66b00 100644
--- a/pc-bios/descriptors/meson.build
+++ b/pc-bios/descriptors/meson.build
@@ -1,14 +1,16 @@
-foreach f: [
-  '50-edk2-i386-secure.json',
-  '50-edk2-x86_64-secure.json',
-  '60-edk2-aarch64.json',
-  '60-edk2-arm.json',
-  '60-edk2-i386.json',
-  '60-edk2-x86_64.json'
-]
-  configure_file(input: files(f),
-                 output: f,
-                 configuration: {'DATADIR': qemu_datadir},
-                 install: get_option('install_blobs'),
-                 install_dir: qemu_datadir / 'firmware')
-endforeach
+if install_edk2_blobs
+  foreach f: [
+    '50-edk2-i386-secure.json',
+    '50-edk2-x86_64-secure.json',
+    '60-edk2-aarch64.json',
+    '60-edk2-arm.json',
+    '60-edk2-i386.json',
+    '60-edk2-x86_64.json'
+  ]
+    configure_file(input: files(f),
+                   output: f,
+                   configuration: {'DATADIR': qemu_datadir},
+                   install: get_option('install_blobs'),
+                   install_dir: qemu_datadir / 'firmware')
+  endforeach
+endif
diff --git a/pc-bios/meson.build b/pc-bios/meson.build
index fab323af84..6a341b6cea 100644
--- a/pc-bios/meson.build
+++ b/pc-bios/meson.build
@@ -1,7 +1,4 @@
-if 'arm-softmmu' in target_dirs or \
-    'aarch64-softmmu' in target_dirs or \
-    'i386-softmmu' in target_dirs or \
-    'x86_64-softmmu' in target_dirs
+if install_edk2_blobs
   bzip2 = find_program('bzip2', required: true)
   fds = [
     'edk2-aarch64-code.fd',
-- 
2.26.2




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

* [PULL 24/31] meson.build: Detect bzip2 program
  2021-01-23 14:30 [PULL 00/31] Misc patches for 2020-01-21 Paolo Bonzini
                   ` (22 preceding siblings ...)
  2021-01-23 14:31 ` [PULL 23/31] meson.build: Declare global edk2_targets / install_edk2_blobs variables Paolo Bonzini
@ 2021-01-23 14:31 ` Paolo Bonzini
  2021-01-23 14:31 ` [PULL 25/31] acceptance: switch to QMP change-vnc-password command Paolo Bonzini
                   ` (8 subsequent siblings)
  32 siblings, 0 replies; 53+ messages in thread
From: Paolo Bonzini @ 2021-01-23 14:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: John Snow, Philippe Mathieu-Daudé

From: Philippe Mathieu-Daudé <philmd@redhat.com>

The --enable-bzip2/--disable-bzip2 configure arguments are
somehow misleading, they check for the bzip2 library, not
the bzip2 program.

We need the bzip2 program to install the EDK2 firmware blobs
(see commit 623ef637a2e "configure: Check bzip2 is available").

Check if the bzip2 program in the global meson.build to avoid
the configuration to succeed, but a later when trying to install
the firmware blobs:

    ../pc-bios/meson.build:5:2: ERROR: Program 'bzip2' not found

Reported-by: John Snow <jsnow@redhat.com>
Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Fixes: c8d5450bba3 ("configure: move install_blobs from configure to meson")
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210114174509.2944817-3-philmd@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 meson.build         | 2 ++
 pc-bios/meson.build | 1 -
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/meson.build b/meson.build
index ed4eb70cb5..95ef1c8adf 100644
--- a/meson.build
+++ b/meson.build
@@ -96,6 +96,8 @@ if get_option('install_blobs')
   endforeach
 endif
 
+bzip2 = find_program('bzip2', required: install_edk2_blobs)
+
 ##################
 # Compiler flags #
 ##################
diff --git a/pc-bios/meson.build b/pc-bios/meson.build
index 6a341b6cea..af95c5d1f1 100644
--- a/pc-bios/meson.build
+++ b/pc-bios/meson.build
@@ -1,5 +1,4 @@
 if install_edk2_blobs
-  bzip2 = find_program('bzip2', required: true)
   fds = [
     'edk2-aarch64-code.fd',
     'edk2-arm-code.fd',
-- 
2.26.2




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

* [PULL 25/31] acceptance: switch to QMP change-vnc-password command
  2021-01-23 14:30 [PULL 00/31] Misc patches for 2020-01-21 Paolo Bonzini
                   ` (23 preceding siblings ...)
  2021-01-23 14:31 ` [PULL 24/31] meson.build: Detect bzip2 program Paolo Bonzini
@ 2021-01-23 14:31 ` Paolo Bonzini
  2021-01-23 14:31 ` [PULL 26/31] hmp: remove "change vnc TARGET" command Paolo Bonzini
                   ` (7 subsequent siblings)
  32 siblings, 0 replies; 53+ messages in thread
From: Paolo Bonzini @ 2021-01-23 14:31 UTC (permalink / raw)
  To: qemu-devel

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 tests/acceptance/vnc.py | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/tests/acceptance/vnc.py b/tests/acceptance/vnc.py
index 3f40bc2be1..22656bbcc2 100644
--- a/tests/acceptance/vnc.py
+++ b/tests/acceptance/vnc.py
@@ -24,10 +24,8 @@ class Vnc(Test):
         self.vm.add_args('-nodefaults', '-S')
         self.vm.launch()
         self.assertFalse(self.vm.qmp('query-vnc')['return']['enabled'])
-        set_password_response = self.vm.qmp('change',
-                                            device='vnc',
-                                            target='password',
-                                            arg='new_password')
+        set_password_response = self.vm.qmp('change-vnc-password',
+                                            password='new_password')
         self.assertIn('error', set_password_response)
         self.assertEqual(set_password_response['error']['class'],
                          'GenericError')
@@ -38,10 +36,8 @@ class Vnc(Test):
         self.vm.add_args('-nodefaults', '-S', '-vnc', ':0')
         self.vm.launch()
         self.assertTrue(self.vm.qmp('query-vnc')['return']['enabled'])
-        set_password_response = self.vm.qmp('change',
-                                            device='vnc',
-                                            target='password',
-                                            arg='new_password')
+        set_password_response = self.vm.qmp('change-vnc-password',
+                                            password='new_password')
         self.assertIn('error', set_password_response)
         self.assertEqual(set_password_response['error']['class'],
                          'GenericError')
@@ -52,8 +48,6 @@ class Vnc(Test):
         self.vm.add_args('-nodefaults', '-S', '-vnc', ':0,password')
         self.vm.launch()
         self.assertTrue(self.vm.qmp('query-vnc')['return']['enabled'])
-        set_password_response = self.vm.qmp('change',
-                                            device='vnc',
-                                            target='password',
-                                            arg='new_password')
+        set_password_response = self.vm.qmp('change-vnc-password',
+                                            password='new_password')
         self.assertEqual(set_password_response['return'], {})
-- 
2.26.2




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

* [PULL 26/31] hmp: remove "change vnc TARGET" command
  2021-01-23 14:30 [PULL 00/31] Misc patches for 2020-01-21 Paolo Bonzini
                   ` (24 preceding siblings ...)
  2021-01-23 14:31 ` [PULL 25/31] acceptance: switch to QMP change-vnc-password command Paolo Bonzini
@ 2021-01-23 14:31 ` Paolo Bonzini
  2021-01-23 14:31 ` [PULL 27/31] qmp: remove deprecated "change" command Paolo Bonzini
                   ` (6 subsequent siblings)
  32 siblings, 0 replies; 53+ messages in thread
From: Paolo Bonzini @ 2021-01-23 14:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann

The HMP command \"change vnc TARGET\" is messy:

- it takes an ugly shortcut to determine if the option has an "id",
with incorrect results if "id=" is not preceded by an unescaped
comma.

- it deletes the existing QemuOpts and does not try to rollback
if the parsing fails (which is not causing problems, but only due to
how VNC options are parsed)

- because it uses the same parsing function as "-vnc", it forces
the latter to not support "-vnc help".

On top of this, it uses a deprecated QMP command, thus getting in
the way of removing the QMP command.  Since the usecase for the
command is not clear, just remove it and send "change vnc password"
directly to the QMP "change-vnc-password" command.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Message-Id: <20210120144235.345983-2-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 docs/system/removed-features.rst | 6 ++++++
 hmp-commands.hx                  | 6 ------
 monitor/hmp-cmds.c               | 7 +++++--
 3 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/docs/system/removed-features.rst b/docs/system/removed-features.rst
index 430fc33ca1..5b0ff6ab1f 100644
--- a/docs/system/removed-features.rst
+++ b/docs/system/removed-features.rst
@@ -68,6 +68,12 @@ The ``[hub_id name]`` parameter tuple of the 'hostfwd_add' and
 Use ``device_add`` for hotplugging vCPUs instead of ``cpu-add``.  See
 documentation of ``query-hotpluggable-cpus`` for additional details.
 
+``change vnc TARGET`` (removed in 6.0)
+''''''''''''''''''''''''''''''''''''''
+
+No replacement.  The ``change vnc password`` and ``change DEVICE MEDIUM``
+commands are not affected.
+
 Guest Emulator ISAs
 -------------------
 
diff --git a/hmp-commands.hx b/hmp-commands.hx
index 73e0832ea1..d4001f9c5d 100644
--- a/hmp-commands.hx
+++ b/hmp-commands.hx
@@ -231,12 +231,6 @@ SRST
     read-write
       Makes the device writable.
 
-  ``change vnc`` *display*,\ *options*
-    Change the configuration of the VNC server. The valid syntax for *display*
-    and *options* are described at :ref:`sec_005finvocation`. eg::
-
-      (qemu) change vnc localhost:1
-
   ``change vnc password`` [*password*]
 
     Change the password associated with the VNC server. If the new password
diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c
index fd4d77e246..499647a578 100644
--- a/monitor/hmp-cmds.c
+++ b/monitor/hmp-cmds.c
@@ -1521,13 +1521,16 @@ void hmp_change(Monitor *mon, const QDict *qdict)
         }
         if (strcmp(target, "passwd") == 0 ||
             strcmp(target, "password") == 0) {
-            if (!arg) {
+            if (arg) {
                 MonitorHMP *hmp_mon = container_of(mon, MonitorHMP, common);
                 monitor_read_password(hmp_mon, hmp_change_read_arg, NULL);
                 return;
+            } else {
+                qmp_change_vnc_password(arg, &err);
             }
+        } else {
+            monitor_printf(mon, "Expected 'password' after 'vnc'\n");
         }
-        qmp_change("vnc", target, !!arg, arg, &err);
     } else
 #endif
     {
-- 
2.26.2




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

* [PULL 27/31] qmp: remove deprecated "change" command
  2021-01-23 14:30 [PULL 00/31] Misc patches for 2020-01-21 Paolo Bonzini
                   ` (25 preceding siblings ...)
  2021-01-23 14:31 ` [PULL 26/31] hmp: remove "change vnc TARGET" command Paolo Bonzini
@ 2021-01-23 14:31 ` Paolo Bonzini
  2021-01-23 14:31 ` [PULL 28/31] vnc: support "-vnc help" Paolo Bonzini
                   ` (5 subsequent siblings)
  32 siblings, 0 replies; 53+ messages in thread
From: Paolo Bonzini @ 2021-01-23 14:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Philippe Mathieu-Daudé, Gerd Hoffmann

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210120144235.345983-3-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 docs/system/deprecated.rst       |  5 ----
 docs/system/removed-features.rst |  5 ++++
 monitor/qmp-cmds.c               | 51 --------------------------------
 qapi/misc.json                   | 49 ------------------------------
 4 files changed, 5 insertions(+), 105 deletions(-)

diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst
index e20bfcb17a..651182b2df 100644
--- a/docs/system/deprecated.rst
+++ b/docs/system/deprecated.rst
@@ -131,11 +131,6 @@ devices.  It is possible to use drives the board doesn't pick up with
 QEMU Machine Protocol (QMP) commands
 ------------------------------------
 
-``change`` (since 2.5.0)
-''''''''''''''''''''''''
-
-Use ``blockdev-change-medium`` or ``change-vnc-password`` instead.
-
 ``blockdev-open-tray``, ``blockdev-close-tray`` argument ``device`` (since 2.8.0)
 '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
 
diff --git a/docs/system/removed-features.rst b/docs/system/removed-features.rst
index 5b0ff6ab1f..88b81a6156 100644
--- a/docs/system/removed-features.rst
+++ b/docs/system/removed-features.rst
@@ -53,6 +53,11 @@ are automatically loaded from qcow2 images.
 Use ``device_add`` for hotplugging vCPUs instead of ``cpu-add``.  See
 documentation of ``query-hotpluggable-cpus`` for additional details.
 
+``change`` (removed in 6.0)
+'''''''''''''''''''''''''''
+
+Use ``blockdev-change-medium`` or ``change-vnc-password`` instead.
+
 Human Monitor Protocol (HMP) commands
 -------------------------------------
 
diff --git a/monitor/qmp-cmds.c b/monitor/qmp-cmds.c
index 34f7e75b7b..990936136c 100644
--- a/monitor/qmp-cmds.c
+++ b/monitor/qmp-cmds.c
@@ -251,58 +251,7 @@ void qmp_change_vnc_password(const char *password, Error **errp)
         error_setg(errp, "Could not set password");
     }
 }
-
-static void qmp_change_vnc_listen(const char *target, Error **errp)
-{
-    QemuOptsList *olist = qemu_find_opts("vnc");
-    QemuOpts *opts;
-
-    if (strstr(target, "id=")) {
-        error_setg(errp, "id not supported");
-        return;
-    }
-
-    opts = qemu_opts_find(olist, "default");
-    if (opts) {
-        qemu_opts_del(opts);
-    }
-    opts = vnc_parse(target, errp);
-    if (!opts) {
-        return;
-    }
-
-    vnc_display_open("default", errp);
-}
-
-static void qmp_change_vnc(const char *target, bool has_arg, const char *arg,
-                           Error **errp)
-{
-    if (strcmp(target, "passwd") == 0 || strcmp(target, "password") == 0) {
-        if (!has_arg) {
-            error_setg(errp, QERR_MISSING_PARAMETER, "password");
-        } else {
-            qmp_change_vnc_password(arg, errp);
-        }
-    } else {
-        qmp_change_vnc_listen(target, errp);
-    }
-}
-#endif /* !CONFIG_VNC */
-
-void qmp_change(const char *device, const char *target,
-                bool has_arg, const char *arg, Error **errp)
-{
-    if (strcmp(device, "vnc") == 0) {
-#ifdef CONFIG_VNC
-        qmp_change_vnc(target, has_arg, arg, errp);
-#else
-        error_setg(errp, QERR_FEATURE_DISABLED, "vnc");
 #endif
-    } else {
-        qmp_blockdev_change_medium(true, device, false, NULL, target,
-                                   has_arg, arg, false, 0, errp);
-    }
-}
 
 void qmp_add_client(const char *protocol, const char *fdname,
                     bool has_skipauth, bool skipauth, bool has_tls, bool tls,
diff --git a/qapi/misc.json b/qapi/misc.json
index 27ccd7385f..156f98203e 100644
--- a/qapi/misc.json
+++ b/qapi/misc.json
@@ -238,55 +238,6 @@
   'returns': 'str',
   'features': [ 'savevm-monitor-nodes' ] }
 
-##
-# @change:
-#
-# This command is multiple commands multiplexed together.
-#
-# @device: This is normally the name of a block device but it may also be 'vnc'.
-#          when it's 'vnc', then sub command depends on @target
-#
-# @target: If @device is a block device, then this is the new filename.
-#          If @device is 'vnc', then if the value 'password' selects the vnc
-#          change password command.   Otherwise, this specifies a new server URI
-#          address to listen to for VNC connections.
-#
-# @arg: If @device is a block device, then this is an optional format to open
-#       the device with.
-#       If @device is 'vnc' and @target is 'password', this is the new VNC
-#       password to set.  See change-vnc-password for additional notes.
-#
-# Features:
-# @deprecated: This command is deprecated.  For changing block
-#              devices, use 'blockdev-change-medium' instead; for changing VNC
-#              parameters, use 'change-vnc-password' instead.
-#
-# Returns: - Nothing on success.
-#          - If @device is not a valid block device, DeviceNotFound
-#
-# Since: 0.14
-#
-# Example:
-#
-# 1. Change a removable medium
-#
-# -> { "execute": "change",
-#      "arguments": { "device": "ide1-cd0",
-#                     "target": "/srv/images/Fedora-12-x86_64-DVD.iso" } }
-# <- { "return": {} }
-#
-# 2. Change VNC password
-#
-# -> { "execute": "change",
-#      "arguments": { "device": "vnc", "target": "password",
-#                     "arg": "foobar1" } }
-# <- { "return": {} }
-#
-##
-{ 'command': 'change',
-  'data': {'device': 'str', 'target': 'str', '*arg': 'str'},
-  'features': [ 'deprecated' ] }
-
 ##
 # @getfd:
 #
-- 
2.26.2




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

* [PULL 28/31] vnc: support "-vnc help"
  2021-01-23 14:30 [PULL 00/31] Misc patches for 2020-01-21 Paolo Bonzini
                   ` (26 preceding siblings ...)
  2021-01-23 14:31 ` [PULL 27/31] qmp: remove deprecated "change" command Paolo Bonzini
@ 2021-01-23 14:31 ` Paolo Bonzini
  2021-01-23 14:31 ` [PULL 29/31] qemu-option: clean up id vs. list->merge_lists Paolo Bonzini
                   ` (4 subsequent siblings)
  32 siblings, 0 replies; 53+ messages in thread
From: Paolo Bonzini @ 2021-01-23 14:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann

Use qemu_opts_parse_noisily now that HMP does not call
vnc_parse anymore.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Message-Id: <20210120144235.345983-4-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 include/ui/console.h | 2 +-
 softmmu/vl.c         | 6 +++---
 ui/vnc-stubs.c       | 7 +++----
 ui/vnc.c             | 8 ++++----
 4 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/include/ui/console.h b/include/ui/console.h
index 5dd21976a3..7a3fc11abf 100644
--- a/include/ui/console.h
+++ b/include/ui/console.h
@@ -439,7 +439,7 @@ void vnc_display_open(const char *id, Error **errp);
 void vnc_display_add_client(const char *id, int csock, bool skipauth);
 int vnc_display_password(const char *id, const char *password);
 int vnc_display_pw_expire(const char *id, time_t expires);
-QemuOpts *vnc_parse(const char *str, Error **errp);
+void vnc_parse(const char *str);
 int vnc_init_func(void *opaque, QemuOpts *opts, Error **errp);
 
 /* input.c */
diff --git a/softmmu/vl.c b/softmmu/vl.c
index 59304261cf..a8876b8965 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -1113,7 +1113,7 @@ static void parse_display(const char *p)
          * display access.
          */
         if (*opts == '=') {
-            vnc_parse(opts + 1, &error_fatal);
+            vnc_parse(opts + 1);
         } else {
             error_report("VNC requires a display argument vnc=<display>");
             exit(1);
@@ -1402,7 +1402,7 @@ static void qemu_create_default_devices(void)
         if (!qemu_display_find_default(&dpy)) {
             dpy.type = DISPLAY_TYPE_NONE;
 #if defined(CONFIG_VNC)
-            vnc_parse("localhost:0,to=99,id=default", &error_abort);
+            vnc_parse("localhost:0,to=99,id=default");
 #endif
         }
     }
@@ -3186,7 +3186,7 @@ void qemu_init(int argc, char **argv, char **envp)
                 }
                 break;
             case QEMU_OPTION_vnc:
-                vnc_parse(optarg, &error_fatal);
+                vnc_parse(optarg);
                 break;
             case QEMU_OPTION_no_acpi:
                 olist = qemu_find_opts("machine");
diff --git a/ui/vnc-stubs.c b/ui/vnc-stubs.c
index c6b737dcec..b4eb3ce718 100644
--- a/ui/vnc-stubs.c
+++ b/ui/vnc-stubs.c
@@ -10,13 +10,12 @@ int vnc_display_pw_expire(const char *id, time_t expires)
 {
     return -ENODEV;
 };
-QemuOpts *vnc_parse(const char *str, Error **errp)
+void vnc_parse(const char *str)
 {
     if (strcmp(str, "none") == 0) {
-        return NULL;
+        return;
     }
-    error_setg(errp, "VNC support is disabled");
-    return NULL;
+    error_setg(&error_fatal, "VNC support is disabled");
 }
 int vnc_init_func(void *opaque, QemuOpts *opts, Error **errp)
 {
diff --git a/ui/vnc.c b/ui/vnc.c
index d429bfee5a..66f7c1b936 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -50,6 +50,7 @@
 #include "crypto/random.h"
 #include "qom/object_interfaces.h"
 #include "qemu/cutils.h"
+#include "qemu/help_option.h"
 #include "io/dns-resolver.h"
 
 #define VNC_REFRESH_INTERVAL_BASE GUI_REFRESH_INTERVAL_DEFAULT
@@ -4211,14 +4212,14 @@ static void vnc_auto_assign_id(QemuOptsList *olist, QemuOpts *opts)
     qemu_opts_set_id(opts, id);
 }
 
-QemuOpts *vnc_parse(const char *str, Error **errp)
+void vnc_parse(const char *str)
 {
     QemuOptsList *olist = qemu_find_opts("vnc");
-    QemuOpts *opts = qemu_opts_parse(olist, str, true, errp);
+    QemuOpts *opts = qemu_opts_parse_noisily(olist, str, !is_help_option(str));
     const char *id;
 
     if (!opts) {
-        return NULL;
+        exit(1);
     }
 
     id = qemu_opts_id(opts);
@@ -4226,7 +4227,6 @@ QemuOpts *vnc_parse(const char *str, Error **errp)
         /* auto-assign id if not present */
         vnc_auto_assign_id(olist, opts);
     }
-    return opts;
 }
 
 int vnc_init_func(void *opaque, QemuOpts *opts, Error **errp)
-- 
2.26.2




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

* [PULL 29/31] qemu-option: clean up id vs. list->merge_lists
  2021-01-23 14:30 [PULL 00/31] Misc patches for 2020-01-21 Paolo Bonzini
                   ` (27 preceding siblings ...)
  2021-01-23 14:31 ` [PULL 28/31] vnc: support "-vnc help" Paolo Bonzini
@ 2021-01-23 14:31 ` Paolo Bonzini
  2021-01-25  7:42   ` Markus Armbruster
  2021-01-23 14:31 ` [PULL 30/31] qemu-option: move help handling to get_opt_name_value Paolo Bonzini
                   ` (3 subsequent siblings)
  32 siblings, 1 reply; 53+ messages in thread
From: Paolo Bonzini @ 2021-01-23 14:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Kevin Wolf

Looking at all merge-lists QemuOptsList, here is how they access their
QemuOpts:

reopen_opts in qemu-io-cmds.c ("qemu-img reopen -o")
	qemu_opts_find(&reopen_opts, NULL)

empty_opts in qemu-io.c ("qemu-io open -o")
	qemu_opts_find(&empty_opts, NULL)

qemu_rtc_opts ("-rtc")
	qemu_find_opts_singleton("rtc")

qemu_machine_opts ("-M")
	qemu_find_opts_singleton("machine")

qemu_action_opts ("-name")
	qemu_opts_foreach->process_runstate_actions

qemu_boot_opts ("-boot")
	in hw/nvram/fw_cfg.c and hw/s390x/ipl.c:
	  QTAILQ_FIRST(&qemu_find_opts("bootopts")->head)
	in softmmu/vl.c:
	  qemu_opts_find(qemu_find_opts("boot-opts"), NULL)

qemu_name_opts ("-name")
	qemu_opts_foreach->parse_name
	parse_name does not use id

qemu_mem_opts ("-m")
	qemu_find_opts_singleton("memory")

qemu_icount_opts ("-icount")
	qemu_opts_foreach->do_configure_icount
	do_configure_icount->icount_configure
	icount_configure does not use id

qemu_smp_opts ("-smp")
	qemu_opts_find(qemu_find_opts("smp-opts"), NULL)

qemu_spice_opts ("-spice")
	QTAILQ_FIRST(&qemu_spice_opts.head)

i.e. they don't need an id.  Sometimes its presence is ignored
(e.g. when using qemu_opts_foreach), sometimes all the options
with the id are skipped, sometimes only the first option on the
command line is considered.  -boot does two different things
depending on who's looking at the options.

With this patch we just forbid id on merge-lists QemuOptsLists; if the
command line still works, it has the same semantics as before.

qemu_opts_create's fail_if_exists parameter is now unnecessary:

- it is unused if id is NULL

- opts_parse only passes false if reached from qemu_opts_set_defaults,
in which case this patch enforces that id must be NULL

- other callers that can pass a non-NULL id always set it to true

Assert that it is true in the only case where "fail_if_exists" matters,
i.e. "id && !lists->merge_lists".  This means that if an id is present,
duplicates are always forbidden, which was already the status quo.

Discounting the case that aborts as it's not user-controlled (it's
"just" a matter of inspecting qemu_opts_create callers), the paths
through qemu_opts_create can be summarized as:

- merge_lists = true: singleton opts with NULL id; non-NULL id fails

- merge_lists = false: always return new opts; non-NULL id fails if dup

Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 util/qemu-option.c | 27 ++++++++++++++-------------
 1 file changed, 14 insertions(+), 13 deletions(-)

diff --git a/util/qemu-option.c b/util/qemu-option.c
index c88e159f18..91f4120ce1 100644
--- a/util/qemu-option.c
+++ b/util/qemu-option.c
@@ -619,7 +619,17 @@ QemuOpts *qemu_opts_create(QemuOptsList *list, const char *id,
 {
     QemuOpts *opts = NULL;
 
-    if (id) {
+    if (list->merge_lists) {
+        if (id) {
+            error_setg(errp, QERR_INVALID_PARAMETER, "id");
+            return NULL;
+        }
+        opts = qemu_opts_find(list, NULL);
+        if (opts) {
+            return opts;
+        }
+    } else if (id) {
+        assert(fail_if_exists);
         if (!id_wellformed(id)) {
             error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "id",
                        "an identifier");
@@ -629,17 +639,8 @@ QemuOpts *qemu_opts_create(QemuOptsList *list, const char *id,
         }
         opts = qemu_opts_find(list, id);
         if (opts != NULL) {
-            if (fail_if_exists && !list->merge_lists) {
-                error_setg(errp, "Duplicate ID '%s' for %s", id, list->name);
-                return NULL;
-            } else {
-                return opts;
-            }
-        }
-    } else if (list->merge_lists) {
-        opts = qemu_opts_find(list, NULL);
-        if (opts) {
-            return opts;
+            error_setg(errp, "Duplicate ID '%s' for %s", id, list->name);
+            return NULL;
         }
     }
     opts = g_malloc0(sizeof(*opts));
@@ -893,7 +894,7 @@ static QemuOpts *opts_parse(QemuOptsList *list, const char *params,
      * (if unlikely) future misuse:
      */
     assert(!defaults || list->merge_lists);
-    opts = qemu_opts_create(list, id, !defaults, errp);
+    opts = qemu_opts_create(list, id, !list->merge_lists, errp);
     g_free(id);
     if (opts == NULL) {
         return NULL;
-- 
2.26.2




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

* [PULL 30/31] qemu-option: move help handling to get_opt_name_value
  2021-01-23 14:30 [PULL 00/31] Misc patches for 2020-01-21 Paolo Bonzini
                   ` (28 preceding siblings ...)
  2021-01-23 14:31 ` [PULL 29/31] qemu-option: clean up id vs. list->merge_lists Paolo Bonzini
@ 2021-01-23 14:31 ` Paolo Bonzini
  2021-01-23 14:31 ` [PULL 31/31] qemu-option: warn for short-form boolean options Paolo Bonzini
                   ` (2 subsequent siblings)
  32 siblings, 0 replies; 53+ messages in thread
From: Paolo Bonzini @ 2021-01-23 14:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Markus Armbruster

Right now, help options are parsed normally and then checked
specially in opt_validate, but only if coming from
qemu_opts_parse_noisily.  has_help_option does the check on its own.

opt_validate() has two callers: qemu_opt_set(), which passes null and is
therefore unaffected, and opts_do_parse(), which is affected.

opts_do_parse() is called by qemu_opts_do_parse(), which passes null and
is therefore unaffected, and opts_parse().

opts_parse() is called by qemu_opts_parse() and qemu_opts_set_defaults(),
which pass null and are therefore unaffected, and
qemu_opts_parse_noisily().

Move the check from opt_validate to the parsing workhorse of QemuOpts,
get_opt_name_value.  This will come in handy in the next patch, which
will raise a warning for "-object memory-backend-ram,share" ("flag" option
with no =on/=off part) but not for "-object memory-backend-ram,help".

As a result:

- opts_parse and opts_do_parse do not return an error anymore
  when help is requested; qemu_opts_parse_noisily does not have
  to work around that anymore.

- various crazy ways to request help are not recognized anymore:
  - "help=..."
  - "nohelp" (sugar for "help=off")
  - "?=..."
  - "no?" (sugar for "?=off")

- "help" would be recognized as help request even if there is a (foolishly
  named) parameter "help".  No such parameters exist, though.

Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 util/qemu-option.c | 38 +++++++++++++++++++++++---------------
 1 file changed, 23 insertions(+), 15 deletions(-)

diff --git a/util/qemu-option.c b/util/qemu-option.c
index 91f4120ce1..5f27d4369d 100644
--- a/util/qemu-option.c
+++ b/util/qemu-option.c
@@ -496,8 +496,7 @@ static QemuOpt *opt_create(QemuOpts *opts, const char *name, char *value,
     return opt;
 }
 
-static bool opt_validate(QemuOpt *opt, bool *help_wanted,
-                         Error **errp)
+static bool opt_validate(QemuOpt *opt, Error **errp)
 {
     const QemuOptDesc *desc;
     const QemuOptsList *list = opt->opts->list;
@@ -505,9 +504,6 @@ static bool opt_validate(QemuOpt *opt, bool *help_wanted,
     desc = find_desc_by_name(list->desc, opt->name);
     if (!desc && !opts_accepts_any(list)) {
         error_setg(errp, QERR_INVALID_PARAMETER, opt->name);
-        if (help_wanted && is_help_option(opt->name)) {
-            *help_wanted = true;
-        }
         return false;
     }
 
@@ -524,7 +520,7 @@ bool qemu_opt_set(QemuOpts *opts, const char *name, const char *value,
 {
     QemuOpt *opt = opt_create(opts, name, g_strdup(value), false);
 
-    if (!opt_validate(opt, NULL, errp)) {
+    if (!opt_validate(opt, errp)) {
         qemu_opt_del(opt);
         return false;
     }
@@ -760,10 +756,12 @@ void qemu_opts_print(QemuOpts *opts, const char *separator)
 
 static const char *get_opt_name_value(const char *params,
                                       const char *firstname,
+                                      bool *help_wanted,
                                       char **name, char **value)
 {
     const char *p;
     size_t len;
+    bool is_help = false;
 
     len = strcspn(params, "=,");
     if (params[len] != '=') {
@@ -780,6 +778,7 @@ static const char *get_opt_name_value(const char *params,
                 *value = g_strdup("off");
             } else {
                 *value = g_strdup("on");
+                is_help = is_help_option(*name);
             }
         }
     } else {
@@ -791,6 +790,9 @@ static const char *get_opt_name_value(const char *params,
     }
 
     assert(!*p || *p == ',');
+    if (help_wanted && is_help) {
+        *help_wanted = true;
+    }
     if (*p == ',') {
         p++;
     }
@@ -806,7 +808,12 @@ static bool opts_do_parse(QemuOpts *opts, const char *params,
     QemuOpt *opt;
 
     for (p = params; *p;) {
-        p = get_opt_name_value(p, firstname, &option, &value);
+        p = get_opt_name_value(p, firstname, help_wanted, &option, &value);
+        if (help_wanted && *help_wanted) {
+            g_free(option);
+            g_free(value);
+            return false;
+        }
         firstname = NULL;
 
         if (!strcmp(option, "id")) {
@@ -817,7 +824,7 @@ static bool opts_do_parse(QemuOpts *opts, const char *params,
 
         opt = opt_create(opts, option, value, prepend);
         g_free(option);
-        if (!opt_validate(opt, help_wanted, errp)) {
+        if (!opt_validate(opt, errp)) {
             qemu_opt_del(opt);
             return false;
         }
@@ -832,7 +839,7 @@ static char *opts_parse_id(const char *params)
     char *name, *value;
 
     for (p = params; *p;) {
-        p = get_opt_name_value(p, NULL, &name, &value);
+        p = get_opt_name_value(p, NULL, NULL, &name, &value);
         if (!strcmp(name, "id")) {
             g_free(name);
             return value;
@@ -848,11 +855,10 @@ bool has_help_option(const char *params)
 {
     const char *p;
     char *name, *value;
-    bool ret;
+    bool ret = false;
 
     for (p = params; *p;) {
-        p = get_opt_name_value(p, NULL, &name, &value);
-        ret = is_help_option(name);
+        p = get_opt_name_value(p, NULL, &ret, &name, &value);
         g_free(name);
         g_free(value);
         if (ret) {
@@ -937,11 +943,13 @@ QemuOpts *qemu_opts_parse_noisily(QemuOptsList *list, const char *params,
     QemuOpts *opts;
     bool help_wanted = false;
 
-    opts = opts_parse(list, params, permit_abbrev, false, &help_wanted, &err);
-    if (err) {
+    opts = opts_parse(list, params, permit_abbrev, false,
+                      opts_accepts_any(list) ? NULL : &help_wanted,
+                      &err);
+    if (!opts) {
+        assert(!!err + !!help_wanted == 1);
         if (help_wanted) {
             qemu_opts_print_help(list, true);
-            error_free(err);
         } else {
             error_report_err(err);
         }
-- 
2.26.2




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

* [PULL 31/31] qemu-option: warn for short-form boolean options
  2021-01-23 14:30 [PULL 00/31] Misc patches for 2020-01-21 Paolo Bonzini
                   ` (29 preceding siblings ...)
  2021-01-23 14:31 ` [PULL 30/31] qemu-option: move help handling to get_opt_name_value Paolo Bonzini
@ 2021-01-23 14:31 ` Paolo Bonzini
  2021-02-15 19:56   ` Peter Maydell
  2021-01-23 14:57 ` [PULL 00/31] Misc patches for 2020-01-21 no-reply
  2021-01-23 19:52 ` Peter Maydell
  32 siblings, 1 reply; 53+ messages in thread
From: Paolo Bonzini @ 2021-01-23 14:31 UTC (permalink / raw)
  To: qemu-devel

Options such as "server" or "nowait", that are commonly found in -chardev,
are sugar for "server=on" and "wait=off".  This is quite surprising and
also does not have any notion of typing attached.  It is even possible to
do "-device e1000,noid" and get a device with "id=off".

Deprecate it and print a warning when it is encountered.  In general,
this short form for boolean options only seems to be in wide use for
-chardev and -spice.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 docs/system/deprecated.rst |  6 ++++++
 tests/test-qemu-opts.c     |  2 +-
 util/qemu-option.c         | 29 ++++++++++++++++++-----------
 3 files changed, 25 insertions(+), 12 deletions(-)

diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst
index 651182b2df..9de663526a 100644
--- a/docs/system/deprecated.rst
+++ b/docs/system/deprecated.rst
@@ -127,6 +127,12 @@ Drives with interface types other than ``if=none`` are for onboard
 devices.  It is possible to use drives the board doesn't pick up with
 -device.  This usage is now deprecated.  Use ``if=none`` instead.
 
+Short-form boolean options (since 6.0)
+''''''''''''''''''''''''''''''''''''''
+
+Boolean options such as ``share=on``/``share=off`` could be written
+in short form as ``share`` and ``noshare``.  This is now deprecated
+and will cause a warning.
 
 QEMU Machine Protocol (QMP) commands
 ------------------------------------
diff --git a/tests/test-qemu-opts.c b/tests/test-qemu-opts.c
index 2aab831d10..8bbb17b1c7 100644
--- a/tests/test-qemu-opts.c
+++ b/tests/test-qemu-opts.c
@@ -515,7 +515,7 @@ static void test_opts_parse(void)
     error_free_or_abort(&err);
     g_assert(!opts);
 
-    /* Implied value */
+    /* Implied value (qemu_opts_parse warns but accepts it) */
     opts = qemu_opts_parse(&opts_list_03, "an,noaus,noaus=",
                            false, &error_abort);
     g_assert_cmpuint(opts_count(opts), ==, 3);
diff --git a/util/qemu-option.c b/util/qemu-option.c
index 5f27d4369d..40564a12eb 100644
--- a/util/qemu-option.c
+++ b/util/qemu-option.c
@@ -756,10 +756,12 @@ void qemu_opts_print(QemuOpts *opts, const char *separator)
 
 static const char *get_opt_name_value(const char *params,
                                       const char *firstname,
+                                      bool warn_on_flag,
                                       bool *help_wanted,
                                       char **name, char **value)
 {
     const char *p;
+    const char *prefix = "";
     size_t len;
     bool is_help = false;
 
@@ -776,10 +778,15 @@ static const char *get_opt_name_value(const char *params,
             if (strncmp(*name, "no", 2) == 0) {
                 memmove(*name, *name + 2, strlen(*name + 2) + 1);
                 *value = g_strdup("off");
+                prefix = "no";
             } else {
                 *value = g_strdup("on");
                 is_help = is_help_option(*name);
             }
+            if (!is_help && warn_on_flag) {
+                warn_report("short-form boolean option '%s%s' deprecated", prefix, *name);
+                error_printf("Please use %s=%s instead\n", *name, *value);
+            }
         }
     } else {
         /* found "foo=bar,more" */
@@ -801,14 +808,14 @@ static const char *get_opt_name_value(const char *params,
 
 static bool opts_do_parse(QemuOpts *opts, const char *params,
                           const char *firstname, bool prepend,
-                          bool *help_wanted, Error **errp)
+                          bool warn_on_flag, bool *help_wanted, Error **errp)
 {
     char *option, *value;
     const char *p;
     QemuOpt *opt;
 
     for (p = params; *p;) {
-        p = get_opt_name_value(p, firstname, help_wanted, &option, &value);
+        p = get_opt_name_value(p, firstname, warn_on_flag, help_wanted, &option, &value);
         if (help_wanted && *help_wanted) {
             g_free(option);
             g_free(value);
@@ -839,7 +846,7 @@ static char *opts_parse_id(const char *params)
     char *name, *value;
 
     for (p = params; *p;) {
-        p = get_opt_name_value(p, NULL, NULL, &name, &value);
+        p = get_opt_name_value(p, NULL, false, NULL, &name, &value);
         if (!strcmp(name, "id")) {
             g_free(name);
             return value;
@@ -858,7 +865,7 @@ bool has_help_option(const char *params)
     bool ret = false;
 
     for (p = params; *p;) {
-        p = get_opt_name_value(p, NULL, &ret, &name, &value);
+        p = get_opt_name_value(p, NULL, false, &ret, &name, &value);
         g_free(name);
         g_free(value);
         if (ret) {
@@ -878,12 +885,12 @@ bool has_help_option(const char *params)
 bool qemu_opts_do_parse(QemuOpts *opts, const char *params,
                        const char *firstname, Error **errp)
 {
-    return opts_do_parse(opts, params, firstname, false, NULL, errp);
+    return opts_do_parse(opts, params, firstname, false, false, NULL, errp);
 }
 
 static QemuOpts *opts_parse(QemuOptsList *list, const char *params,
                             bool permit_abbrev, bool defaults,
-                            bool *help_wanted, Error **errp)
+                            bool warn_on_flag, bool *help_wanted, Error **errp)
 {
     const char *firstname;
     char *id = opts_parse_id(params);
@@ -906,8 +913,8 @@ static QemuOpts *opts_parse(QemuOptsList *list, const char *params,
         return NULL;
     }
 
-    if (!opts_do_parse(opts, params, firstname, defaults, help_wanted,
-                       errp)) {
+    if (!opts_do_parse(opts, params, firstname, defaults,
+                       warn_on_flag, help_wanted, errp)) {
         qemu_opts_del(opts);
         return NULL;
     }
@@ -925,7 +932,7 @@ static QemuOpts *opts_parse(QemuOptsList *list, const char *params,
 QemuOpts *qemu_opts_parse(QemuOptsList *list, const char *params,
                           bool permit_abbrev, Error **errp)
 {
-    return opts_parse(list, params, permit_abbrev, false, NULL, errp);
+    return opts_parse(list, params, permit_abbrev, false, false, NULL, errp);
 }
 
 /**
@@ -943,7 +950,7 @@ QemuOpts *qemu_opts_parse_noisily(QemuOptsList *list, const char *params,
     QemuOpts *opts;
     bool help_wanted = false;
 
-    opts = opts_parse(list, params, permit_abbrev, false,
+    opts = opts_parse(list, params, permit_abbrev, false, true,
                       opts_accepts_any(list) ? NULL : &help_wanted,
                       &err);
     if (!opts) {
@@ -962,7 +969,7 @@ void qemu_opts_set_defaults(QemuOptsList *list, const char *params,
 {
     QemuOpts *opts;
 
-    opts = opts_parse(list, params, permit_abbrev, true, NULL, NULL);
+    opts = opts_parse(list, params, permit_abbrev, true, false, NULL, NULL);
     assert(opts);
 }
 
-- 
2.26.2



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

* Re: [PULL 00/31] Misc patches for 2020-01-21
  2021-01-23 14:30 [PULL 00/31] Misc patches for 2020-01-21 Paolo Bonzini
                   ` (30 preceding siblings ...)
  2021-01-23 14:31 ` [PULL 31/31] qemu-option: warn for short-form boolean options Paolo Bonzini
@ 2021-01-23 14:57 ` no-reply
  2021-01-23 19:52 ` Peter Maydell
  32 siblings, 0 replies; 53+ messages in thread
From: no-reply @ 2021-01-23 14:57 UTC (permalink / raw)
  To: pbonzini; +Cc: qemu-devel

Patchew URL: https://patchew.org/QEMU/20210123143128.1167797-1-pbonzini@redhat.com/



Hi,

This series seems to have some coding style problems. See output below for
more information:

Type: series
Message-id: 20210123143128.1167797-1-pbonzini@redhat.com
Subject: [PULL 00/31] Misc patches for 2020-01-21

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
 * [new tag]         patchew/20210123143128.1167797-1-pbonzini@redhat.com -> patchew/20210123143128.1167797-1-pbonzini@redhat.com
Switched to a new branch 'test'
4a3ceb3 qemu-option: warn for short-form boolean options
601145b qemu-option: move help handling to get_opt_name_value
d44f2ed qemu-option: clean up id vs. list->merge_lists
d70fb5f vnc: support "-vnc help"
fe666fb qmp: remove deprecated "change" command
8581d24 hmp: remove "change vnc TARGET" command
e784bbe acceptance: switch to QMP change-vnc-password command
82574e9 meson.build: Detect bzip2 program
cc91009 meson.build: Declare global edk2_targets / install_edk2_blobs variables
a8e31f6 meson: Add a section header for library dependencies
88a07a2 meson: Display crypto-related information altogether
0e8b853 meson: Display block layer information altogether
6336d44 meson: Display accelerators and selected targets altogether
b332b01 meson: Summarize compilation-related information altogether
b807fd5 meson: Summarize overall features altogether
bfb3d06 meson: Display host binaries information altogether
86dcc24 meson: Summarize information related to directories first
f678a10 meson: convert wixl detection to Meson
f464b38 nsis: adjust for new MinGW paths
e7b75e0 meson: Declare have_virtfs_proxy_helper in main meson.build
a1e89ed slirp: update to git master
13a0c33 build-sys: add libvhost-user missing dependencies
51e6567 build-sys: set global arguments for cflags/ldflags
8922c06 build-sys: remove unused LIBS
08be6c9 ide: atapi: check logical block address and read size (CVE-2020-29443)
6f15f3c softmmu/physmem: Silence GCC 10 maybe-uninitialized error
201c7af util/cacheflush: Fix error generated by clang
c6ae035 build-system: clean up TCG/TCI configury
b981bdd x86/cpu: Use max host physical address if -cpu max option is applied
8c3b2ab configure: MinGW respect --bindir argument
35af975 runstate: cleanup reboot and panic actions

=== OUTPUT BEGIN ===
1/31 Checking commit 35af975eb80f (runstate: cleanup reboot and panic actions)
ERROR: line over 90 characters
#118: FILE: softmmu/runstate.c:478:
+        || (panic_action == PANIC_ACTION_SHUTDOWN && shutdown_action == SHUTDOWN_ACTION_PAUSE)) {

total: 1 errors, 0 warnings, 83 lines checked

Patch 1/31 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

2/31 Checking commit 8c3b2ab803a2 (configure: MinGW respect --bindir argument)
3/31 Checking commit b981bddaf3b1 (x86/cpu: Use max host physical address if -cpu max option is applied)
WARNING: line over 80 characters
#27: FILE: target/i386/cpu.c:4322:
+        object_property_set_bool(OBJECT(cpu), "host-phys-bits", true, &error_abort);

total: 0 errors, 1 warnings, 7 lines checked

Patch 3/31 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
4/31 Checking commit c6ae035743a2 (build-system: clean up TCG/TCI configury)
5/31 Checking commit 201c7afcfdda (util/cacheflush: Fix error generated by clang)
6/31 Checking commit 6f15f3c12f74 (softmmu/physmem: Silence GCC 10 maybe-uninitialized error)
7/31 Checking commit 08be6c9b3812 (ide: atapi: check logical block address and read size (CVE-2020-29443))
8/31 Checking commit 8922c06bbfeb (build-sys: remove unused LIBS)
9/31 Checking commit 51e6567ee41a (build-sys: set global arguments for cflags/ldflags)
10/31 Checking commit 13a0c33ae299 (build-sys: add libvhost-user missing dependencies)
11/31 Checking commit a1e89edfc8f7 (slirp: update to git master)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#162: 
deleted file mode 160000

total: 0 errors, 1 warnings, 98 lines checked

Patch 11/31 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
12/31 Checking commit e7b75e08c98c (meson: Declare have_virtfs_proxy_helper in main meson.build)
13/31 Checking commit f464b383c7da (nsis: adjust for new MinGW paths)
14/31 Checking commit f678a100a38d (meson: convert wixl detection to Meson)
15/31 Checking commit 86dcc24dd9dc (meson: Summarize information related to directories first)
16/31 Checking commit bfb3d06eba81 (meson: Display host binaries information altogether)
17/31 Checking commit b807fd55855f (meson: Summarize overall features altogether)
18/31 Checking commit b332b017845e (meson: Summarize compilation-related information altogether)
19/31 Checking commit 6336d44fb99d (meson: Display accelerators and selected targets altogether)
20/31 Checking commit 0e8b8535cc27 (meson: Display block layer information altogether)
21/31 Checking commit 88a07a2eae5b (meson: Display crypto-related information altogether)
22/31 Checking commit a8e31f6502b3 (meson: Add a section header for library dependencies)
23/31 Checking commit cc9100905835 (meson.build: Declare global edk2_targets / install_edk2_blobs variables)
24/31 Checking commit 82574e933d76 (meson.build: Detect bzip2 program)
25/31 Checking commit e784bbe429cc (acceptance: switch to QMP change-vnc-password command)
26/31 Checking commit 8581d24544ed (hmp: remove "change vnc TARGET" command)
27/31 Checking commit fe666fbc2118 (qmp: remove deprecated "change" command)
28/31 Checking commit d70fb5faea9d (vnc: support "-vnc help")
29/31 Checking commit d44f2ed07723 (qemu-option: clean up id vs. list->merge_lists)
30/31 Checking commit 601145bf2b6a (qemu-option: move help handling to get_opt_name_value)
31/31 Checking commit 4a3ceb3536d1 (qemu-option: warn for short-form boolean options)
WARNING: line over 80 characters
#81: FILE: util/qemu-option.c:787:
+                warn_report("short-form boolean option '%s%s' deprecated", prefix, *name);

WARNING: line over 80 characters
#100: FILE: util/qemu-option.c:818:
+        p = get_opt_name_value(p, firstname, warn_on_flag, help_wanted, &option, &value);

total: 0 errors, 2 warnings, 127 lines checked

Patch 31/31 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
=== OUTPUT END ===

Test command exited with code: 1


The full log is available at
http://patchew.org/logs/20210123143128.1167797-1-pbonzini@redhat.com/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com

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

* Re: [PULL 00/31] Misc patches for 2020-01-21
  2021-01-23 14:30 [PULL 00/31] Misc patches for 2020-01-21 Paolo Bonzini
                   ` (31 preceding siblings ...)
  2021-01-23 14:57 ` [PULL 00/31] Misc patches for 2020-01-21 no-reply
@ 2021-01-23 19:52 ` Peter Maydell
  32 siblings, 0 replies; 53+ messages in thread
From: Peter Maydell @ 2021-01-23 19:52 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: QEMU Developers

On Sat, 23 Jan 2021 at 14:36, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> The following changes since commit fef80ea073c4862bc9eaddb6ddb0ed970b8ad7c4:
>
>   Merge remote-tracking branch 'remotes/ericb/tags/pull-nbd-2021-01-20' into staging (2021-01-21 10:44:28 +0000)
>
> are available in the Git repository at:
>
>   https://gitlab.com/bonzini/qemu.git tags/for-upstream
>
> for you to fetch changes up to fc70d67e73e9cba950cf9d16281a78eb4ab6e4ce:
>
>   qemu-option: warn for short-form boolean options (2021-01-23 09:29:42 -0500)
>
> ----------------------------------------------------------------
> * Make MinGW respect --bindir (Joshua)
> * Switch MinGW to a "deep" installation (Joshua + NSIS fixes by myself)
> * Fix compilation errors/warnings (Qixin, Philippe)
> * Switch slirp to a subproject (Marc-André)
> * QemuOpts cleanups (myself)
> * Consistency improvements for -action (myself)
> * remove deprecated "change vnc TARGET" functionality (myself)
> * meson cleanups (Philippe, myself)
> * IDE out-of-bounds access (Prasad)
> * LA57 fix for -cpu max (Weijiang)

Fails to compile, OSX. There's an oddball "unable to rmdir"
warning immediately on git checkout, which may or may not be
related:

From git://git-us.linaro.org/people/pmaydell/qemu-arm
   e93c65a6c6..9bfe4825ae  staging    -> pmaydell/staging
warning: unable to rmdir 'slirp': Directory not empty
make: Entering directory '/Users/pm215/src/qemu-for-merges/build/all'
config-host.mak is out-of-date, running configure
Disabling PIE due to missing toolchain support
Submodule 'subprojects/libslirp'
(https://git.qemu.org/git/libslirp.git) registered for path
'subprojects/libslirp'
Cloning into '/Users/pm215/src/qemu-for-merges/subprojects/libslirp'...
cross containers  no

NOTE: guest cross-compilers enabled: cc
/usr/local/bin/ninja  build.ninja && touch build.ninja.stamp
[...]
ninja: no work to do.
/usr/local/bin/python3 -B
/Users/pm215/src/qemu-for-merges/meson/meson.py introspect --targets
--tests --benchmarks | /usr/local/bin/python3 -B scripts/mtest2make.py
> Makefile.mtest
[1/5915] Compiling C object
subprojects/libslirp/libslirp.0.dylib.p/src_ip_output.c.o
[2/5915] Compiling C object subprojects/libslirp/libslirp.0.dylib.p/src_ncsi.c.o
[3/5915] Compiling C object subprojects/libslirp/libslirp.0.dylib.p/src_mbuf.c.o
[4/5915] Compiling C object subprojects/libslirp/libslirp.0.dylib.p/src_misc.c.o
[5/5915] Compiling C object
subprojects/libslirp/libslirp.0.dylib.p/src_slirp.c.o
FAILED: subprojects/libslirp/libslirp.0.dylib.p/src_slirp.c.o
cc -Isubprojects/libslirp/libslirp.0.dylib.p -Isubprojects/libslirp
-I../../subprojects/libslirp -I/usr/local/Cellar/glib/2.66.1/include
-I/usr/local/Cellar/glib/2.66.1/include/glib-2.0
-I/usr/local/Cellar/glib/2.66.1/lib/glib-2.0/include
-I/usr/local/opt/gettext/include -I/usr/local/Cellar/pcre/8.44/include
-Xclang -fcolor-diagnostics -pipe -Wall -Winvalid-pch -std=gnu99 -O2
-g -m64 -mcx16 -DOS_OBJECT_USE_OBJC=0 -arch x86_64 -D_GNU_SOURCE
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes
-Wredundant-decls -Wundef -Wwrite-strings -Wmissing-prototypes
-fno-strict-aliasing -fno-common -fwrapv -fdiagnostics-color=never
-Werror -Wno-error=deprecated-declarations -Wold-style-definition
-Wtype-limits -Wformat-security -Wformat-y2k -Winit-self
-Wignored-qualifiers -Wempty-body -Wnested-externs -Wendif-labels
-Wexpansion-to-defined -Wno-initializer-overrides
-Wno-missing-include-dirs -Wno-shift-negative-value
-Wno-string-plus-int -Wno-typedef-redefinition
-Wno-tautological-type-limit-compare -fstack-protector-strong
'-DG_LOG_DOMAIN="Slirp"' -MD -MQ
subprojects/libslirp/libslirp.0.dylib.p/src_slirp.c.o -MF
subprojects/libslirp/libslirp.0.dylib.p/src_slirp.c.o.d -o
subprojects/libslirp/libslirp.0.dylib.p/src_slirp.c.o -c
../../subprojects/libslirp/src/slirp.c
../../subprojects/libslirp/src/slirp.c:131:17: error: unused variable
'old_stat' [-Werror,-Wunused-variable]
    struct stat old_stat;
                ^
../../subprojects/libslirp/src/slirp.c:143:10: error: unused variable
'buff' [-Werror,-Wunused-variable]
    char buff[512];
         ^
2 errors generated.
[6/5915] Compiling C object subprojects/libslirp/libslirp.0.dylib.p/src_sbuf.c.o
[7/5915] Compiling C object
subprojects/libslirp/libslirp.0.dylib.p/src_ndp_table.c.o
[8/5915] Compiling C object
subprojects/libslirp/libslirp.0.dylib.p/src_socket.c.o
ninja: build stopped: subcommand failed.

thanks
-- PMM


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

* Re: [PULL 29/31] qemu-option: clean up id vs. list->merge_lists
  2021-01-23 14:31 ` [PULL 29/31] qemu-option: clean up id vs. list->merge_lists Paolo Bonzini
@ 2021-01-25  7:42   ` Markus Armbruster
  2021-01-25  7:58     ` Paolo Bonzini
  0 siblings, 1 reply; 53+ messages in thread
From: Markus Armbruster @ 2021-01-25  7:42 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: Kevin Wolf, qemu-devel

Paolo Bonzini <pbonzini@redhat.com> writes:

> Looking at all merge-lists QemuOptsList, here is how they access their
> QemuOpts:
>
> reopen_opts in qemu-io-cmds.c ("qemu-img reopen -o")
> 	qemu_opts_find(&reopen_opts, NULL)
>
> empty_opts in qemu-io.c ("qemu-io open -o")
> 	qemu_opts_find(&empty_opts, NULL)
>
> qemu_rtc_opts ("-rtc")
> 	qemu_find_opts_singleton("rtc")
>
> qemu_machine_opts ("-M")
> 	qemu_find_opts_singleton("machine")
>
> qemu_action_opts ("-name")

Pasto: it's "-action".

> 	qemu_opts_foreach->process_runstate_actions
>
> qemu_boot_opts ("-boot")
> 	in hw/nvram/fw_cfg.c and hw/s390x/ipl.c:
> 	  QTAILQ_FIRST(&qemu_find_opts("bootopts")->head)
> 	in softmmu/vl.c:
> 	  qemu_opts_find(qemu_find_opts("boot-opts"), NULL)
>
> qemu_name_opts ("-name")
> 	qemu_opts_foreach->parse_name
> 	parse_name does not use id
>
> qemu_mem_opts ("-m")
> 	qemu_find_opts_singleton("memory")
>
> qemu_icount_opts ("-icount")
> 	qemu_opts_foreach->do_configure_icount
> 	do_configure_icount->icount_configure
> 	icount_configure does not use id
>
> qemu_smp_opts ("-smp")
> 	qemu_opts_find(qemu_find_opts("smp-opts"), NULL)
>
> qemu_spice_opts ("-spice")
> 	QTAILQ_FIRST(&qemu_spice_opts.head)
>
> i.e. they don't need an id.  Sometimes its presence is ignored
> (e.g. when using qemu_opts_foreach), sometimes all the options
> with the id are skipped, sometimes only the first option on the

Let's insert

    (when using qemu_find_opts_singleton() or qemu_opts_find(list, NULL))

right after skipped, and

> command line is considered.  -boot does two different things

    (when using QTAILQ_FIRST)

right after considered.

> depending on who's looking at the options.
>
> With this patch we just forbid id on merge-lists QemuOptsLists; if the
> command line still works, it has the same semantics as before.
>
> qemu_opts_create's fail_if_exists parameter is now unnecessary:
>
> - it is unused if id is NULL
>
> - opts_parse only passes false if reached from qemu_opts_set_defaults,
> in which case this patch enforces that id must be NULL
>
> - other callers that can pass a non-NULL id always set it to true
>
> Assert that it is true in the only case where "fail_if_exists" matters,
> i.e. "id && !lists->merge_lists".  This means that if an id is present,
> duplicates are always forbidden, which was already the status quo.
>
> Discounting the case that aborts as it's not user-controlled (it's
> "just" a matter of inspecting qemu_opts_create callers), the paths
> through qemu_opts_create can be summarized as:
>
> - merge_lists = true: singleton opts with NULL id; non-NULL id fails
>
> - merge_lists = false: always return new opts; non-NULL id fails if dup
>
> Reviewed-by: Kevin Wolf <kwolf@redhat.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

Reviewed-by: Markus Armbruster <armbru@redhat.com>



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

* Re: [PULL 29/31] qemu-option: clean up id vs. list->merge_lists
  2021-01-25  7:42   ` Markus Armbruster
@ 2021-01-25  7:58     ` Paolo Bonzini
  0 siblings, 0 replies; 53+ messages in thread
From: Paolo Bonzini @ 2021-01-25  7:58 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: Kevin Wolf, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 3257 bytes --]

Too late but I will point it out in the commit that cleans up the iteration.

Paolo

Il lun 25 gen 2021, 08:42 Markus Armbruster <armbru@redhat.com> ha scritto:

> Paolo Bonzini <pbonzini@redhat.com> writes:
>
> > Looking at all merge-lists QemuOptsList, here is how they access their
> > QemuOpts:
> >
> > reopen_opts in qemu-io-cmds.c ("qemu-img reopen -o")
> >       qemu_opts_find(&reopen_opts, NULL)
> >
> > empty_opts in qemu-io.c ("qemu-io open -o")
> >       qemu_opts_find(&empty_opts, NULL)
> >
> > qemu_rtc_opts ("-rtc")
> >       qemu_find_opts_singleton("rtc")
> >
> > qemu_machine_opts ("-M")
> >       qemu_find_opts_singleton("machine")
> >
> > qemu_action_opts ("-name")
>
> Pasto: it's "-action".
>
> >       qemu_opts_foreach->process_runstate_actions
> >
> > qemu_boot_opts ("-boot")
> >       in hw/nvram/fw_cfg.c and hw/s390x/ipl.c:
> >         QTAILQ_FIRST(&qemu_find_opts("bootopts")->head)
> >       in softmmu/vl.c:
> >         qemu_opts_find(qemu_find_opts("boot-opts"), NULL)
> >
> > qemu_name_opts ("-name")
> >       qemu_opts_foreach->parse_name
> >       parse_name does not use id
> >
> > qemu_mem_opts ("-m")
> >       qemu_find_opts_singleton("memory")
> >
> > qemu_icount_opts ("-icount")
> >       qemu_opts_foreach->do_configure_icount
> >       do_configure_icount->icount_configure
> >       icount_configure does not use id
> >
> > qemu_smp_opts ("-smp")
> >       qemu_opts_find(qemu_find_opts("smp-opts"), NULL)
> >
> > qemu_spice_opts ("-spice")
> >       QTAILQ_FIRST(&qemu_spice_opts.head)
> >
> > i.e. they don't need an id.  Sometimes its presence is ignored
> > (e.g. when using qemu_opts_foreach), sometimes all the options
> > with the id are skipped, sometimes only the first option on the
>
> Let's insert
>
>     (when using qemu_find_opts_singleton() or qemu_opts_find(list, NULL))
>
> right after skipped, and
>
> > command line is considered.  -boot does two different things
>
>     (when using QTAILQ_FIRST)
>
> right after considered.
>
> > depending on who's looking at the options.
> >
> > With this patch we just forbid id on merge-lists QemuOptsLists; if the
> > command line still works, it has the same semantics as before.
> >
> > qemu_opts_create's fail_if_exists parameter is now unnecessary:
> >
> > - it is unused if id is NULL
> >
> > - opts_parse only passes false if reached from qemu_opts_set_defaults,
> > in which case this patch enforces that id must be NULL
> >
> > - other callers that can pass a non-NULL id always set it to true
> >
> > Assert that it is true in the only case where "fail_if_exists" matters,
> > i.e. "id && !lists->merge_lists".  This means that if an id is present,
> > duplicates are always forbidden, which was already the status quo.
> >
> > Discounting the case that aborts as it's not user-controlled (it's
> > "just" a matter of inspecting qemu_opts_create callers), the paths
> > through qemu_opts_create can be summarized as:
> >
> > - merge_lists = true: singleton opts with NULL id; non-NULL id fails
> >
> > - merge_lists = false: always return new opts; non-NULL id fails if dup
> >
> > Reviewed-by: Kevin Wolf <kwolf@redhat.com>
> > Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
>
> Reviewed-by: Markus Armbruster <armbru@redhat.com>
>
>

[-- Attachment #2: Type: text/html, Size: 4858 bytes --]

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

* Re: [PULL 04/31] build-system: clean up TCG/TCI configury
  2021-01-23 14:31 ` [PULL 04/31] build-system: clean up TCG/TCI configury Paolo Bonzini
@ 2021-02-06 18:01   ` Philippe Mathieu-Daudé
  2021-02-06 19:08     ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 53+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-02-06 18:01 UTC (permalink / raw)
  To: Paolo Bonzini, Helge Deller, John Paul Adrian Glaubitz
  Cc: Stefan Weil, Richard Henderson, qemu-devel

On 1/23/21 3:31 PM, Paolo Bonzini wrote:
> Make CONFIG_TCG_INTERPRETER a Meson option, and enable TCI (though with
> a warning) if the host CPU is unsupported, making it more similar to
> other --enable-* options.
> 
> Remove TCG-specific include paths from !CONFIG_TCG builds.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  configure         | 11 +++--------
>  disas/meson.build |  2 --
>  meson.build       | 46 +++++++++++++++++++++++++---------------------
>  meson_options.txt |  2 ++
>  4 files changed, 30 insertions(+), 31 deletions(-)

I spent 2h bisecting until:

23a77b2d18b84e410478e88f11c54911f7a649fc is the first bad commit
commit 23a77b2d18b84e410478e88f11c54911f7a649fc
Author: Paolo Bonzini <pbonzini@redhat.com>
Date:   Mon Dec 14 12:01:45 2020 +0100

    build-system: clean up TCG/TCI configury

    Make CONFIG_TCG_INTERPRETER a Meson option, and enable TCI (though with
    a warning) if the host CPU is unsupported, making it more similar to
    other --enable-* options.

    Remove TCG-specific include paths from !CONFIG_TCG builds.

    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

to realize I need to re-bisect from here now including:

commit c6fbea47664466e526e40300568324ef77e5f2cc
Author: Richard Henderson <richard.henderson@linaro.org>
Date:   Sun Jan 24 11:10:55 2021 -1000

    configure: Fix --enable-tcg-interpreter

    The configure option was backward, and we failed to
    pass the value on to meson.

    Fixes: 23a77b2d18b ("build-system: clean up TCG/TCI configury")
    Tested-by: Stefan Weil <sw@weilnetz.de>
    Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

Sigh.


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

* Re: [PULL 04/31] build-system: clean up TCG/TCI configury
  2021-02-06 18:01   ` Philippe Mathieu-Daudé
@ 2021-02-06 19:08     ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 53+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-02-06 19:08 UTC (permalink / raw)
  To: Paolo Bonzini, Helge Deller, John Paul Adrian Glaubitz
  Cc: Stefan Weil, Richard Henderson, qemu-devel

On 2/6/21 7:01 PM, Philippe Mathieu-Daudé wrote:
> On 1/23/21 3:31 PM, Paolo Bonzini wrote:
>> Make CONFIG_TCG_INTERPRETER a Meson option, and enable TCI (though with
>> a warning) if the host CPU is unsupported, making it more similar to
>> other --enable-* options.
>>
>> Remove TCG-specific include paths from !CONFIG_TCG builds.
>>
>> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
>> ---
>>  configure         | 11 +++--------
>>  disas/meson.build |  2 --
>>  meson.build       | 46 +++++++++++++++++++++++++---------------------
>>  meson_options.txt |  2 ++
>>  4 files changed, 30 insertions(+), 31 deletions(-)
> 
> I spent 2h bisecting until:
> 
> 23a77b2d18b84e410478e88f11c54911f7a649fc is the first bad commit
> commit 23a77b2d18b84e410478e88f11c54911f7a649fc
> Author: Paolo Bonzini <pbonzini@redhat.com>
> Date:   Mon Dec 14 12:01:45 2020 +0100
> 
>     build-system: clean up TCG/TCI configury
> 
>     Make CONFIG_TCG_INTERPRETER a Meson option, and enable TCI (though with
>     a warning) if the host CPU is unsupported, making it more similar to
>     other --enable-* options.
> 
>     Remove TCG-specific include paths from !CONFIG_TCG builds.
> 
>     Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> 
> to realize I need to re-bisect from here now including:
> 
> commit c6fbea47664466e526e40300568324ef77e5f2cc
> Author: Richard Henderson <richard.henderson@linaro.org>
> Date:   Sun Jan 24 11:10:55 2021 -1000
> 
>     configure: Fix --enable-tcg-interpreter
> 
>     The configure option was backward, and we failed to
>     pass the value on to meson.
> 
>     Fixes: 23a77b2d18b ("build-system: clean up TCG/TCI configury")
>     Tested-by: Stefan Weil <sw@weilnetz.de>
>     Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
>     Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>     Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
>     Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>     Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

From a buildir configured *before* 23a77b2d18b84, checking out
*after* c6fbea476644 (5b19cb63d9d actually, pull-tcg-20210205
merged today) I get:

[352/396] Compiling C object
libqemu-hppa-linux-user.fa.p/target_hppa_translate.c.o
In file included from /home/philmd/qemu/include/tcg/tcg-op.h:28,
                 from ../target/hppa/translate.c:25:
/home/philmd/qemu/include/tcg/tcg.h:35:10: fatal error: tcg-target.h: No
such file or directory
   35 | #include "tcg-target.h"
      |          ^~~~~~~~~~~~~~
compilation terminated.

When starting in a new empty directory, it works. I don't understand
because there are no generated files involved (similarly to commit
0572d6cd29d).

Note for later: Better merge buildsys fixes sooner rather than later,
as it ease bisections.


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

* Re: [PULL 31/31] qemu-option: warn for short-form boolean options
  2021-01-23 14:31 ` [PULL 31/31] qemu-option: warn for short-form boolean options Paolo Bonzini
@ 2021-02-15 19:56   ` Peter Maydell
  2021-02-15 23:14     ` Paolo Bonzini
  0 siblings, 1 reply; 53+ messages in thread
From: Peter Maydell @ 2021-02-15 19:56 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: QEMU Developers

On Sat, 23 Jan 2021 at 14:50, Paolo Bonzini <pbonzini@redhat.com> wrote:
> Options such as "server" or "nowait", that are commonly found in -chardev,
> are sugar for "server=on" and "wait=off".  This is quite surprising and
> also does not have any notion of typing attached.  It is even possible to
> do "-device e1000,noid" and get a device with "id=off".
>
> Deprecate it and print a warning when it is encountered.  In general,
> this short form for boolean options only seems to be in wide use for
> -chardev and -spice.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

Hi -- if you want to deprecate these ways of writing these options,
could you also go through the documentation and correct the various
examples that still use it, please?

"git grep ',server' docs" finds some of them; I bet there are more.

Alternatively, maybe we could not deprecate this really common syntax
pattern that's going to be in lots of peoples' examples, tutorials,
shell scripts and command lines ?

thanks
-- PMM


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

* Re: [PULL 31/31] qemu-option: warn for short-form boolean options
  2021-02-15 19:56   ` Peter Maydell
@ 2021-02-15 23:14     ` Paolo Bonzini
  2021-02-16  9:58       ` Peter Maydell
  0 siblings, 1 reply; 53+ messages in thread
From: Paolo Bonzini @ 2021-02-15 23:14 UTC (permalink / raw)
  To: Peter Maydell; +Cc: QEMU Developers

[-- Attachment #1: Type: text/plain, Size: 820 bytes --]

Il lun 15 feb 2021, 20:56 Peter Maydell <peter.maydell@linaro.org> ha
scritto:

> Alternatively, maybe we could not deprecate this really common syntax
> pattern that's going to be in lots of peoples' examples, tutorials,
> shell scripts and command lines ?
>

Unfortunately there is no way to change the code to distinguish okay uses
from broken ones. The fundamental issue is that QemuOpts is sometimes typed
and sometimes not, so it lacks the information to say that "-chardev
socket,server" is fine but "-device virtio-blk-pci,noserial" ("set serial
number to the string 'no'") is not.

I don't plan to remove the syntax altogether from QemuOpts, but I want to
keep open the possibility of switching some options (especially -machine
and -object) to a parser which doesn't support it.

Paolo


> thanks
> -- PMM
>
>

[-- Attachment #2: Type: text/html, Size: 1500 bytes --]

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

* Re: [PULL 31/31] qemu-option: warn for short-form boolean options
  2021-02-15 23:14     ` Paolo Bonzini
@ 2021-02-16  9:58       ` Peter Maydell
  2021-02-16 10:43         ` Paolo Bonzini
  0 siblings, 1 reply; 53+ messages in thread
From: Peter Maydell @ 2021-02-16  9:58 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: QEMU Developers

On Mon, 15 Feb 2021 at 23:15, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> Il lun 15 feb 2021, 20:56 Peter Maydell <peter.maydell@linaro.org> ha scritto:
>>
>> Alternatively, maybe we could not deprecate this really common syntax
>> pattern that's going to be in lots of peoples' examples, tutorials,
>> shell scripts and command lines ?
>
>
> Unfortunately there is no way to change the code to distinguish okay
> uses from broken ones. The fundamental issue is that QemuOpts is
> sometimes typed and sometimes not, so it lacks the information to say
> that "-chardev socket,server" is fine but "-device virtio-blk-pci,noserial"
> ("set serial number to the string 'no'") is not.

That is definitely a nonsensical example. But it's not clear to me
that it's an improvement to start forbidding previously sensible and
working command lines in order to be able to diagnose nonsensical
command lines which it seems unlikely that anybody was ever actually
using.

-- PMM


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

* Re: [PULL 31/31] qemu-option: warn for short-form boolean options
  2021-02-16  9:58       ` Peter Maydell
@ 2021-02-16 10:43         ` Paolo Bonzini
  2021-02-16 11:04           ` Peter Maydell
  0 siblings, 1 reply; 53+ messages in thread
From: Paolo Bonzini @ 2021-02-16 10:43 UTC (permalink / raw)
  To: Peter Maydell; +Cc: QEMU Developers

On 16/02/21 10:58, Peter Maydell wrote:
>> Unfortunately there is no way to change the code to distinguish okay
>> uses from broken ones. The fundamental issue is that QemuOpts is
>> sometimes typed and sometimes not, so it lacks the information to say
>> that "-chardev socket,server" is fine but "-device virtio-blk-pci,noserial"
>> ("set serial number to the string 'no'") is not.
>
> That is definitely a nonsensical example. But it's not clear to me
> that it's an improvement to start forbidding previously sensible and
> working command lines in order to be able to diagnose nonsensical
> command lines which it seems unlikely that anybody was ever actually
> using.

The problem with QemuOpts is twofold, in general and specifically for 
short-form boolean options.

On one hand it's the parser itself that is too permissive, because it 
applies a concept that is valid for boolean (short-form options) to all 
types.  This is the above "noserial" case.

On the other hand, the typing of QemuOpts itself is not something that 
is used a lot, especially as more and more options become a sort of 
discriminated union and therefore cannot really have a schema that is 
described in QemuOptsList and this means that it's not really possible 
to fix the other problem within QemuOpts.

The question is whether it's fixable in general.

For this to work, one would need to have a typed string->QAPI parser, 
i.e. one that takes the schema as input rather than doing a generic 
parsing to QDict and then using the schema via the visitor.  That would 
IMHO be overengineered for the purpose of saving five keystrokes on 
"server,nowait".  But even if that were possible, there are two issues:

1) the short-form "-machine kernel-irqchip" is applied not to a boolean 
but rather to an on/off/split enum.  So we would have to either 
introduce extra complication in the schema visitor to distinguish 
"extended boolean" enums from the others (and then, once we have defined 
the concept of "extended boolean enums", would we also accept yes/no in 
addition to on/off?).

2) the lexing is ambiguous.  For example virtio devices define a 
"notify_on_empty" property.  Attempting to set this property with a 
short form would fail, as it would be interpreted as 
"tify_on_empty=off".  Even worse is hw/isa/lpc_ich9.c's "noreboot" 
property (though the device is not user-creatable) for which it is 
possible to write "nonoreboot" but not "noreboot" (interpreted as 
reboot=yes).

I understand that none of these problems make it *impossible* to keep 
the short-form boolean options or even to reimplement them.  However, 
they do make me question whether they are a good idea and not just a 
historical wart.

Again, I do not plan to remove the short forms from QemuOpts.  However, 
I would like not to lock QEMU into the QemuOpts parser and its many 
issues, which are preventing a cleaner evolution of the QEMU command 
line.  (In particular I would like many command line options such as 
-smp, -m or -icount to be syntactic sugar for record properties -machine 
smp.xxx, -machine mem.xxx or -accel tcg,icount.xxx).  Even though I have 
not yet posted patches for this due to the deprecation period of 
short-form boolean options, I _did_ propose the deprecation only after 
writing a bunch of other code around command-line parsing cleanups.

Paolo



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

* Re: [PULL 31/31] qemu-option: warn for short-form boolean options
  2021-02-16 10:43         ` Paolo Bonzini
@ 2021-02-16 11:04           ` Peter Maydell
  2021-02-16 11:23             ` Paolo Bonzini
  0 siblings, 1 reply; 53+ messages in thread
From: Peter Maydell @ 2021-02-16 11:04 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: QEMU Developers

On Tue, 16 Feb 2021 at 10:43, Paolo Bonzini <pbonzini@redhat.com> wrote:
> For this to work, one would need to have a typed string->QAPI parser,
> i.e. one that takes the schema as input rather than doing a generic
> parsing to QDict and then using the schema via the visitor.  That would
> IMHO be overengineered for the purpose of saving five keystrokes on
> "server,nowait".

The point is not that it's saving five keystrokes. The point
is that "server,nowait" is how we've documented that users
should select that functionality since forever, and indeed
is how we're still documenting it today, and therefore changing
it is breaking the existing working setups of a very large
group of users.

Historical warts that nobody much was really using can be safely
excised; historical warts with many many users much less so.

thanks
-- PMM


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

* Re: [PULL 31/31] qemu-option: warn for short-form boolean options
  2021-02-16 11:04           ` Peter Maydell
@ 2021-02-16 11:23             ` Paolo Bonzini
  2021-02-16 11:58               ` Peter Maydell
  0 siblings, 1 reply; 53+ messages in thread
From: Paolo Bonzini @ 2021-02-16 11:23 UTC (permalink / raw)
  To: Peter Maydell; +Cc: QEMU Developers

On 16/02/21 12:04, Peter Maydell wrote:
> On Tue, 16 Feb 2021 at 10:43, Paolo Bonzini <pbonzini@redhat.com> wrote:
>> For this to work, one would need to have a typed string->QAPI parser,
>> i.e. one that takes the schema as input rather than doing a generic
>> parsing to QDict and then using the schema via the visitor.  That would
>> IMHO be overengineered for the purpose of saving five keystrokes on
>> "server,nowait".
> 
> The point is not that it's saving five keystrokes. The point
> is that "server,nowait" is how we've documented that users
> should select that functionality since forever, and indeed
> is how we're still documenting it today, and therefore changing
> it is breaking the existing working setups of a very large
> group of users.
> 
> Historical warts that nobody much was really using can be safely
> excised; historical warts with many many users much less so.

I agree, and that's why I have no plans to move -chardev off QemuOpts; 
warning is a different step than excising and sometimes years pass from 
one to the other.  However, that doesn't prevent introducing a warning 
so that users slowly move away from the problematic functionality.

Also, "-chardev" is not the way that most users will configure sockets. 
  The more common "-serial tcp:localhost:12345,server,nowait" will not 
trigger the warning; that was not clear at all from the the commit 
message.  It may even make sense to deprecate the *long* form in that 
case (which I am not planning to do, to be clear).   I'll fix the 
documentation for those uses that are affected, though; thanks for 
reporting that.

Paolo



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

* Re: [PULL 31/31] qemu-option: warn for short-form boolean options
  2021-02-16 11:23             ` Paolo Bonzini
@ 2021-02-16 11:58               ` Peter Maydell
  2021-02-16 13:30                 ` Paolo Bonzini
  0 siblings, 1 reply; 53+ messages in thread
From: Peter Maydell @ 2021-02-16 11:58 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: QEMU Developers

On Tue, 16 Feb 2021 at 11:23, Paolo Bonzini <pbonzini@redhat.com> wrote:
> I agree, and that's why I have no plans to move -chardev off QemuOpts;
> warning is a different step than excising and sometimes years pass from
> one to the other.  However, that doesn't prevent introducing a warning
> so that users slowly move away from the problematic functionality.

If we want to continue to support the functionality then complaining
about it doesn't serve much purpose IMHO.

> Also, "-chardev" is not the way that most users will configure sockets.
>   The more common "-serial tcp:localhost:12345,server,nowait" will not
> trigger the warning; that was not clear at all from the the commit
> message.  It may even make sense to deprecate the *long* form in that
> case (which I am not planning to do, to be clear).   I'll fix the
> documentation for those uses that are affected, though; thanks for
> reporting that.

A bunch of my local scripts for running QEMU got hit by this new
deprecation warning; "git grep 'chardev.*nowait'" gets hits in
our documentation; if you google for 'chardev "server,nowait"' there
are plenty of in-the-wild uses.

Is there any other serious use of the 'no' prefix other than
'nowait' ? Perhaps we could get most of the benefit here by
banning the 'no' prefix and adding a compatibility 'nowait'
bool which had the inverse sense to the existing 'wait' bool ?
(TBH I had assumed that 'nowait' was already implemented that
way; 'nodelay' is.)

-- PMM


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

* Re: [PULL 31/31] qemu-option: warn for short-form boolean options
  2021-02-16 11:58               ` Peter Maydell
@ 2021-02-16 13:30                 ` Paolo Bonzini
  2021-02-16 13:36                   ` Peter Maydell
  0 siblings, 1 reply; 53+ messages in thread
From: Paolo Bonzini @ 2021-02-16 13:30 UTC (permalink / raw)
  To: Peter Maydell; +Cc: QEMU Developers

On 16/02/21 12:58, Peter Maydell wrote:
> On Tue, 16 Feb 2021 at 11:23, Paolo Bonzini <pbonzini@redhat.com> wrote:
>> I agree, and that's why I have no plans to move -chardev off QemuOpts;
>> warning is a different step than excising and sometimes years pass from
>> one to the other.  However, that doesn't prevent introducing a warning
>> so that users slowly move away from the problematic functionality.
> 
> If we want to continue to support the functionality then complaining
> about it doesn't serve much purpose IMHO.

It depends.  I don't want to support it forever for all options; 
-machine, -accel and -object are those for which I do intend to remove 
support for short-form options after the two release deprecation period.

My first submission of this patch even special cased "-chardev" to hide 
the warning, but this was dropped in response to reviews. 
(https://patchew.org/QEMU/20201103151452.416784-1-pbonzini@redhat.com/20201103151452.416784-5-pbonzini@redhat.com/). 
  I can add that back if you prefer, since it's very simple.

Paolo

> A bunch of my local scripts for running QEMU got hit by this new
> deprecation warning; "git grep 'chardev.*nowait'" gets hits in
> our documentation; if you google for 'chardev "server,nowait"' there
> are plenty of in-the-wild uses.
> 
> Is there any other serious use of the 'no' prefix other than
> 'nowait' ? Perhaps we could get most of the benefit here by
> banning the 'no' prefix and adding a compatibility 'nowait'
> bool which had the inverse sense to the existing 'wait' bool ?
> (TBH I had assumed that 'nowait' was already implemented that
> way; 'nodelay' is.)



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

* Re: [PULL 31/31] qemu-option: warn for short-form boolean options
  2021-02-16 13:30                 ` Paolo Bonzini
@ 2021-02-16 13:36                   ` Peter Maydell
  2021-02-16 13:43                     ` Paolo Bonzini
  2021-02-16 13:53                     ` Daniel P. Berrangé
  0 siblings, 2 replies; 53+ messages in thread
From: Peter Maydell @ 2021-02-16 13:36 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: QEMU Developers

On Tue, 16 Feb 2021 at 13:30, Paolo Bonzini <pbonzini@redhat.com> wrote:
> On 16/02/21 12:58, Peter Maydell wrote:
> > On Tue, 16 Feb 2021 at 11:23, Paolo Bonzini <pbonzini@redhat.com> wrote:
> >> I agree, and that's why I have no plans to move -chardev off QemuOpts;
> >> warning is a different step than excising and sometimes years pass from
> >> one to the other.  However, that doesn't prevent introducing a warning
> >> so that users slowly move away from the problematic functionality.
> >
> > If we want to continue to support the functionality then complaining
> > about it doesn't serve much purpose IMHO.
>
> It depends.  I don't want to support it forever for all options;
> -machine, -accel and -object are those for which I do intend to remove
> support for short-form options after the two release deprecation period.
>
> My first submission of this patch even special cased "-chardev" to hide
> the warning, but this was dropped in response to reviews.
> (https://patchew.org/QEMU/20201103151452.416784-1-pbonzini@redhat.com/20201103151452.416784-5-pbonzini@redhat.com/).
>   I can add that back if you prefer, since it's very simple.

I agree with Daniel that it would be better to be consistent about
whether we like these short options or not, but disagree that
the answer is to deprecate everywhere :-)

Broadly, I think that being able to say 'foo' when foo is a
boolean option being set to true is obvious and nice-to-use
syntax, and I don't really want it to go away. 'nofoo' for
'foo=false' is much less obvious and I'm happy if we only
support it as a special-case for 'nowait'.

-- PMM


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

* Re: [PULL 31/31] qemu-option: warn for short-form boolean options
  2021-02-16 13:36                   ` Peter Maydell
@ 2021-02-16 13:43                     ` Paolo Bonzini
  2021-02-16 14:11                       ` Peter Maydell
  2021-02-16 13:53                     ` Daniel P. Berrangé
  1 sibling, 1 reply; 53+ messages in thread
From: Paolo Bonzini @ 2021-02-16 13:43 UTC (permalink / raw)
  To: Peter Maydell; +Cc: QEMU Developers

On 16/02/21 14:36, Peter Maydell wrote:
>> My first submission of this patch even special cased "-chardev" to hide
>> the warning, but this was dropped in response to reviews.
>> (https://patchew.org/QEMU/20201103151452.416784-1-pbonzini@redhat.com/20201103151452.416784-5-pbonzini@redhat.com/).
>>    I can add that back if you prefer, since it's very simple.
> I agree with Daniel that it would be better to be consistent about
> whether we like these short options or not, but disagree that
> the answer is to deprecate everywhere:-)
> 
> Broadly, I think that being able to say 'foo' when foo is a
> boolean option being set to true is obvious and nice-to-use
> syntax, and I don't really want it to go away. 'nofoo' for
> 'foo=false' is much less obvious and I'm happy if we only
> support it as a special-case for 'nowait'.

It really depends on what the default  "-M pc,nographics" arguably makes 
sense too (more so than "-M pc,graphics" since true is the default). 
Likewise for "usb", where the default even depends on the machine type.

How do you propose to resolve the issues and ambiguities in the grammar?

1) due to QemuOpts not understanding types, you can specify "serial" and 
get "serial=on" instead

2) with a parser that understands other types than strings, you would 
not be able to specify "-M kernel-irqchip" because it would be converted 
to the boolean "true" and not the enum "'on'"

3) one is not be able to specify "-M pc" -M usb" because the second 
kernel-irqchip would be interpreted as a machine type?

Thanks,

Paolo



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

* Re: [PULL 31/31] qemu-option: warn for short-form boolean options
  2021-02-16 13:36                   ` Peter Maydell
  2021-02-16 13:43                     ` Paolo Bonzini
@ 2021-02-16 13:53                     ` Daniel P. Berrangé
  1 sibling, 0 replies; 53+ messages in thread
From: Daniel P. Berrangé @ 2021-02-16 13:53 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Paolo Bonzini, QEMU Developers

On Tue, Feb 16, 2021 at 01:36:46PM +0000, Peter Maydell wrote:
> On Tue, 16 Feb 2021 at 13:30, Paolo Bonzini <pbonzini@redhat.com> wrote:
> > On 16/02/21 12:58, Peter Maydell wrote:
> > > On Tue, 16 Feb 2021 at 11:23, Paolo Bonzini <pbonzini@redhat.com> wrote:
> > >> I agree, and that's why I have no plans to move -chardev off QemuOpts;
> > >> warning is a different step than excising and sometimes years pass from
> > >> one to the other.  However, that doesn't prevent introducing a warning
> > >> so that users slowly move away from the problematic functionality.
> > >
> > > If we want to continue to support the functionality then complaining
> > > about it doesn't serve much purpose IMHO.
> >
> > It depends.  I don't want to support it forever for all options;
> > -machine, -accel and -object are those for which I do intend to remove
> > support for short-form options after the two release deprecation period.
> >
> > My first submission of this patch even special cased "-chardev" to hide
> > the warning, but this was dropped in response to reviews.
> > (https://patchew.org/QEMU/20201103151452.416784-1-pbonzini@redhat.com/20201103151452.416784-5-pbonzini@redhat.com/).
> >   I can add that back if you prefer, since it's very simple.
> 
> I agree with Daniel that it would be better to be consistent about
> whether we like these short options or not, but disagree that
> the answer is to deprecate everywhere :-)
> 
> Broadly, I think that being able to say 'foo' when foo is a
> boolean option being set to true is obvious and nice-to-use
> syntax, and I don't really want it to go away. 'nofoo' for
> 'foo=false' is much less obvious and I'm happy if we only
> support it as a special-case for 'nowait'.

There's an inherant tension in our goals here.

It is widely thought that QEMU configuration is complex and painful to
understand. From my POV a big part of that believe comes from the fact
that we have so many inconsistencies in our parsing code, and many ways
of doing the same thing.

Every time we have special cases like  "foo" as a short hand for "foo=on"
or "nofoo" as a short hand for "foo=off",  we increase the complexity of
QEMU and that impacts how our users view QEMU. 

IMHO we'd be better off eliminating the boolean short forms entirely
in all QEMU options, so that we get consistency and a clearer right way
of doing things. The short bool format was created with good intentions,
but on balance a bare "foo" isn't a big enough win over "foo=on" to
justify its existance long term.

I do agree though, that we should not be deprecating something if our
documentation is still showing people the deprecated syntax, as that
makes us look even worse.

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



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

* Re: [PULL 31/31] qemu-option: warn for short-form boolean options
  2021-02-16 13:43                     ` Paolo Bonzini
@ 2021-02-16 14:11                       ` Peter Maydell
  2021-02-16 14:45                         ` Paolo Bonzini
  0 siblings, 1 reply; 53+ messages in thread
From: Peter Maydell @ 2021-02-16 14:11 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: QEMU Developers

On Tue, 16 Feb 2021 at 13:44, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> On 16/02/21 14:36, Peter Maydell wrote:
> > Broadly, I think that being able to say 'foo' when foo is a
> > boolean option being set to true is obvious and nice-to-use
> > syntax, and I don't really want it to go away. 'nofoo' for
> > 'foo=false' is much less obvious and I'm happy if we only
> > support it as a special-case for 'nowait'.
>
> It really depends on what the default  "-M pc,nographics" arguably makes
> sense too (more so than "-M pc,graphics" since true is the default).

Is anybody using 'pc,nographics' ? google didn't find any examples.

> Likewise for "usb", where the default even depends on the machine type.
>
> How do you propose to resolve the issues and ambiguities in the grammar?
>
> 1) due to QemuOpts not understanding types, you can specify "serial" and
> get "serial=on" instead

We should fix this by plumbing through the type information,
so that we only allow 'foo' to mean 'foo=on' if foo is really
a boolean (or other type that specifies that it has similar behaviour).

> 2) with a parser that understands other types than strings, you would
> not be able to specify "-M kernel-irqchip" because it would be converted
> to the boolean "true" and not the enum "'on'"

We should decide whether 'kernel-irqchip' has a type that
allows 'no parameter specified' => 'use this default value'
or not, and if we go for the latter use whatever default value
the backend expects. (And probably "boolean-and-an-extra-value"
types should allow the boolean bit to be specified in all the
same ways that a plain-old-boolean is.)

> 3) one is not be able to specify "-M pc" -M usb" because the second
> kernel-irqchip would be interpreted as a machine type?

I don't understand this one, I'm afraid.

-- PMM


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

* Re: [PULL 31/31] qemu-option: warn for short-form boolean options
  2021-02-16 14:11                       ` Peter Maydell
@ 2021-02-16 14:45                         ` Paolo Bonzini
  2021-02-16 14:51                           ` Peter Maydell
  0 siblings, 1 reply; 53+ messages in thread
From: Paolo Bonzini @ 2021-02-16 14:45 UTC (permalink / raw)
  To: Peter Maydell; +Cc: QEMU Developers

[-- Attachment #1: Type: text/plain, Size: 3514 bytes --]

Il mar 16 feb 2021, 15:11 Peter Maydell <peter.maydell@linaro.org> ha
scritto:

> On Tue, 16 Feb 2021 at 13:44, Paolo Bonzini <pbonzini@redhat.com> wrote:
> >
> > On 16/02/21 14:36, Peter Maydell wrote:
> > > Broadly, I think that being able to say 'foo' when foo is a
> > > boolean option being set to true is obvious and nice-to-use
> > > syntax, and I don't really want it to go away. 'nofoo' for
> > > 'foo=false' is much less obvious and I'm happy if we only
> > > support it as a special-case for 'nowait'.
> >
> > It really depends on what the default  "-M pc,nographics" arguably makes
> > sense too (more so than "-M pc,graphics" since true is the default).
>
> Is anybody using 'pc,nographics' ? google didn't find any examples.
>

It's just an example that the prevalence of "nowait" over "wait" is simply
because the default of "server" is false while the default of "wait" is
true. Any boolean option whose default is true could benefit from a
"no"-prefixed short form. But I am pretty sure that there are users in the
wild for noipv4 or noipv6.

> How do you propose to resolve the issues and ambiguities in the grammar?
> >
> > 1) due to QemuOpts not understanding types, you can specify "serial" and
> > get "serial=on" instead
>
> We should fix this by plumbing through the type information,
> so that we only allow 'foo' to mean 'foo=on' if foo is really
> a boolean (or other type that specifies that it has similar behaviour).
>

There's already type information for non-freeform options (those where the
QemuOptsList includes the list of valid suboptions, such as -smp or -m).
Adding it for freeform options (-M, -device) is basically impossible since
the type information comes from a mix of QAPI schema, QOM class
declarations and C code. One would basically have to do an incremental
visit of the schema (assuming there is a schema, and it's not just C code)
during the parsing. This is understandably not something I plan to spend
time on.

I could change QemuOpts to allow short forms for non-freeform option
groups, and turn -chardev into a non-freeform option. That would solve the
immediate issue with chardev. But I agree that consistent behavior is
better, so I don't think this is a good idea either.

> 2) with a parser that understands other types than strings, you would
> > not be able to specify "-M kernel-irqchip" because it would be converted
> > to the boolean "true" and not the enum "'on'"
>
> We should decide whether 'kernel-irqchip' has a type that
> allows 'no parameter specified' => 'use this default value'
> or not, and if we go for the latter use whatever default value
> the backend expects.


I don't understand, the point of short-form options is to use a
*non-default* value. (In other words, the affirmative short form would
typically be used to specify true when the default is false).

(And probably "boolean-and-an-extra-value"
> types should allow the boolean bit to be specified in all the
> same ways that a plain-old-boolean is.)


> > 3) one is not be able to specify "-M pc" -M usb" because the second
> > kernel-irqchip would be interpreted as a machine type?
>
> I don't understand this one, I'm afraid.
>

I mean that "-M pc -M usb" is parsed as "-machine type=pc -machine
type=usb" and then merged into "-machine type=usb". The user would expect
"-machine type=c -machine usb=on" since "-M pc -M usb=on" works. So
"usb=on" cannot always be shortened to "usb", which is surprising. I think
this one only affects -M though.

Paolo


> -- PMM
>
>

[-- Attachment #2: Type: text/html, Size: 5615 bytes --]

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

* Re: [PULL 31/31] qemu-option: warn for short-form boolean options
  2021-02-16 14:45                         ` Paolo Bonzini
@ 2021-02-16 14:51                           ` Peter Maydell
  2021-02-16 14:58                             ` Paolo Bonzini
  0 siblings, 1 reply; 53+ messages in thread
From: Peter Maydell @ 2021-02-16 14:51 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: QEMU Developers

On Tue, 16 Feb 2021 at 14:45, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> Il mar 16 feb 2021, 15:11 Peter Maydell <peter.maydell@linaro.org> ha scritto:
>>
>> On Tue, 16 Feb 2021 at 13:44, Paolo Bonzini <pbonzini@redhat.com> wrote:
>> >
>> > On 16/02/21 14:36, Peter Maydell wrote:
>> > > Broadly, I think that being able to say 'foo' when foo is a
>> > > boolean option being set to true is obvious and nice-to-use
>> > > syntax, and I don't really want it to go away. 'nofoo' for
>> > > 'foo=false' is much less obvious and I'm happy if we only
>> > > support it as a special-case for 'nowait'.
>> >
>> > It really depends on what the default  "-M pc,nographics" arguably makes
>> > sense too (more so than "-M pc,graphics" since true is the default).
>>
>> Is anybody using 'pc,nographics' ? google didn't find any examples.
>
>
> It's just an example that the prevalence of "nowait" over "wait" is simply because the default of "server" is false while the default of "wait" is true. Any boolean option whose default is true could benefit from a "no"-prefixed short form. But I am pretty sure that there are users in the wild for noipv4 or noipv6.

I think 'nowait' is special only because for so long our documentation
has recommended 'server,nowait' (and possibly also because inetd
uses 'nowait'?). I don't think it's inherently much better than
"wait=off" or whatever. I just think that if we have a situation
where exactly 1 boolean option has very widespread use of 'nofoo' then
it's worth special casing it. If we had 50 boolean options which all
had about 10% use of 'nofoo' vs 90% 'foo=off' that would be different.

-- PMM


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

* Re: [PULL 31/31] qemu-option: warn for short-form boolean options
  2021-02-16 14:51                           ` Peter Maydell
@ 2021-02-16 14:58                             ` Paolo Bonzini
  0 siblings, 0 replies; 53+ messages in thread
From: Paolo Bonzini @ 2021-02-16 14:58 UTC (permalink / raw)
  To: Peter Maydell; +Cc: QEMU Developers

[-- Attachment #1: Type: text/plain, Size: 1037 bytes --]

Il mar 16 feb 2021, 15:52 Peter Maydell <peter.maydell@linaro.org> ha
scritto:

> > It's just an example that the prevalence of "nowait" over "wait" is
> simply because the default of "server" is false while the default of "wait"
> is true. Any boolean option whose default is true could benefit from a
> "no"-prefixed short form. But I am pretty sure that there are users in the
> wild for noipv4 or noipv6.
>
> I think 'nowait' is special only because for so long our documentation
> has recommended 'server,nowait' (and possibly also because inetd
> uses 'nowait'?). I don't think it's inherently much better than
> "wait=off" or whatever. I just think that if we have a situation
> where exactly 1 boolean option has very widespread use of 'nofoo' then
> it's worth special casing it.
>

If the point is just the one option that needs to be special cased because
it's in the documentation, that also applies at a higher level to -chardev:
let's just not warn for that one, and that's the end of the discussion.

Paolo


> -- PMM
>
>

[-- Attachment #2: Type: text/html, Size: 1753 bytes --]

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

end of thread, other threads:[~2021-02-16 15:01 UTC | newest]

Thread overview: 53+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-23 14:30 [PULL 00/31] Misc patches for 2020-01-21 Paolo Bonzini
2021-01-23 14:30 ` [PULL 01/31] runstate: cleanup reboot and panic actions Paolo Bonzini
2021-01-23 14:30 ` [PULL 02/31] configure: MinGW respect --bindir argument Paolo Bonzini
2021-01-23 14:31 ` [PULL 03/31] x86/cpu: Use max host physical address if -cpu max option is applied Paolo Bonzini
2021-01-23 14:31 ` [PULL 04/31] build-system: clean up TCG/TCI configury Paolo Bonzini
2021-02-06 18:01   ` Philippe Mathieu-Daudé
2021-02-06 19:08     ` Philippe Mathieu-Daudé
2021-01-23 14:31 ` [PULL 05/31] util/cacheflush: Fix error generated by clang Paolo Bonzini
2021-01-23 14:31 ` [PULL 06/31] softmmu/physmem: Silence GCC 10 maybe-uninitialized error Paolo Bonzini
2021-01-23 14:31 ` [PULL 07/31] ide: atapi: check logical block address and read size (CVE-2020-29443) Paolo Bonzini
2021-01-23 14:31 ` [PULL 08/31] build-sys: remove unused LIBS Paolo Bonzini
2021-01-23 14:31 ` [PULL 09/31] build-sys: set global arguments for cflags/ldflags Paolo Bonzini
2021-01-23 14:31 ` [PULL 10/31] build-sys: add libvhost-user missing dependencies Paolo Bonzini
2021-01-23 14:31 ` [PULL 11/31] slirp: update to git master Paolo Bonzini
2021-01-23 14:31 ` [PULL 12/31] meson: Declare have_virtfs_proxy_helper in main meson.build Paolo Bonzini
2021-01-23 14:31 ` [PULL 13/31] nsis: adjust for new MinGW paths Paolo Bonzini
2021-01-23 14:31 ` [PULL 14/31] meson: convert wixl detection to Meson Paolo Bonzini
2021-01-23 14:31 ` [PULL 15/31] meson: Summarize information related to directories first Paolo Bonzini
2021-01-23 14:31 ` [PULL 16/31] meson: Display host binaries information altogether Paolo Bonzini
2021-01-23 14:31 ` [PULL 17/31] meson: Summarize overall features altogether Paolo Bonzini
2021-01-23 14:31 ` [PULL 18/31] meson: Summarize compilation-related information altogether Paolo Bonzini
2021-01-23 14:31 ` [PULL 19/31] meson: Display accelerators and selected targets altogether Paolo Bonzini
2021-01-23 14:31 ` [PULL 20/31] meson: Display block layer information altogether Paolo Bonzini
2021-01-23 14:31 ` [PULL 21/31] meson: Display crypto-related " Paolo Bonzini
2021-01-23 14:31 ` [PULL 22/31] meson: Add a section header for library dependencies Paolo Bonzini
2021-01-23 14:31 ` [PULL 23/31] meson.build: Declare global edk2_targets / install_edk2_blobs variables Paolo Bonzini
2021-01-23 14:31 ` [PULL 24/31] meson.build: Detect bzip2 program Paolo Bonzini
2021-01-23 14:31 ` [PULL 25/31] acceptance: switch to QMP change-vnc-password command Paolo Bonzini
2021-01-23 14:31 ` [PULL 26/31] hmp: remove "change vnc TARGET" command Paolo Bonzini
2021-01-23 14:31 ` [PULL 27/31] qmp: remove deprecated "change" command Paolo Bonzini
2021-01-23 14:31 ` [PULL 28/31] vnc: support "-vnc help" Paolo Bonzini
2021-01-23 14:31 ` [PULL 29/31] qemu-option: clean up id vs. list->merge_lists Paolo Bonzini
2021-01-25  7:42   ` Markus Armbruster
2021-01-25  7:58     ` Paolo Bonzini
2021-01-23 14:31 ` [PULL 30/31] qemu-option: move help handling to get_opt_name_value Paolo Bonzini
2021-01-23 14:31 ` [PULL 31/31] qemu-option: warn for short-form boolean options Paolo Bonzini
2021-02-15 19:56   ` Peter Maydell
2021-02-15 23:14     ` Paolo Bonzini
2021-02-16  9:58       ` Peter Maydell
2021-02-16 10:43         ` Paolo Bonzini
2021-02-16 11:04           ` Peter Maydell
2021-02-16 11:23             ` Paolo Bonzini
2021-02-16 11:58               ` Peter Maydell
2021-02-16 13:30                 ` Paolo Bonzini
2021-02-16 13:36                   ` Peter Maydell
2021-02-16 13:43                     ` Paolo Bonzini
2021-02-16 14:11                       ` Peter Maydell
2021-02-16 14:45                         ` Paolo Bonzini
2021-02-16 14:51                           ` Peter Maydell
2021-02-16 14:58                             ` Paolo Bonzini
2021-02-16 13:53                     ` Daniel P. Berrangé
2021-01-23 14:57 ` [PULL 00/31] Misc patches for 2020-01-21 no-reply
2021-01-23 19:52 ` 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.