qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PULL 00/29] Misc patches for 2021-02-25
@ 2021-02-26  8:04 Paolo Bonzini
  2021-02-26  8:04 ` [PULL 01/29] hvf: Sign the code after installation Paolo Bonzini
                   ` (30 more replies)
  0 siblings, 31 replies; 41+ messages in thread
From: Paolo Bonzini @ 2021-02-26  8:04 UTC (permalink / raw)
  To: qemu-devel

The following changes since commit 00d8ba9e0d62ea1c7459c25aeabf9c8bb7659462:

  Merge remote-tracking branch 'remotes/philmd-gitlab/tags/mips-20210221' into staging (2021-02-21 19:52:58 +0000)

are available in the Git repository at:

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

for you to fetch changes up to b7ea7d82903f125e393b7957d1add25cf6b522dd:

  tcg/i386: rdpmc: fix the the condtions (2021-02-25 14:49:01 +0100)

----------------------------------------------------------------
* fix --enable-fuzzing linker failures (Alexander)
* target/i386: Add bus lock debug exception support (Chenyi)
* update documentation for preferred boolean option syntax (Daniel)
* make SCSI io_timeout configurable (Hannes)
* fix handling of guest recoverable SCSI errors (myself)
* misc fixes (Pavel, Zheng Zhan Liang, Zihao)
* fix installation of binaries with entitlements (Akihiko)

----------------------------------------------------------------
Akihiko Odaki (1):
      hvf: Sign the code after installation

Alexander Bulekov (1):
      configure: fix --enable-fuzzing linker failures

Chenyi Qiang (1):
      target/i386: Add bus lock debug exception support

Daniel P. Berrangé (10):
      gdbstub: use preferred boolean option syntax
      qemu-options: update to show preferred boolean syntax for -chardev
      qemu-options: update to show preferred boolean syntax for -spice
      qemu-options: update to show preferred boolean syntax for -netdev
      qemu-options: update to show preferred boolean syntax for -incoming
      qemu-options: update to show preferred boolean syntax for -vnc
      docs: update to show preferred boolean syntax for -chardev
      docs: update to show preferred boolean syntax for -vnc
      docs: update to show preferred boolean syntax for -cpu
      target/i386: update to show preferred boolean syntax for -cpu

Doug Evans (1):
      qom/object.c: Fix typo

Hannes Reinecke (3):
      scsi: make io_timeout configurable
      scsi: add tracing for SG_IO commands
      scsi: drop 'result' argument from command_complete callback

Maxim Levitsky (1):
      virtio-scsi: don't process IO on fenced dataplane

Paolo Bonzini (8):
      multiprocess: move feature to meson_options.txt
      scsi-disk: move scsi_handle_rw_error earlier
      scsi-disk: do not complete requests early for rerror/werror=ignore
      scsi: introduce scsi_sense_from_errno()
      scsi-disk: pass SCSI status to scsi_handle_rw_error
      scsi-disk: pass guest recoverable errors through even for rerror=stop
      vl: deprecate -writeconfig
      chardev: do not use short form boolean options in non-QemuOpts character device descriptions

Pavel Dovgalyuk (1):
      char: don't fail when client is not connected

Zheng Zhan Liang (1):
      tcg/i386: rdpmc: fix the the condtions

Zihao Chang (1):
      scsi: allow user to set werror as report

 chardev/char-socket.c                  |  13 ++-
 configure                              |  24 +++--
 docs/COLO-FT.txt                       |  12 +--
 docs/ccid.txt                          |   6 +-
 docs/colo-proxy.txt                    |  16 +--
 docs/devel/writing-qmp-commands.txt    |   2 +-
 docs/interop/firmware.json             |   2 +-
 docs/interop/live-block-operations.rst |   4 +-
 docs/interop/qmp-intro.txt             |   4 +-
 docs/system/cpu-hotplug.rst            |   2 +-
 docs/system/cpu-models-x86.rst.inc     |   4 +-
 docs/system/deprecated.rst             |   7 ++
 docs/system/s390x/3270.rst             |   2 +-
 docs/system/target-avr.rst             |   2 +-
 docs/system/vnc-security.rst           |   8 +-
 docs/tools/qemu-storage-daemon.rst     |   4 +-
 gdbstub.c                              |   2 +-
 hw/scsi/esp-pci.c                      |   5 +-
 hw/scsi/esp.c                          |   7 +-
 hw/scsi/lsi53c895a.c                   |   6 +-
 hw/scsi/megasas.c                      |   6 +-
 hw/scsi/mptsas.c                       |   5 +-
 hw/scsi/scsi-bus.c                     |   2 +-
 hw/scsi/scsi-disk.c                    | 172 ++++++++++++++++-----------------
 hw/scsi/scsi-generic.c                 |  28 ++++--
 hw/scsi/spapr_vscsi.c                  |  12 +--
 hw/scsi/trace-events                   |   4 +
 hw/scsi/virtio-scsi-dataplane.c        |  24 +++--
 hw/scsi/virtio-scsi.c                  |   5 +-
 hw/scsi/vmw_pvscsi.c                   |   4 +-
 hw/usb/dev-storage.c                   |   6 +-
 hw/usb/dev-uas.c                       |   7 +-
 include/hw/scsi/esp.h                  |   2 +-
 include/hw/scsi/scsi.h                 |   6 +-
 include/scsi/utils.h                   |   2 +
 meson.build                            |  18 +++-
 meson_options.txt                      |   2 +
 qapi/char.json                         |   4 +-
 qemu-options.hx                        | 138 +++++++++++++-------------
 qom/object.c                           |   2 +-
 scripts/entitlement.sh                 |  19 +++-
 scripts/qmp/qemu-ga-client             |   2 +-
 scsi/utils.c                           |  51 ++++++++--
 softmmu/vl.c                           |   1 +
 target/i386/cpu.c                      |   4 +-
 target/i386/cpu.h                      |   2 +
 target/i386/tcg/misc_helper.c          |   3 +-
 tests/guest-debug/run-test.py          |   8 +-
 tests/qtest/test-x86-cpuid-compat.c    |  52 +++++-----
 tests/test-char.c                      |   4 +-
 50 files changed, 405 insertions(+), 322 deletions(-)
-- 
2.29.2



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

* [PULL 01/29] hvf: Sign the code after installation
  2021-02-26  8:04 [PULL 00/29] Misc patches for 2021-02-25 Paolo Bonzini
@ 2021-02-26  8:04 ` Paolo Bonzini
  2021-02-26  8:04 ` [PULL 02/29] configure: fix --enable-fuzzing linker failures Paolo Bonzini
                   ` (29 subsequent siblings)
  30 siblings, 0 replies; 41+ messages in thread
From: Paolo Bonzini @ 2021-02-26  8:04 UTC (permalink / raw)
  To: qemu-devel; +Cc: Akihiko Odaki

From: Akihiko Odaki <akihiko.odaki@gmail.com>

Before this change, the code signed during the build was installed
directly.

However, the signature gets invalidated because meson modifies the code
to fix dynamic library install names during the install process.

It also prevents meson to strip the code because the pre-signed file is
not marked as an executable (although it is somehow able to perform the
modification described above).

With this change, the unsigned code will be installed and modified by
meson first, and a script signs it later.

Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com>
Message-Id: <20210225000614.46919-1-akihiko.odaki@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 meson.build            |  9 ++++++---
 scripts/entitlement.sh | 19 +++++++++++++++----
 2 files changed, 21 insertions(+), 7 deletions(-)

diff --git a/meson.build b/meson.build
index 05a67c20d9..c79cb20993 100644
--- a/meson.build
+++ b/meson.build
@@ -2224,7 +2224,7 @@ foreach target : target_dirs
     endif
 
     emulator = executable(exe_name, exe['sources'],
-               install: not exe_sign,
+               install: true,
                c_args: c_args,
                dependencies: arch_deps + deps + exe['dependencies'],
                objects: lib.extract_all_objects(recursive: true),
@@ -2235,8 +2235,6 @@ foreach target : target_dirs
 
     if exe_sign
       emulators += {exe['name'] : custom_target(exe['name'],
-                   install: true,
-                   install_dir: get_option('bindir'),
                    depends: emulator,
                    output: exe['name'],
                    command: [
@@ -2246,6 +2244,11 @@ foreach target : target_dirs
                      meson.current_source_dir() / 'accel/hvf/entitlements.plist'
                    ])
       }
+
+      meson.add_install_script('scripts/entitlement.sh', '--install',
+                               get_option('bindir') / exe_name,
+                               get_option('bindir') / exe['name'],
+                               meson.current_source_dir() / 'accel/hvf/entitlements.plist')
     else
       emulators += {exe['name']: emulator}
     endif
diff --git a/scripts/entitlement.sh b/scripts/entitlement.sh
index c540fa6435..0f61d15376 100755
--- a/scripts/entitlement.sh
+++ b/scripts/entitlement.sh
@@ -2,12 +2,23 @@
 #
 # Helper script for the build process to apply entitlements
 
+copy=:
+if [ "$1" = --install ]; then
+  shift
+  copy=false
+  cd "$MESON_INSTALL_DESTDIR_PREFIX"
+fi
+
 SRC="$1"
 DST="$2"
 ENTITLEMENT="$3"
 
-trap 'rm "$DST.tmp"' exit
-cp -af "$SRC" "$DST.tmp"
-codesign --entitlements "$ENTITLEMENT" --force -s - "$DST.tmp"
-mv "$DST.tmp" "$DST"
+if $copy; then
+  trap 'rm "$DST.tmp"' exit
+  cp -af "$SRC" "$DST.tmp"
+  SRC="$DST.tmp"
+fi
+
+codesign --entitlements "$ENTITLEMENT" --force -s - "$SRC"
+mv -f "$SRC" "$DST"
 trap '' exit
-- 
2.29.2




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

* [PULL 02/29] configure: fix --enable-fuzzing linker failures
  2021-02-26  8:04 [PULL 00/29] Misc patches for 2021-02-25 Paolo Bonzini
  2021-02-26  8:04 ` [PULL 01/29] hvf: Sign the code after installation Paolo Bonzini
@ 2021-02-26  8:04 ` Paolo Bonzini
  2021-02-26  8:05 ` [PULL 03/29] multiprocess: move feature to meson_options.txt Paolo Bonzini
                   ` (28 subsequent siblings)
  30 siblings, 0 replies; 41+ messages in thread
From: Paolo Bonzini @ 2021-02-26  8:04 UTC (permalink / raw)
  To: qemu-devel; +Cc: Alexander Bulekov, Li Qiang

From: Alexander Bulekov <alxndr@bu.edu>

With --enable-fuzzing, QEMU_CFLAGS include -fsanitize=fuzzer-no-link.
This should allow us to build non-fuzzer binaries using objects
instrumented for fuzzing. However, to do that, we also need to link with
-fsanitize=fuzzer-no-link. We were not doing that.

Reported-by: Li Qiang <liq3ea@163.com>,
Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
Message-Id: <20210221174510.22542-1-alxndr@bu.edu>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 configure | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/configure b/configure
index a79b3746d4..19f2b88589 100755
--- a/configure
+++ b/configure
@@ -6096,7 +6096,17 @@ if test "$fuzzing" = "yes" ; then
   # If LIB_FUZZING_ENGINE is set, assume we are running on OSS-Fuzz, and the
   # needed CFLAGS have already been provided
   if test -z "${LIB_FUZZING_ENGINE+xxx}" ; then
+    # Add CFLAGS to tell clang to add fuzzer-related instrumentation to all the
+    # compiled code.
     QEMU_CFLAGS="$QEMU_CFLAGS -fsanitize=fuzzer-no-link"
+    # To build non-fuzzer binaries with --enable-fuzzing, link everything with
+    # fsanitize=fuzzer-no-link. Otherwise, the linker will be unable to bind
+    # the fuzzer-related callbacks added by instrumentation.
+    QEMU_LDFLAGS="$QEMU_LDFLAGS -fsanitize=fuzzer-no-link"
+    # For the actual fuzzer binaries, we need to link against the libfuzzer
+    # library. Provide the flags for doing this in FUZZ_EXE_LDFLAGS. The meson
+    # rule for the fuzzer adds these to the link_args. They need to be
+    # configurable, to support OSS-Fuzz
     FUZZ_EXE_LDFLAGS="-fsanitize=fuzzer"
   else
     FUZZ_EXE_LDFLAGS="$LIB_FUZZING_ENGINE"
-- 
2.29.2




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

* [PULL 03/29] multiprocess: move feature to meson_options.txt
  2021-02-26  8:04 [PULL 00/29] Misc patches for 2021-02-25 Paolo Bonzini
  2021-02-26  8:04 ` [PULL 01/29] hvf: Sign the code after installation Paolo Bonzini
  2021-02-26  8:04 ` [PULL 02/29] configure: fix --enable-fuzzing linker failures Paolo Bonzini
@ 2021-02-26  8:05 ` Paolo Bonzini
  2021-02-26  8:05 ` [PULL 04/29] scsi: make io_timeout configurable Paolo Bonzini
                   ` (27 subsequent siblings)
  30 siblings, 0 replies; 41+ messages in thread
From: Paolo Bonzini @ 2021-02-26  8:05 UTC (permalink / raw)
  To: qemu-devel

While at it, improve the description of the feature in the summary and
help message.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 configure         | 14 +++++---------
 meson.build       |  9 +++++++--
 meson_options.txt |  2 ++
 3 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/configure b/configure
index 19f2b88589..cc435e2503 100755
--- a/configure
+++ b/configure
@@ -463,7 +463,7 @@ skip_meson=no
 gettext="auto"
 fuse="auto"
 fuse_lseek="auto"
-multiprocess="no"
+multiprocess="auto"
 
 malloc_trim="auto"
 
@@ -798,7 +798,6 @@ Linux)
   linux="yes"
   linux_user="yes"
   vhost_user=${default_feature:-yes}
-  multiprocess=${default_feature:-yes}
 ;;
 esac
 
@@ -1558,9 +1557,9 @@ for opt do
   ;;
   --disable-fuse-lseek) fuse_lseek="disabled"
   ;;
-  --enable-multiprocess) multiprocess="yes"
+  --enable-multiprocess) multiprocess="enabled"
   ;;
-  --disable-multiprocess) multiprocess="no"
+  --disable-multiprocess) multiprocess="disabled"
   ;;
   *)
       echo "ERROR: unknown option $opt"
@@ -1914,7 +1913,7 @@ disabled with --disable-FEATURE, default is enabled if available
   libdaxctl       libdaxctl support
   fuse            FUSE block device export
   fuse-lseek      SEEK_HOLE/SEEK_DATA support for FUSE exports
-  multiprocess    Multiprocess QEMU support
+  multiprocess    Out of process device emulation support
 
 NOTE: The object files are built at the place where configure is launched
 EOF
@@ -6089,9 +6088,6 @@ fi
 if test "$have_mlockall" = "yes" ; then
   echo "HAVE_MLOCKALL=y" >> $config_host_mak
 fi
-if test "$multiprocess" = "yes" ; then
-  echo "CONFIG_MULTIPROCESS_ALLOWED=y" >> $config_host_mak
-fi
 if test "$fuzzing" = "yes" ; then
   # If LIB_FUZZING_ENGINE is set, assume we are running on OSS-Fuzz, and the
   # needed CFLAGS have already been provided
@@ -6434,7 +6430,7 @@ NINJA=$ninja $meson setup \
         -Dzstd=$zstd -Dseccomp=$seccomp -Dvirtfs=$virtfs -Dcap_ng=$cap_ng \
         -Dattr=$attr -Ddefault_devices=$default_devices \
         -Ddocs=$docs -Dsphinx_build=$sphinx_build -Dinstall_blobs=$blobs \
-        -Dvhost_user_blk_server=$vhost_user_blk_server \
+        -Dvhost_user_blk_server=$vhost_user_blk_server -Dmultiprocess=$multiprocess \
         -Dfuse=$fuse -Dfuse_lseek=$fuse_lseek -Dguest_agent_msi=$guest_agent_msi \
         $(if test "$default_features" = no; then echo "-Dauto_features=disabled"; fi) \
 	-Dtcg_interpreter=$tcg_interpreter \
diff --git a/meson.build b/meson.build
index c79cb20993..d38620d3be 100644
--- a/meson.build
+++ b/meson.build
@@ -157,6 +157,11 @@ if targetos != 'linux' and get_option('mpath').enabled()
   error('Multipath is supported only on Linux')
 endif
 
+if targetos != 'linux' and get_option('multiprocess').enabled()
+  error('Multiprocess QEMU is supported only on Linux')
+endif
+multiprocess_allowed = targetos == 'linux' and not get_option('multiprocess').disabled()
+
 m = cc.find_library('m', required: false)
 util = cc.find_library('util', required: false)
 winmm = []
@@ -1228,7 +1233,7 @@ host_kconfig = \
   (have_virtfs ? ['CONFIG_VIRTFS=y'] : []) + \
   ('CONFIG_LINUX' in config_host ? ['CONFIG_LINUX=y'] : []) + \
   ('CONFIG_PVRDMA' in config_host ? ['CONFIG_PVRDMA=y'] : []) + \
-  ('CONFIG_MULTIPROCESS_ALLOWED' in config_host ? ['CONFIG_MULTIPROCESS_ALLOWED=y'] : [])
+  (multiprocess_allowed ? ['CONFIG_MULTIPROCESS_ALLOWED=y'] : [])
 
 ignored = [ 'TARGET_XML_FILES', 'TARGET_ABI_DIR', 'TARGET_ARCH' ]
 
@@ -2538,6 +2543,7 @@ endif
 summary_info += {'target list':       ' '.join(target_dirs)}
 if have_system
   summary_info += {'default devices':   get_option('default_devices')}
+  summary_info += {'out of process emulation': multiprocess_allowed}
 endif
 summary(summary_info, bool_yn: true, section: 'Targets and accelerators')
 
@@ -2658,7 +2664,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 += {'FUSE lseek':        fuse_lseek.found()}
-summary_info += {'Multiprocess QEMU': config_host.has_key('CONFIG_MULTIPROCESS_ALLOWED')}
 summary(summary_info, bool_yn: true, section: 'Dependencies')
 
 if not supported_cpus.contains(cpu)
diff --git a/meson_options.txt b/meson_options.txt
index 675a9c500a..9734019995 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -45,6 +45,8 @@ option('cfi', type: 'boolean', value: 'false',
        description: 'Control-Flow Integrity (CFI)')
 option('cfi_debug', type: 'boolean', value: 'false',
        description: 'Verbose errors in case of CFI violation')
+option('multiprocess', type: 'feature', value: 'auto',
+       description: 'Out of process device emulation support')
 
 option('attr', type : 'feature', value : 'auto',
        description: 'attr/xattr support')
-- 
2.29.2




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

* [PULL 04/29] scsi: make io_timeout configurable
  2021-02-26  8:04 [PULL 00/29] Misc patches for 2021-02-25 Paolo Bonzini
                   ` (2 preceding siblings ...)
  2021-02-26  8:05 ` [PULL 03/29] multiprocess: move feature to meson_options.txt Paolo Bonzini
@ 2021-02-26  8:05 ` Paolo Bonzini
  2021-02-26  8:05 ` [PULL 05/29] scsi: add tracing for SG_IO commands Paolo Bonzini
                   ` (26 subsequent siblings)
  30 siblings, 0 replies; 41+ messages in thread
From: Paolo Bonzini @ 2021-02-26  8:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: Hannes Reinecke

From: Hannes Reinecke <hare@suse.de>

The current code sets an infinite timeout on SG_IO requests,
causing the guest to stall if the host experiences a frame
loss.
This patch adds an 'io_timeout' parameter for SCSIDevice to
make the SG_IO timeout configurable, and also shortens the
default timeout to 30 seconds to avoid infinite stalls.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Message-Id: <20201116183114.55703-3-hare@suse.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/scsi/scsi-disk.c    |  6 ++++--
 hw/scsi/scsi-generic.c | 17 +++++++++++------
 include/hw/scsi/scsi.h |  4 +++-
 3 files changed, 18 insertions(+), 9 deletions(-)

diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c
index ed52fcd49f..c4016d1cfc 100644
--- a/hw/scsi/scsi-disk.c
+++ b/hw/scsi/scsi-disk.c
@@ -2624,7 +2624,7 @@ static int get_device_type(SCSIDiskState *s)
     cmd[4] = sizeof(buf);
 
     ret = scsi_SG_IO_FROM_DEV(s->qdev.conf.blk, cmd, sizeof(cmd),
-                              buf, sizeof(buf));
+                              buf, sizeof(buf), s->qdev.io_timeout);
     if (ret < 0) {
         return -1;
     }
@@ -2785,7 +2785,7 @@ static BlockAIOCB *scsi_block_do_sgio(SCSIBlockReq *req,
     /* The rest is as in scsi-generic.c.  */
     io_header->mx_sb_len = sizeof(r->req.sense);
     io_header->sbp = r->req.sense;
-    io_header->timeout = UINT_MAX;
+    io_header->timeout = s->qdev.io_timeout * 1000;
     io_header->usr_ptr = r;
     io_header->flags |= SG_FLAG_DIRECT_IO;
 
@@ -3103,6 +3103,8 @@ static Property scsi_block_properties[] = {
                        DEFAULT_MAX_IO_SIZE),
     DEFINE_PROP_INT32("scsi_version", SCSIDiskState, qdev.default_scsi_version,
                       -1),
+    DEFINE_PROP_UINT32("io_timeout", SCSIDiskState, qdev.io_timeout,
+                       DEFAULT_IO_TIMEOUT),
     DEFINE_PROP_END_OF_LIST(),
 };
 
diff --git a/hw/scsi/scsi-generic.c b/hw/scsi/scsi-generic.c
index ab220141f5..3dd3ccd097 100644
--- a/hw/scsi/scsi-generic.c
+++ b/hw/scsi/scsi-generic.c
@@ -115,6 +115,8 @@ static int execute_command(BlockBackend *blk,
                            SCSIGenericReq *r, int direction,
                            BlockCompletionFunc *complete)
 {
+    SCSIDevice *s = r->req.dev;
+
     r->io_header.interface_id = 'S';
     r->io_header.dxfer_direction = direction;
     r->io_header.dxferp = r->buf;
@@ -123,7 +125,7 @@ static int execute_command(BlockBackend *blk,
     r->io_header.cmd_len = r->req.cmd.len;
     r->io_header.mx_sb_len = sizeof(r->req.sense);
     r->io_header.sbp = r->req.sense;
-    r->io_header.timeout = MAX_UINT;
+    r->io_header.timeout = s->io_timeout * 1000;
     r->io_header.usr_ptr = r;
     r->io_header.flags |= SG_FLAG_DIRECT_IO;
 
@@ -506,7 +508,7 @@ static int read_naa_id(const uint8_t *p, uint64_t *p_wwn)
 }
 
 int scsi_SG_IO_FROM_DEV(BlockBackend *blk, uint8_t *cmd, uint8_t cmd_size,
-                        uint8_t *buf, uint8_t buf_size)
+                        uint8_t *buf, uint8_t buf_size, uint32_t timeout)
 {
     sg_io_hdr_t io_header;
     uint8_t sensebuf[8];
@@ -521,7 +523,7 @@ int scsi_SG_IO_FROM_DEV(BlockBackend *blk, uint8_t *cmd, uint8_t cmd_size,
     io_header.cmd_len = cmd_size;
     io_header.mx_sb_len = sizeof(sensebuf);
     io_header.sbp = sensebuf;
-    io_header.timeout = 6000; /* XXX */
+    io_header.timeout = timeout * 1000;
 
     ret = blk_ioctl(blk, SG_IO, &io_header);
     if (ret < 0 || io_header.driver_status || io_header.host_status) {
@@ -551,7 +553,7 @@ static void scsi_generic_set_vpd_bl_emulation(SCSIDevice *s)
     cmd[4] = sizeof(buf);
 
     ret = scsi_SG_IO_FROM_DEV(s->conf.blk, cmd, sizeof(cmd),
-                              buf, sizeof(buf));
+                              buf, sizeof(buf), s->io_timeout);
     if (ret < 0) {
         /*
          * Do not assume anything if we can't retrieve the
@@ -587,7 +589,7 @@ static void scsi_generic_read_device_identification(SCSIDevice *s)
     cmd[4] = sizeof(buf);
 
     ret = scsi_SG_IO_FROM_DEV(s->conf.blk, cmd, sizeof(cmd),
-                              buf, sizeof(buf));
+                              buf, sizeof(buf), s->io_timeout);
     if (ret < 0) {
         return;
     }
@@ -638,7 +640,7 @@ static int get_stream_blocksize(BlockBackend *blk)
     cmd[0] = MODE_SENSE;
     cmd[4] = sizeof(buf);
 
-    ret = scsi_SG_IO_FROM_DEV(blk, cmd, sizeof(cmd), buf, sizeof(buf));
+    ret = scsi_SG_IO_FROM_DEV(blk, cmd, sizeof(cmd), buf, sizeof(buf), 6);
     if (ret < 0) {
         return -1;
     }
@@ -728,6 +730,7 @@ static void scsi_generic_realize(SCSIDevice *s, Error **errp)
 
     /* Only used by scsi-block, but initialize it nevertheless to be clean.  */
     s->default_scsi_version = -1;
+    s->io_timeout = DEFAULT_IO_TIMEOUT;
     scsi_generic_read_device_inquiry(s);
 }
 
@@ -751,6 +754,8 @@ static SCSIRequest *scsi_new_request(SCSIDevice *d, uint32_t tag, uint32_t lun,
 static Property scsi_generic_properties[] = {
     DEFINE_PROP_DRIVE("drive", SCSIDevice, conf.blk),
     DEFINE_PROP_BOOL("share-rw", SCSIDevice, conf.share_rw, false),
+    DEFINE_PROP_UINT32("io_timeout", SCSIDevice, io_timeout,
+                       DEFAULT_IO_TIMEOUT),
     DEFINE_PROP_END_OF_LIST(),
 };
 
diff --git a/include/hw/scsi/scsi.h b/include/hw/scsi/scsi.h
index 09fa5c9d2a..a8ef59c0f4 100644
--- a/include/hw/scsi/scsi.h
+++ b/include/hw/scsi/scsi.h
@@ -18,6 +18,7 @@ typedef struct SCSIReqOps SCSIReqOps;
 
 #define SCSI_SENSE_BUF_SIZE_OLD 96
 #define SCSI_SENSE_BUF_SIZE 252
+#define DEFAULT_IO_TIMEOUT 30
 
 struct SCSIRequest {
     SCSIBus           *bus;
@@ -84,6 +85,7 @@ struct SCSIDevice
     uint64_t port_wwn;
     int scsi_version;
     int default_scsi_version;
+    uint32_t io_timeout;
     bool needs_vpd_bl_emulation;
     bool hba_supports_iothread;
 };
@@ -188,7 +190,7 @@ void scsi_device_unit_attention_reported(SCSIDevice *dev);
 void scsi_generic_read_device_inquiry(SCSIDevice *dev);
 int scsi_device_get_sense(SCSIDevice *dev, uint8_t *buf, int len, bool fixed);
 int scsi_SG_IO_FROM_DEV(BlockBackend *blk, uint8_t *cmd, uint8_t cmd_size,
-                        uint8_t *buf, uint8_t buf_size);
+                        uint8_t *buf, uint8_t buf_size, uint32_t timeout);
 SCSIDevice *scsi_device_find(SCSIBus *bus, int channel, int target, int lun);
 SCSIDevice *scsi_device_get(SCSIBus *bus, int channel, int target, int lun);
 
-- 
2.29.2




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

* [PULL 05/29] scsi: add tracing for SG_IO commands
  2021-02-26  8:04 [PULL 00/29] Misc patches for 2021-02-25 Paolo Bonzini
                   ` (3 preceding siblings ...)
  2021-02-26  8:05 ` [PULL 04/29] scsi: make io_timeout configurable Paolo Bonzini
@ 2021-02-26  8:05 ` Paolo Bonzini
  2021-02-26  8:05 ` [PULL 06/29] scsi: allow user to set werror as report Paolo Bonzini
                   ` (25 subsequent siblings)
  30 siblings, 0 replies; 41+ messages in thread
From: Paolo Bonzini @ 2021-02-26  8:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: Hannes Reinecke

From: Hannes Reinecke <hare@suse.de>

Add tracepoints for SG_IO commands to allow for debugging
of SG_IO commands.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Message-Id: <20201116183114.55703-4-hare@suse.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/scsi/scsi-disk.c    | 3 ++-
 hw/scsi/scsi-generic.c | 8 +++++++-
 hw/scsi/trace-events   | 4 ++++
 3 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c
index c4016d1cfc..a2716b26b4 100644
--- a/hw/scsi/scsi-disk.c
+++ b/hw/scsi/scsi-disk.c
@@ -2788,7 +2788,8 @@ static BlockAIOCB *scsi_block_do_sgio(SCSIBlockReq *req,
     io_header->timeout = s->qdev.io_timeout * 1000;
     io_header->usr_ptr = r;
     io_header->flags |= SG_FLAG_DIRECT_IO;
-
+    trace_scsi_disk_aio_sgio_command(r->req.tag, req->cdb[0], lba,
+                                     nb_logical_blocks, io_header->timeout);
     aiocb = blk_aio_ioctl(s->qdev.conf.blk, SG_IO, io_header, cb, opaque);
     assert(aiocb != NULL);
     return aiocb;
diff --git a/hw/scsi/scsi-generic.c b/hw/scsi/scsi-generic.c
index 3dd3ccd097..176a72951c 100644
--- a/hw/scsi/scsi-generic.c
+++ b/hw/scsi/scsi-generic.c
@@ -129,6 +129,8 @@ static int execute_command(BlockBackend *blk,
     r->io_header.usr_ptr = r;
     r->io_header.flags |= SG_FLAG_DIRECT_IO;
 
+    trace_scsi_generic_aio_sgio_command(r->req.tag, r->req.cmd.buf[0],
+                                        r->io_header.timeout);
     r->req.aiocb = blk_aio_ioctl(blk, SG_IO, &r->io_header, complete, r);
     if (r->req.aiocb == NULL) {
         return -EIO;
@@ -525,8 +527,12 @@ int scsi_SG_IO_FROM_DEV(BlockBackend *blk, uint8_t *cmd, uint8_t cmd_size,
     io_header.sbp = sensebuf;
     io_header.timeout = timeout * 1000;
 
+    trace_scsi_generic_ioctl_sgio_command(cmd[0], io_header.timeout);
     ret = blk_ioctl(blk, SG_IO, &io_header);
-    if (ret < 0 || io_header.driver_status || io_header.host_status) {
+    if (ret < 0 || io_header.status ||
+        io_header.driver_status || io_header.host_status) {
+        trace_scsi_generic_ioctl_sgio_done(cmd[0], ret, io_header.status,
+                                           io_header.host_status);
         return -1;
     }
     return 0;
diff --git a/hw/scsi/trace-events b/hw/scsi/trace-events
index 0e0aa9847d..9788661bfd 100644
--- a/hw/scsi/trace-events
+++ b/hw/scsi/trace-events
@@ -331,6 +331,7 @@ scsi_disk_emulate_command_UNKNOWN(int cmd, const char *name) "Unknown SCSI comma
 scsi_disk_dma_command_READ(uint64_t lba, uint32_t len) "Read (sector %" PRId64 ", count %u)"
 scsi_disk_dma_command_WRITE(const char *cmd, uint64_t lba, int len) "Write %s(sector %" PRId64 ", count %u)"
 scsi_disk_new_request(uint32_t lun, uint32_t tag, const char *line) "Command: lun=%d tag=0x%x data=%s"
+scsi_disk_aio_sgio_command(uint32_t tag, uint8_t cmd, uint64_t lba, int len, uint32_t timeout) "disk aio sgio: tag=0x%x cmd=0x%x (sector %" PRId64 ", count %d) timeout=%u"
 
 # scsi-generic.c
 scsi_generic_command_complete_noio(void *req, uint32_t tag, int statuc) "Command complete %p tag=0x%x status=%d"
@@ -342,3 +343,6 @@ scsi_generic_write_data(uint32_t tag) "scsi_write_data tag=0x%x"
 scsi_generic_send_command(const char *line) "Command: data=%s"
 scsi_generic_realize_type(int type) "device type %d"
 scsi_generic_realize_blocksize(int blocksize) "block size %d"
+scsi_generic_aio_sgio_command(uint32_t tag, uint8_t cmd, uint32_t timeout) "generic aio sgio: tag=0x%x cmd=0x%x timeout=%u"
+scsi_generic_ioctl_sgio_command(uint8_t cmd, uint32_t timeout) "generic ioctl sgio: cmd=0x%x timeout=%u"
+scsi_generic_ioctl_sgio_done(uint8_t cmd, int ret, uint8_t status, uint8_t host_status) "generic ioctl sgio: cmd=0x%x ret=%d status=0x%x host_status=0x%x"
-- 
2.29.2




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

* [PULL 06/29] scsi: allow user to set werror as report
  2021-02-26  8:04 [PULL 00/29] Misc patches for 2021-02-25 Paolo Bonzini
                   ` (4 preceding siblings ...)
  2021-02-26  8:05 ` [PULL 05/29] scsi: add tracing for SG_IO commands Paolo Bonzini
@ 2021-02-26  8:05 ` Paolo Bonzini
  2021-02-26  8:05 ` [PULL 07/29] virtio-scsi: don't process IO on fenced dataplane Paolo Bonzini
                   ` (24 subsequent siblings)
  30 siblings, 0 replies; 41+ messages in thread
From: Paolo Bonzini @ 2021-02-26  8:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: Fam Zheng, Zihao Chang

From: Zihao Chang <changzihao1@huawei.com>

'enospc' is the default for -drive, but qemu allows user to set
drive option werror. If werror of scsi-generic is set to 'report'
by user, qemu will not allow vm to start.

This patch allow user to set werror as 'report' for scsi-generic.

Signed-off-by: Zihao Chang <changzihao1@huawei.com>
Reviewed-by: Fam Zheng <fam@euphon.net>
Message-Id: <20201103061240.1364-1-changzihao1@huawei.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/scsi/scsi-generic.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/hw/scsi/scsi-generic.c b/hw/scsi/scsi-generic.c
index 176a72951c..cf7e11cf44 100644
--- a/hw/scsi/scsi-generic.c
+++ b/hw/scsi/scsi-generic.c
@@ -673,7 +673,8 @@ static void scsi_generic_realize(SCSIDevice *s, Error **errp)
         return;
     }
 
-    if (blk_get_on_error(s->conf.blk, 0) != BLOCKDEV_ON_ERROR_ENOSPC) {
+    if (blk_get_on_error(s->conf.blk, 0) != BLOCKDEV_ON_ERROR_ENOSPC &&
+        blk_get_on_error(s->conf.blk, 0) != BLOCKDEV_ON_ERROR_REPORT) {
         error_setg(errp, "Device doesn't support drive option werror");
         return;
     }
-- 
2.29.2




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

* [PULL 07/29] virtio-scsi: don't process IO on fenced dataplane
  2021-02-26  8:04 [PULL 00/29] Misc patches for 2021-02-25 Paolo Bonzini
                   ` (5 preceding siblings ...)
  2021-02-26  8:05 ` [PULL 06/29] scsi: allow user to set werror as report Paolo Bonzini
@ 2021-02-26  8:05 ` Paolo Bonzini
  2021-02-26  8:05 ` [PULL 08/29] scsi-disk: move scsi_handle_rw_error earlier Paolo Bonzini
                   ` (23 subsequent siblings)
  30 siblings, 0 replies; 41+ messages in thread
From: Paolo Bonzini @ 2021-02-26  8:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: Maxim Levitsky

From: Maxim Levitsky <mlevitsk@redhat.com>

If virtio_scsi_dataplane_start fails, there is a small window when it drops the
aio lock (in aio_wait_bh_oneshot) and the dataplane's AIO handler can
still run during that window.

This is done after the dataplane was marked as fenced, thus we use this flag
to avoid it doing any IO.

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
Message-Id: <20201217150040.906961-2-mlevitsk@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/scsi/virtio-scsi-dataplane.c | 24 +++++++++++++++---------
 1 file changed, 15 insertions(+), 9 deletions(-)

diff --git a/hw/scsi/virtio-scsi-dataplane.c b/hw/scsi/virtio-scsi-dataplane.c
index 2c83a0ab1f..4ad8793406 100644
--- a/hw/scsi/virtio-scsi-dataplane.c
+++ b/hw/scsi/virtio-scsi-dataplane.c
@@ -52,12 +52,14 @@ void virtio_scsi_dataplane_setup(VirtIOSCSI *s, Error **errp)
 static bool virtio_scsi_data_plane_handle_cmd(VirtIODevice *vdev,
                                               VirtQueue *vq)
 {
-    bool progress;
+    bool progress = false;
     VirtIOSCSI *s = VIRTIO_SCSI(vdev);
 
     virtio_scsi_acquire(s);
-    assert(s->ctx && s->dataplane_started);
-    progress = virtio_scsi_handle_cmd_vq(s, vq);
+    if (!s->dataplane_fenced) {
+        assert(s->ctx && s->dataplane_started);
+        progress = virtio_scsi_handle_cmd_vq(s, vq);
+    }
     virtio_scsi_release(s);
     return progress;
 }
@@ -65,12 +67,14 @@ static bool virtio_scsi_data_plane_handle_cmd(VirtIODevice *vdev,
 static bool virtio_scsi_data_plane_handle_ctrl(VirtIODevice *vdev,
                                                VirtQueue *vq)
 {
-    bool progress;
+    bool progress = false;
     VirtIOSCSI *s = VIRTIO_SCSI(vdev);
 
     virtio_scsi_acquire(s);
-    assert(s->ctx && s->dataplane_started);
-    progress = virtio_scsi_handle_ctrl_vq(s, vq);
+    if (!s->dataplane_fenced) {
+        assert(s->ctx && s->dataplane_started);
+        progress = virtio_scsi_handle_ctrl_vq(s, vq);
+    }
     virtio_scsi_release(s);
     return progress;
 }
@@ -78,12 +82,14 @@ static bool virtio_scsi_data_plane_handle_ctrl(VirtIODevice *vdev,
 static bool virtio_scsi_data_plane_handle_event(VirtIODevice *vdev,
                                                 VirtQueue *vq)
 {
-    bool progress;
+    bool progress = false;
     VirtIOSCSI *s = VIRTIO_SCSI(vdev);
 
     virtio_scsi_acquire(s);
-    assert(s->ctx && s->dataplane_started);
-    progress = virtio_scsi_handle_event_vq(s, vq);
+    if (!s->dataplane_fenced) {
+        assert(s->ctx && s->dataplane_started);
+        progress = virtio_scsi_handle_event_vq(s, vq);
+    }
     virtio_scsi_release(s);
     return progress;
 }
-- 
2.29.2




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

* [PULL 08/29] scsi-disk: move scsi_handle_rw_error earlier
  2021-02-26  8:04 [PULL 00/29] Misc patches for 2021-02-25 Paolo Bonzini
                   ` (6 preceding siblings ...)
  2021-02-26  8:05 ` [PULL 07/29] virtio-scsi: don't process IO on fenced dataplane Paolo Bonzini
@ 2021-02-26  8:05 ` Paolo Bonzini
  2021-02-26  8:05 ` [PULL 09/29] scsi-disk: do not complete requests early for rerror/werror=ignore Paolo Bonzini
                   ` (22 subsequent siblings)
  30 siblings, 0 replies; 41+ messages in thread
From: Paolo Bonzini @ 2021-02-26  8:05 UTC (permalink / raw)
  To: qemu-devel

Remove the forward declaration.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/scsi/scsi-disk.c | 168 ++++++++++++++++++++++----------------------
 1 file changed, 83 insertions(+), 85 deletions(-)

diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c
index a2716b26b4..18ab777017 100644
--- a/hw/scsi/scsi-disk.c
+++ b/hw/scsi/scsi-disk.c
@@ -111,8 +111,6 @@ struct SCSIDiskState {
     uint16_t rotation_rate;
 };
 
-static bool scsi_handle_rw_error(SCSIDiskReq *r, int error, bool acct_failed);
-
 static void scsi_free_request(SCSIRequest *req)
 {
     SCSIDiskReq *r = DO_UPCAST(SCSIDiskReq, req, req);
@@ -182,6 +180,89 @@ static void scsi_disk_load_request(QEMUFile *f, SCSIRequest *req)
     qemu_iovec_init_external(&r->qiov, &r->iov, 1);
 }
 
+/*
+ * scsi_handle_rw_error has two return values.  False means that the error
+ * must be ignored, true means that the error has been processed and the
+ * caller should not do anything else for this request.  Note that
+ * scsi_handle_rw_error always manages its reference counts, independent
+ * of the return value.
+ */
+static bool scsi_handle_rw_error(SCSIDiskReq *r, int error, bool acct_failed)
+{
+    bool is_read = (r->req.cmd.mode == SCSI_XFER_FROM_DEV);
+    SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, r->req.dev);
+    SCSIDiskClass *sdc = (SCSIDiskClass *) object_get_class(OBJECT(s));
+    BlockErrorAction action = blk_get_error_action(s->qdev.conf.blk,
+                                                   is_read, error);
+
+    if (action == BLOCK_ERROR_ACTION_REPORT) {
+        if (acct_failed) {
+            block_acct_failed(blk_get_stats(s->qdev.conf.blk), &r->acct);
+        }
+        switch (error) {
+        case 0:
+            /* A passthrough command has run and has produced sense data; check
+             * whether the error has to be handled by the guest or should rather
+             * pause the host.
+             */
+            assert(r->status && *r->status);
+            if (scsi_sense_buf_is_guest_recoverable(r->req.sense, sizeof(r->req.sense))) {
+                /* These errors are handled by guest. */
+                sdc->update_sense(&r->req);
+                scsi_req_complete(&r->req, *r->status);
+                return true;
+            }
+            error = scsi_sense_buf_to_errno(r->req.sense, sizeof(r->req.sense));
+            break;
+#ifdef CONFIG_LINUX
+            /* These errno mapping are specific to Linux.  For more information:
+             * - scsi_decide_disposition in drivers/scsi/scsi_error.c
+             * - scsi_result_to_blk_status in drivers/scsi/scsi_lib.c
+             * - blk_errors[] in block/blk-core.c
+             */
+        case EBADE:
+            /* DID_NEXUS_FAILURE -> BLK_STS_NEXUS.  */
+            scsi_req_complete(&r->req, RESERVATION_CONFLICT);
+            break;
+        case ENODATA:
+            /* DID_MEDIUM_ERROR -> BLK_STS_MEDIUM.  */
+            scsi_check_condition(r, SENSE_CODE(READ_ERROR));
+            break;
+        case EREMOTEIO:
+            /* DID_TARGET_FAILURE -> BLK_STS_TARGET.  */
+            scsi_req_complete(&r->req, HARDWARE_ERROR);
+            break;
+#endif
+        case ENOMEDIUM:
+            scsi_check_condition(r, SENSE_CODE(NO_MEDIUM));
+            break;
+        case ENOMEM:
+            scsi_check_condition(r, SENSE_CODE(TARGET_FAILURE));
+            break;
+        case EINVAL:
+            scsi_check_condition(r, SENSE_CODE(INVALID_FIELD));
+            break;
+        case ENOSPC:
+            scsi_check_condition(r, SENSE_CODE(SPACE_ALLOC_FAILED));
+            break;
+        default:
+            scsi_check_condition(r, SENSE_CODE(IO_ERROR));
+            break;
+        }
+    }
+
+    blk_error_action(s->qdev.conf.blk, action, is_read, error);
+    if (action == BLOCK_ERROR_ACTION_IGNORE) {
+        scsi_req_complete(&r->req, 0);
+        return true;
+    }
+
+    if (action == BLOCK_ERROR_ACTION_STOP) {
+        scsi_req_retry(&r->req);
+    }
+    return true;
+}
+
 static bool scsi_disk_req_check_error(SCSIDiskReq *r, int ret, bool acct_failed)
 {
     if (r->req.io_canceled) {
@@ -428,89 +509,6 @@ static void scsi_read_data(SCSIRequest *req)
     }
 }
 
-/*
- * scsi_handle_rw_error has two return values.  False means that the error
- * must be ignored, true means that the error has been processed and the
- * caller should not do anything else for this request.  Note that
- * scsi_handle_rw_error always manages its reference counts, independent
- * of the return value.
- */
-static bool scsi_handle_rw_error(SCSIDiskReq *r, int error, bool acct_failed)
-{
-    bool is_read = (r->req.cmd.mode == SCSI_XFER_FROM_DEV);
-    SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, r->req.dev);
-    SCSIDiskClass *sdc = (SCSIDiskClass *) object_get_class(OBJECT(s));
-    BlockErrorAction action = blk_get_error_action(s->qdev.conf.blk,
-                                                   is_read, error);
-
-    if (action == BLOCK_ERROR_ACTION_REPORT) {
-        if (acct_failed) {
-            block_acct_failed(blk_get_stats(s->qdev.conf.blk), &r->acct);
-        }
-        switch (error) {
-        case 0:
-            /* A passthrough command has run and has produced sense data; check
-             * whether the error has to be handled by the guest or should rather
-             * pause the host.
-             */
-            assert(r->status && *r->status);
-            if (scsi_sense_buf_is_guest_recoverable(r->req.sense, sizeof(r->req.sense))) {
-                /* These errors are handled by guest. */
-                sdc->update_sense(&r->req);
-                scsi_req_complete(&r->req, *r->status);
-                return true;
-            }
-            error = scsi_sense_buf_to_errno(r->req.sense, sizeof(r->req.sense));
-            break;
-#ifdef CONFIG_LINUX
-            /* These errno mapping are specific to Linux.  For more information:
-             * - scsi_decide_disposition in drivers/scsi/scsi_error.c
-             * - scsi_result_to_blk_status in drivers/scsi/scsi_lib.c
-             * - blk_errors[] in block/blk-core.c
-             */
-        case EBADE:
-            /* DID_NEXUS_FAILURE -> BLK_STS_NEXUS.  */
-            scsi_req_complete(&r->req, RESERVATION_CONFLICT);
-            break;
-        case ENODATA:
-            /* DID_MEDIUM_ERROR -> BLK_STS_MEDIUM.  */
-            scsi_check_condition(r, SENSE_CODE(READ_ERROR));
-            break;
-        case EREMOTEIO:
-            /* DID_TARGET_FAILURE -> BLK_STS_TARGET.  */
-            scsi_req_complete(&r->req, HARDWARE_ERROR);
-            break;
-#endif
-        case ENOMEDIUM:
-            scsi_check_condition(r, SENSE_CODE(NO_MEDIUM));
-            break;
-        case ENOMEM:
-            scsi_check_condition(r, SENSE_CODE(TARGET_FAILURE));
-            break;
-        case EINVAL:
-            scsi_check_condition(r, SENSE_CODE(INVALID_FIELD));
-            break;
-        case ENOSPC:
-            scsi_check_condition(r, SENSE_CODE(SPACE_ALLOC_FAILED));
-            break;
-        default:
-            scsi_check_condition(r, SENSE_CODE(IO_ERROR));
-            break;
-        }
-    }
-
-    blk_error_action(s->qdev.conf.blk, action, is_read, error);
-    if (action == BLOCK_ERROR_ACTION_IGNORE) {
-        scsi_req_complete(&r->req, 0);
-        return true;
-    }
-
-    if (action == BLOCK_ERROR_ACTION_STOP) {
-        scsi_req_retry(&r->req);
-    }
-    return true;
-}
-
 static void scsi_write_complete_noio(SCSIDiskReq *r, int ret)
 {
     uint32_t n;
-- 
2.29.2




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

* [PULL 09/29] scsi-disk: do not complete requests early for rerror/werror=ignore
  2021-02-26  8:04 [PULL 00/29] Misc patches for 2021-02-25 Paolo Bonzini
                   ` (7 preceding siblings ...)
  2021-02-26  8:05 ` [PULL 08/29] scsi-disk: move scsi_handle_rw_error earlier Paolo Bonzini
@ 2021-02-26  8:05 ` Paolo Bonzini
  2021-02-26  8:05 ` [PULL 10/29] scsi: introduce scsi_sense_from_errno() Paolo Bonzini
                   ` (21 subsequent siblings)
  30 siblings, 0 replies; 41+ messages in thread
From: Paolo Bonzini @ 2021-02-26  8:05 UTC (permalink / raw)
  To: qemu-devel

When requested to ignore errors, just do nothing and let the
request complete normally.  This means that the request will
be accounted correctly.

This is what commit 40dce4ee61 ("scsi-disk: fix rerror/werror=ignore",
2018-10-19) was supposed to do:

Fixes: 40dce4ee61 ("scsi-disk: fix rerror/werror=ignore", 2018-10-19)
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/scsi/scsi-disk.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c
index 18ab777017..36aa872445 100644
--- a/hw/scsi/scsi-disk.c
+++ b/hw/scsi/scsi-disk.c
@@ -253,8 +253,7 @@ static bool scsi_handle_rw_error(SCSIDiskReq *r, int error, bool acct_failed)
 
     blk_error_action(s->qdev.conf.blk, action, is_read, error);
     if (action == BLOCK_ERROR_ACTION_IGNORE) {
-        scsi_req_complete(&r->req, 0);
-        return true;
+        return false;
     }
 
     if (action == BLOCK_ERROR_ACTION_STOP) {
-- 
2.29.2




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

* [PULL 10/29] scsi: introduce scsi_sense_from_errno()
  2021-02-26  8:04 [PULL 00/29] Misc patches for 2021-02-25 Paolo Bonzini
                   ` (8 preceding siblings ...)
  2021-02-26  8:05 ` [PULL 09/29] scsi-disk: do not complete requests early for rerror/werror=ignore Paolo Bonzini
@ 2021-02-26  8:05 ` Paolo Bonzini
  2021-02-26  8:05 ` [PULL 11/29] scsi-disk: pass SCSI status to scsi_handle_rw_error Paolo Bonzini
                   ` (20 subsequent siblings)
  30 siblings, 0 replies; 41+ messages in thread
From: Paolo Bonzini @ 2021-02-26  8:05 UTC (permalink / raw)
  To: qemu-devel

The new function is an extension of the switch statement in scsi-disk.c
which also includes the errno cases only found in sg_io_sense_from_errno.
This allows us to consolidate the errno handling.

Extracted from a patch by Hannes Reinecke <hare@suse.de>.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/scsi/scsi-disk.c  | 45 +++++++-------------------------------
 include/scsi/utils.h |  2 ++
 scsi/utils.c         | 51 +++++++++++++++++++++++++++++++++++---------
 3 files changed, 51 insertions(+), 47 deletions(-)

diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c
index 36aa872445..9c6099ffc4 100644
--- a/hw/scsi/scsi-disk.c
+++ b/hw/scsi/scsi-disk.c
@@ -194,13 +194,13 @@ static bool scsi_handle_rw_error(SCSIDiskReq *r, int error, bool acct_failed)
     SCSIDiskClass *sdc = (SCSIDiskClass *) object_get_class(OBJECT(s));
     BlockErrorAction action = blk_get_error_action(s->qdev.conf.blk,
                                                    is_read, error);
+    SCSISense sense;
 
     if (action == BLOCK_ERROR_ACTION_REPORT) {
         if (acct_failed) {
             block_acct_failed(blk_get_stats(s->qdev.conf.blk), &r->acct);
         }
-        switch (error) {
-        case 0:
+        if (error == 0) {
             /* A passthrough command has run and has produced sense data; check
              * whether the error has to be handled by the guest or should rather
              * pause the host.
@@ -213,41 +213,12 @@ static bool scsi_handle_rw_error(SCSIDiskReq *r, int error, bool acct_failed)
                 return true;
             }
             error = scsi_sense_buf_to_errno(r->req.sense, sizeof(r->req.sense));
-            break;
-#ifdef CONFIG_LINUX
-            /* These errno mapping are specific to Linux.  For more information:
-             * - scsi_decide_disposition in drivers/scsi/scsi_error.c
-             * - scsi_result_to_blk_status in drivers/scsi/scsi_lib.c
-             * - blk_errors[] in block/blk-core.c
-             */
-        case EBADE:
-            /* DID_NEXUS_FAILURE -> BLK_STS_NEXUS.  */
-            scsi_req_complete(&r->req, RESERVATION_CONFLICT);
-            break;
-        case ENODATA:
-            /* DID_MEDIUM_ERROR -> BLK_STS_MEDIUM.  */
-            scsi_check_condition(r, SENSE_CODE(READ_ERROR));
-            break;
-        case EREMOTEIO:
-            /* DID_TARGET_FAILURE -> BLK_STS_TARGET.  */
-            scsi_req_complete(&r->req, HARDWARE_ERROR);
-            break;
-#endif
-        case ENOMEDIUM:
-            scsi_check_condition(r, SENSE_CODE(NO_MEDIUM));
-            break;
-        case ENOMEM:
-            scsi_check_condition(r, SENSE_CODE(TARGET_FAILURE));
-            break;
-        case EINVAL:
-            scsi_check_condition(r, SENSE_CODE(INVALID_FIELD));
-            break;
-        case ENOSPC:
-            scsi_check_condition(r, SENSE_CODE(SPACE_ALLOC_FAILED));
-            break;
-        default:
-            scsi_check_condition(r, SENSE_CODE(IO_ERROR));
-            break;
+        } else {
+            int status = scsi_sense_from_errno(error, &sense);
+            if (status == CHECK_CONDITION) {
+                scsi_req_build_sense(&r->req, sense);
+            }
+            scsi_req_complete(&r->req, status);
         }
     }
 
diff --git a/include/scsi/utils.h b/include/scsi/utils.h
index 096489c6cd..ff7c7091b6 100644
--- a/include/scsi/utils.h
+++ b/include/scsi/utils.h
@@ -135,4 +135,6 @@ int sg_io_sense_from_errno(int errno_value, struct sg_io_hdr *io_hdr,
                            SCSISense *sense);
 #endif
 
+int scsi_sense_from_errno(int errno_value, SCSISense *sense);
+
 #endif
diff --git a/scsi/utils.c b/scsi/utils.c
index 793c3a6b9c..6b56e01002 100644
--- a/scsi/utils.c
+++ b/scsi/utils.c
@@ -565,21 +565,52 @@ const char *scsi_command_name(uint8_t cmd)
     return names[cmd];
 }
 
+int scsi_sense_from_errno(int errno_value, SCSISense *sense)
+{
+    switch (errno_value) {
+    case 0:
+        return GOOD;
+    case EDOM:
+        return TASK_SET_FULL;
+#ifdef CONFIG_LINUX
+        /* These errno mapping are specific to Linux.  For more information:
+         * - scsi_decide_disposition in drivers/scsi/scsi_error.c
+         * - scsi_result_to_blk_status in drivers/scsi/scsi_lib.c
+         * - blk_errors[] in block/blk-core.c
+         */
+    case EBADE:
+        return RESERVATION_CONFLICT;
+    case ENODATA:
+        *sense = SENSE_CODE(READ_ERROR);
+        return CHECK_CONDITION;
+    case EREMOTEIO:
+        *sense = SENSE_CODE(LUN_COMM_FAILURE);
+        return CHECK_CONDITION;
+#endif
+    case ENOMEDIUM:
+        *sense = SENSE_CODE(NO_MEDIUM);
+        return CHECK_CONDITION;
+    case ENOMEM:
+        *sense = SENSE_CODE(TARGET_FAILURE);
+        return CHECK_CONDITION;
+    case EINVAL:
+        *sense = SENSE_CODE(INVALID_FIELD);
+        return CHECK_CONDITION;
+    case ENOSPC:
+        *sense = SENSE_CODE(SPACE_ALLOC_FAILED);
+        return CHECK_CONDITION;
+    default:
+        *sense = SENSE_CODE(IO_ERROR);
+        return CHECK_CONDITION;
+    }
+}
+
 #ifdef CONFIG_LINUX
 int sg_io_sense_from_errno(int errno_value, struct sg_io_hdr *io_hdr,
                            SCSISense *sense)
 {
     if (errno_value != 0) {
-        switch (errno_value) {
-        case EDOM:
-            return TASK_SET_FULL;
-        case ENOMEM:
-            *sense = SENSE_CODE(TARGET_FAILURE);
-            return CHECK_CONDITION;
-        default:
-            *sense = SENSE_CODE(IO_ERROR);
-            return CHECK_CONDITION;
-        }
+        return scsi_sense_from_errno(errno_value, sense);
     } else {
         if (io_hdr->host_status == SG_ERR_DID_NO_CONNECT ||
             io_hdr->host_status == SG_ERR_DID_BUS_BUSY ||
-- 
2.29.2




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

* [PULL 11/29] scsi-disk: pass SCSI status to scsi_handle_rw_error
  2021-02-26  8:04 [PULL 00/29] Misc patches for 2021-02-25 Paolo Bonzini
                   ` (9 preceding siblings ...)
  2021-02-26  8:05 ` [PULL 10/29] scsi: introduce scsi_sense_from_errno() Paolo Bonzini
@ 2021-02-26  8:05 ` Paolo Bonzini
  2021-02-26  8:05 ` [PULL 12/29] scsi-disk: pass guest recoverable errors through even for rerror=stop Paolo Bonzini
                   ` (19 subsequent siblings)
  30 siblings, 0 replies; 41+ messages in thread
From: Paolo Bonzini @ 2021-02-26  8:05 UTC (permalink / raw)
  To: qemu-devel

Instead of fishing it from *r->status, just pass the SCSI status
as a positive value of the second parameter and an errno as a
negative value.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/scsi/scsi-disk.c | 38 +++++++++++++++++++++++++++-----------
 1 file changed, 27 insertions(+), 11 deletions(-)

diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c
index 9c6099ffc4..548a5297fa 100644
--- a/hw/scsi/scsi-disk.c
+++ b/hw/scsi/scsi-disk.c
@@ -187,34 +187,48 @@ static void scsi_disk_load_request(QEMUFile *f, SCSIRequest *req)
  * scsi_handle_rw_error always manages its reference counts, independent
  * of the return value.
  */
-static bool scsi_handle_rw_error(SCSIDiskReq *r, int error, bool acct_failed)
+static bool scsi_handle_rw_error(SCSIDiskReq *r, int ret, bool acct_failed)
 {
     bool is_read = (r->req.cmd.mode == SCSI_XFER_FROM_DEV);
     SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, r->req.dev);
     SCSIDiskClass *sdc = (SCSIDiskClass *) object_get_class(OBJECT(s));
-    BlockErrorAction action = blk_get_error_action(s->qdev.conf.blk,
-                                                   is_read, error);
-    SCSISense sense;
+    SCSISense sense = SENSE_CODE(NO_SENSE);
+    int error = 0;
+    bool req_has_sense = false;
+    BlockErrorAction action;
+    int status;
 
+    if (ret < 0) {
+        status = scsi_sense_from_errno(-ret, &sense);
+        error = -ret;
+    } else {
+        /* A passthrough command has completed with nonzero status.  */
+        status = ret;
+        if (status == CHECK_CONDITION) {
+            req_has_sense = true;
+            error = scsi_sense_buf_to_errno(r->req.sense, sizeof(r->req.sense));
+        } else {
+            error = EINVAL;
+        }
+    }
+
+    action = blk_get_error_action(s->qdev.conf.blk, is_read, error);
     if (action == BLOCK_ERROR_ACTION_REPORT) {
         if (acct_failed) {
             block_acct_failed(blk_get_stats(s->qdev.conf.blk), &r->acct);
         }
-        if (error == 0) {
+        if (req_has_sense) {
             /* A passthrough command has run and has produced sense data; check
              * whether the error has to be handled by the guest or should rather
              * pause the host.
              */
-            assert(r->status && *r->status);
             if (scsi_sense_buf_is_guest_recoverable(r->req.sense, sizeof(r->req.sense))) {
                 /* These errors are handled by guest. */
                 sdc->update_sense(&r->req);
-                scsi_req_complete(&r->req, *r->status);
+                scsi_req_complete(&r->req, status);
                 return true;
             }
-            error = scsi_sense_buf_to_errno(r->req.sense, sizeof(r->req.sense));
         } else {
-            int status = scsi_sense_from_errno(error, &sense);
             if (status == CHECK_CONDITION) {
                 scsi_req_build_sense(&r->req, sense);
             }
@@ -240,8 +254,10 @@ static bool scsi_disk_req_check_error(SCSIDiskReq *r, int ret, bool acct_failed)
         return true;
     }
 
-    if (ret < 0 || (r->status && *r->status)) {
-        return scsi_handle_rw_error(r, -ret, acct_failed);
+    if (ret < 0) {
+        return scsi_handle_rw_error(r, ret, acct_failed);
+    } else if (r->status && *r->status) {
+        return scsi_handle_rw_error(r, *r->status, acct_failed);
     }
 
     return false;
-- 
2.29.2




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

* [PULL 12/29] scsi-disk: pass guest recoverable errors through even for rerror=stop
  2021-02-26  8:04 [PULL 00/29] Misc patches for 2021-02-25 Paolo Bonzini
                   ` (10 preceding siblings ...)
  2021-02-26  8:05 ` [PULL 11/29] scsi-disk: pass SCSI status to scsi_handle_rw_error Paolo Bonzini
@ 2021-02-26  8:05 ` Paolo Bonzini
  2021-02-26  8:05 ` [PULL 13/29] scsi: drop 'result' argument from command_complete callback Paolo Bonzini
                   ` (18 subsequent siblings)
  30 siblings, 0 replies; 41+ messages in thread
From: Paolo Bonzini @ 2021-02-26  8:05 UTC (permalink / raw)
  To: qemu-devel

Right now, recoverable sense values are only passed directly to the
guest only for rerror=report.  However, when rerror/werror are 'stop'
we still don't want the host to be involved on every UNIT ATTENTION
(especially considered that the QMP event will not have enough information
to act on the report).

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/scsi/scsi-disk.c | 51 +++++++++++++++++++++++++--------------------
 1 file changed, 28 insertions(+), 23 deletions(-)

diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c
index 548a5297fa..a5a58d7db3 100644
--- a/hw/scsi/scsi-disk.c
+++ b/hw/scsi/scsi-disk.c
@@ -212,39 +212,44 @@ static bool scsi_handle_rw_error(SCSIDiskReq *r, int ret, bool acct_failed)
         }
     }
 
-    action = blk_get_error_action(s->qdev.conf.blk, is_read, error);
-    if (action == BLOCK_ERROR_ACTION_REPORT) {
+    /*
+     * Check whether the error has to be handled by the guest or should
+     * rather follow the rerror=/werror= settings.  Guest-handled errors
+     * are usually retried immediately, so do not post them to QMP and
+     * do not account them as failed I/O.
+     */
+    if (req_has_sense &&
+        scsi_sense_buf_is_guest_recoverable(r->req.sense, sizeof(r->req.sense))) {
+        action = BLOCK_ERROR_ACTION_REPORT;
+        acct_failed = false;
+    } else {
+        action = blk_get_error_action(s->qdev.conf.blk, is_read, error);
+        blk_error_action(s->qdev.conf.blk, action, is_read, error);
+    }
+
+    switch (action) {
+    case BLOCK_ERROR_ACTION_REPORT:
         if (acct_failed) {
             block_acct_failed(blk_get_stats(s->qdev.conf.blk), &r->acct);
         }
         if (req_has_sense) {
-            /* A passthrough command has run and has produced sense data; check
-             * whether the error has to be handled by the guest or should rather
-             * pause the host.
-             */
-            if (scsi_sense_buf_is_guest_recoverable(r->req.sense, sizeof(r->req.sense))) {
-                /* These errors are handled by guest. */
-                sdc->update_sense(&r->req);
-                scsi_req_complete(&r->req, status);
-                return true;
-            }
-        } else {
-            if (status == CHECK_CONDITION) {
-                scsi_req_build_sense(&r->req, sense);
-            }
-            scsi_req_complete(&r->req, status);
+            sdc->update_sense(&r->req);
+        } else if (status == CHECK_CONDITION) {
+            scsi_req_build_sense(&r->req, sense);
         }
-    }
+        scsi_req_complete(&r->req, status);
+        return true;
 
-    blk_error_action(s->qdev.conf.blk, action, is_read, error);
-    if (action == BLOCK_ERROR_ACTION_IGNORE) {
+    case BLOCK_ERROR_ACTION_IGNORE:
         return false;
-    }
 
-    if (action == BLOCK_ERROR_ACTION_STOP) {
+    case BLOCK_ERROR_ACTION_STOP:
         scsi_req_retry(&r->req);
+        return true;
+
+    default:
+        g_assert_not_reached();
     }
-    return true;
 }
 
 static bool scsi_disk_req_check_error(SCSIDiskReq *r, int ret, bool acct_failed)
-- 
2.29.2




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

* [PULL 13/29] scsi: drop 'result' argument from command_complete callback
  2021-02-26  8:04 [PULL 00/29] Misc patches for 2021-02-25 Paolo Bonzini
                   ` (11 preceding siblings ...)
  2021-02-26  8:05 ` [PULL 12/29] scsi-disk: pass guest recoverable errors through even for rerror=stop Paolo Bonzini
@ 2021-02-26  8:05 ` Paolo Bonzini
  2021-02-26  8:05 ` [PULL 14/29] char: don't fail when client is not connected Paolo Bonzini
                   ` (17 subsequent siblings)
  30 siblings, 0 replies; 41+ messages in thread
From: Paolo Bonzini @ 2021-02-26  8:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: Hannes Reinecke

From: Hannes Reinecke <hare@suse.de>

The command complete callback has a SCSIRequest as the first argument,
and the status field of that structure is identical to the 'status'
argument. So drop the argument from the callback.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Message-Id: <20201116184041.60465-3-hare@suse.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/scsi/esp-pci.c      |  5 ++---
 hw/scsi/esp.c          |  7 +++----
 hw/scsi/lsi53c895a.c   |  6 +++---
 hw/scsi/megasas.c      |  6 ++----
 hw/scsi/mptsas.c       |  5 +++--
 hw/scsi/scsi-bus.c     |  2 +-
 hw/scsi/spapr_vscsi.c  | 12 ++++++------
 hw/scsi/virtio-scsi.c  |  5 ++---
 hw/scsi/vmw_pvscsi.c   |  4 ++--
 hw/usb/dev-storage.c   |  6 +++---
 hw/usb/dev-uas.c       |  7 +++----
 include/hw/scsi/esp.h  |  2 +-
 include/hw/scsi/scsi.h |  2 +-
 13 files changed, 32 insertions(+), 37 deletions(-)

diff --git a/hw/scsi/esp-pci.c b/hw/scsi/esp-pci.c
index 2ce96dc56e..4d7c2cab56 100644
--- a/hw/scsi/esp-pci.c
+++ b/hw/scsi/esp-pci.c
@@ -329,13 +329,12 @@ static const VMStateDescription vmstate_esp_pci_scsi = {
     }
 };
 
-static void esp_pci_command_complete(SCSIRequest *req, uint32_t status,
-                                     size_t resid)
+static void esp_pci_command_complete(SCSIRequest *req, size_t resid)
 {
     ESPState *s = req->hba_private;
     PCIESPState *pci = container_of(s, PCIESPState, esp);
 
-    esp_command_complete(req, status, resid);
+    esp_command_complete(req, resid);
     pci->dma_regs[DMA_WBC] = 0;
     pci->dma_regs[DMA_STAT] |= DMA_STAT_DONE;
 }
diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c
index b84e0fe33e..93d9c9c7b9 100644
--- a/hw/scsi/esp.c
+++ b/hw/scsi/esp.c
@@ -485,8 +485,7 @@ static void esp_report_command_complete(ESPState *s, uint32_t status)
     }
 }
 
-void esp_command_complete(SCSIRequest *req, uint32_t status,
-                          size_t resid)
+void esp_command_complete(SCSIRequest *req, size_t resid)
 {
     ESPState *s = req->hba_private;
 
@@ -495,11 +494,11 @@ void esp_command_complete(SCSIRequest *req, uint32_t status,
          * interrupt has been handled.
          */
         trace_esp_command_complete_deferred();
-        s->deferred_status = status;
+        s->deferred_status = req->status;
         s->deferred_complete = true;
         return;
     }
-    esp_report_command_complete(s, status);
+    esp_report_command_complete(s, req->status);
 }
 
 void esp_transfer_data(SCSIRequest *req, uint32_t len)
diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c
index 7d13c7dc1c..a4e58580e4 100644
--- a/hw/scsi/lsi53c895a.c
+++ b/hw/scsi/lsi53c895a.c
@@ -787,14 +787,14 @@ static int lsi_queue_req(LSIState *s, SCSIRequest *req, uint32_t len)
 }
 
  /* Callback to indicate that the SCSI layer has completed a command.  */
-static void lsi_command_complete(SCSIRequest *req, uint32_t status, size_t resid)
+static void lsi_command_complete(SCSIRequest *req, size_t resid)
 {
     LSIState *s = LSI53C895A(req->bus->qbus.parent);
     int out;
 
     out = (s->sstat1 & PHASE_MASK) == PHASE_DO;
-    trace_lsi_command_complete(status);
-    s->status = status;
+    trace_lsi_command_complete(req->status);
+    s->status = req->status;
     s->command_complete = 2;
     if (s->waiting && s->dbc != 0) {
         /* Raise phase mismatch for short transfers.  */
diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c
index 5bfc92fca1..8f2389d2c6 100644
--- a/hw/scsi/megasas.c
+++ b/hw/scsi/megasas.c
@@ -1852,13 +1852,12 @@ static void megasas_xfer_complete(SCSIRequest *req, uint32_t len)
     }
 }
 
-static void megasas_command_complete(SCSIRequest *req, uint32_t status,
-                                     size_t resid)
+static void megasas_command_complete(SCSIRequest *req, size_t resid)
 {
     MegasasCmd *cmd = req->hba_private;
     uint8_t cmd_status = MFI_STAT_OK;
 
-    trace_megasas_command_complete(cmd->index, status, resid);
+    trace_megasas_command_complete(cmd->index, req->status, resid);
 
     if (req->io_canceled) {
         return;
@@ -1873,7 +1872,6 @@ static void megasas_command_complete(SCSIRequest *req, uint32_t status,
             return;
         }
     } else {
-        req->status = status;
         trace_megasas_scsi_complete(cmd->index, req->status,
                                     cmd->iov_size, req->cmd.xfer);
         if (req->status != GOOD) {
diff --git a/hw/scsi/mptsas.c b/hw/scsi/mptsas.c
index f86616544b..7416e78706 100644
--- a/hw/scsi/mptsas.c
+++ b/hw/scsi/mptsas.c
@@ -1133,7 +1133,7 @@ static QEMUSGList *mptsas_get_sg_list(SCSIRequest *sreq)
 }
 
 static void mptsas_command_complete(SCSIRequest *sreq,
-        uint32_t status, size_t resid)
+        size_t resid)
 {
     MPTSASRequest *req = sreq->hba_private;
     MPTSASState *s = req->dev;
@@ -1143,7 +1143,8 @@ static void mptsas_command_complete(SCSIRequest *sreq,
     hwaddr sense_buffer_addr = req->dev->sense_buffer_high_addr |
             req->scsi_io.SenseBufferLowAddr;
 
-    trace_mptsas_command_complete(s, req->scsi_io.MsgContext, status, resid);
+    trace_mptsas_command_complete(s, req->scsi_io.MsgContext,
+                                  sreq->status, resid);
 
     sense_len = scsi_req_get_sense(sreq, sense_buf, SCSI_SENSE_BUF_SIZE);
     if (sense_len > 0) {
diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c
index c349fb7f2d..dc4141ec8d 100644
--- a/hw/scsi/scsi-bus.c
+++ b/hw/scsi/scsi-bus.c
@@ -1483,7 +1483,7 @@ void scsi_req_complete(SCSIRequest *req, int status)
 
     scsi_req_ref(req);
     scsi_req_dequeue(req);
-    req->bus->info->complete(req, req->status, req->resid);
+    req->bus->info->complete(req, req->resid);
 
     /* Cancelled requests might end up being completed instead of cancelled */
     notifier_list_notify(&req->cancel_notifiers, req);
diff --git a/hw/scsi/spapr_vscsi.c b/hw/scsi/spapr_vscsi.c
index 4aa0224c47..ca5c13c4a8 100644
--- a/hw/scsi/spapr_vscsi.c
+++ b/hw/scsi/spapr_vscsi.c
@@ -551,19 +551,19 @@ static void vscsi_transfer_data(SCSIRequest *sreq, uint32_t len)
 }
 
 /* Callback to indicate that the SCSI layer has completed a transfer.  */
-static void vscsi_command_complete(SCSIRequest *sreq, uint32_t status, size_t resid)
+static void vscsi_command_complete(SCSIRequest *sreq, size_t resid)
 {
     VSCSIState *s = VIO_SPAPR_VSCSI_DEVICE(sreq->bus->qbus.parent);
     vscsi_req *req = sreq->hba_private;
     int32_t res_in = 0, res_out = 0;
 
-    trace_spapr_vscsi_command_complete(sreq->tag, status, req);
+    trace_spapr_vscsi_command_complete(sreq->tag, sreq->status, req);
     if (req == NULL) {
         fprintf(stderr, "VSCSI: Can't find request for tag 0x%x\n", sreq->tag);
         return;
     }
 
-    if (status == CHECK_CONDITION) {
+    if (sreq->status == CHECK_CONDITION) {
         req->senselen = scsi_req_get_sense(req->sreq, req->sense,
                                            sizeof(req->sense));
         trace_spapr_vscsi_command_complete_sense_data1(req->senselen,
@@ -574,8 +574,8 @@ static void vscsi_command_complete(SCSIRequest *sreq, uint32_t status, size_t re
                 req->sense[12], req->sense[13], req->sense[14], req->sense[15]);
     }
 
-    trace_spapr_vscsi_command_complete_status(status);
-    if (status == 0) {
+    trace_spapr_vscsi_command_complete_status(sreq->status);
+    if (sreq->status == 0) {
         /* We handle overflows, not underflows for normal commands,
          * but hopefully nobody cares
          */
@@ -585,7 +585,7 @@ static void vscsi_command_complete(SCSIRequest *sreq, uint32_t status, size_t re
             res_in = req->data_len;
         }
     }
-    vscsi_send_rsp(s, req, status, res_in, res_out);
+    vscsi_send_rsp(s, req, sreq->status, res_in, res_out);
     vscsi_put_req(req);
 }
 
diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c
index 99ff261cea..358c0e70b0 100644
--- a/hw/scsi/virtio-scsi.c
+++ b/hw/scsi/virtio-scsi.c
@@ -500,8 +500,7 @@ static void virtio_scsi_complete_cmd_req(VirtIOSCSIReq *req)
     virtio_scsi_complete_req(req);
 }
 
-static void virtio_scsi_command_complete(SCSIRequest *r, uint32_t status,
-                                         size_t resid)
+static void virtio_scsi_command_complete(SCSIRequest *r, size_t resid)
 {
     VirtIOSCSIReq *req = r->hba_private;
     uint8_t sense[SCSI_SENSE_BUF_SIZE];
@@ -513,7 +512,7 @@ static void virtio_scsi_command_complete(SCSIRequest *r, uint32_t status,
     }
 
     req->resp.cmd.response = VIRTIO_SCSI_S_OK;
-    req->resp.cmd.status = status;
+    req->resp.cmd.status = r->status;
     if (req->resp.cmd.status == GOOD) {
         req->resp.cmd.resid = virtio_tswap32(vdev, resid);
     } else {
diff --git a/hw/scsi/vmw_pvscsi.c b/hw/scsi/vmw_pvscsi.c
index a63d25de48..0da378ed50 100644
--- a/hw/scsi/vmw_pvscsi.c
+++ b/hw/scsi/vmw_pvscsi.c
@@ -511,7 +511,7 @@ pvscsi_write_sense(PVSCSIRequest *r, uint8_t *sense, int len)
 }
 
 static void
-pvscsi_command_complete(SCSIRequest *req, uint32_t status, size_t resid)
+pvscsi_command_complete(SCSIRequest *req, size_t resid)
 {
     PVSCSIRequest *pvscsi_req = req->hba_private;
     PVSCSIState *s;
@@ -528,7 +528,7 @@ pvscsi_command_complete(SCSIRequest *req, uint32_t status, size_t resid)
         pvscsi_req->cmp.hostStatus = BTSTAT_DATARUN;
     }
 
-    pvscsi_req->cmp.scsiStatus = status;
+    pvscsi_req->cmp.scsiStatus = req->status;
     if (pvscsi_req->cmp.scsiStatus == CHECK_CONDITION) {
         uint8_t sense[SCSI_SENSE_BUF_SIZE];
         int sense_len =
diff --git a/hw/usb/dev-storage.c b/hw/usb/dev-storage.c
index c49e8b819e..a5f76fc001 100644
--- a/hw/usb/dev-storage.c
+++ b/hw/usb/dev-storage.c
@@ -277,17 +277,17 @@ static void usb_msd_transfer_data(SCSIRequest *req, uint32_t len)
     }
 }
 
-static void usb_msd_command_complete(SCSIRequest *req, uint32_t status, size_t resid)
+static void usb_msd_command_complete(SCSIRequest *req, size_t resid)
 {
     MSDState *s = DO_UPCAST(MSDState, dev.qdev, req->bus->qbus.parent);
     USBPacket *p = s->packet;
 
-    trace_usb_msd_cmd_complete(status, req->tag);
+    trace_usb_msd_cmd_complete(req->status, req->tag);
 
     s->csw.sig = cpu_to_le32(0x53425355);
     s->csw.tag = cpu_to_le32(req->tag);
     s->csw.residue = cpu_to_le32(s->data_len);
-    s->csw.status = status != 0;
+    s->csw.status = req->status != 0;
 
     if (s->packet) {
         if (s->data_len == 0 && s->mode == USB_MSDM_DATAOUT) {
diff --git a/hw/usb/dev-uas.c b/hw/usb/dev-uas.c
index a51402bc0b..d2bd85d3f6 100644
--- a/hw/usb/dev-uas.c
+++ b/hw/usb/dev-uas.c
@@ -598,17 +598,16 @@ static void usb_uas_scsi_transfer_data(SCSIRequest *r, uint32_t len)
     }
 }
 
-static void usb_uas_scsi_command_complete(SCSIRequest *r,
-                                          uint32_t status, size_t resid)
+static void usb_uas_scsi_command_complete(SCSIRequest *r, size_t resid)
 {
     UASRequest *req = r->hba_private;
 
-    trace_usb_uas_scsi_complete(req->uas->dev.addr, req->tag, status, resid);
+    trace_usb_uas_scsi_complete(req->uas->dev.addr, req->tag, r->status, resid);
     req->complete = true;
     if (req->data) {
         usb_uas_complete_data_packet(req);
     }
-    usb_uas_queue_sense(req, status);
+    usb_uas_queue_sense(req, r->status);
     scsi_req_unref(req->req);
 }
 
diff --git a/include/hw/scsi/esp.h b/include/hw/scsi/esp.h
index 60cc3047a5..d8a6263c13 100644
--- a/include/hw/scsi/esp.h
+++ b/include/hw/scsi/esp.h
@@ -151,7 +151,7 @@ struct SysBusESPState {
 
 void esp_dma_enable(ESPState *s, int irq, int level);
 void esp_request_cancelled(SCSIRequest *req);
-void esp_command_complete(SCSIRequest *req, uint32_t status, size_t resid);
+void esp_command_complete(SCSIRequest *req, size_t resid);
 void esp_transfer_data(SCSIRequest *req, uint32_t len);
 void esp_hard_reset(ESPState *s);
 uint64_t esp_reg_read(ESPState *s, uint32_t saddr);
diff --git a/include/hw/scsi/scsi.h b/include/hw/scsi/scsi.h
index a8ef59c0f4..5d992e6e1d 100644
--- a/include/hw/scsi/scsi.h
+++ b/include/hw/scsi/scsi.h
@@ -123,7 +123,7 @@ struct SCSIBusInfo {
     int (*parse_cdb)(SCSIDevice *dev, SCSICommand *cmd, uint8_t *buf,
                      void *hba_private);
     void (*transfer_data)(SCSIRequest *req, uint32_t arg);
-    void (*complete)(SCSIRequest *req, uint32_t arg, size_t resid);
+    void (*complete)(SCSIRequest *req, size_t resid);
     void (*cancel)(SCSIRequest *req);
     void (*change)(SCSIBus *bus, SCSIDevice *dev, SCSISense sense);
     QEMUSGList *(*get_sg_list)(SCSIRequest *req);
-- 
2.29.2




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

* [PULL 14/29] char: don't fail when client is not connected
  2021-02-26  8:04 [PULL 00/29] Misc patches for 2021-02-25 Paolo Bonzini
                   ` (12 preceding siblings ...)
  2021-02-26  8:05 ` [PULL 13/29] scsi: drop 'result' argument from command_complete callback Paolo Bonzini
@ 2021-02-26  8:05 ` Paolo Bonzini
  2021-02-26  8:05 ` [PULL 15/29] gdbstub: use preferred boolean option syntax Paolo Bonzini
                   ` (16 subsequent siblings)
  30 siblings, 0 replies; 41+ messages in thread
From: Paolo Bonzini @ 2021-02-26  8:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: Marc-André Lureau, Pavel Dovgalyuk

From: Pavel Dovgalyuk <pavel.dovgalyuk@ispras.ru>

This patch checks that ioc is not null before
using it in tcp socket tcp_chr_add_watch function.

The failure occurs in replay mode of the execution,
when monitor and serial port are tcp servers,
and there are no clients connected to them:

-monitor tcp:127.0.0.1:8081,server,nowait
-serial tcp:127.0.0.1:8082,server,nowait

Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgalyuk@ispras.ru>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <161284977034.741841.12565530923825663110.stgit@pasha-ThinkPad-X280>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 chardev/char-socket.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/chardev/char-socket.c b/chardev/char-socket.c
index 9061981f6d..b7863b8aae 100644
--- a/chardev/char-socket.c
+++ b/chardev/char-socket.c
@@ -387,6 +387,9 @@ static ssize_t tcp_chr_recv(Chardev *chr, char *buf, size_t len)
 static GSource *tcp_chr_add_watch(Chardev *chr, GIOCondition cond)
 {
     SocketChardev *s = SOCKET_CHARDEV(chr);
+    if (!s->ioc) {
+        return NULL;
+    }
     return qio_channel_create_watch(s->ioc, cond);
 }
 
-- 
2.29.2




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

* [PULL 15/29] gdbstub: use preferred boolean option syntax
  2021-02-26  8:04 [PULL 00/29] Misc patches for 2021-02-25 Paolo Bonzini
                   ` (13 preceding siblings ...)
  2021-02-26  8:05 ` [PULL 14/29] char: don't fail when client is not connected Paolo Bonzini
@ 2021-02-26  8:05 ` Paolo Bonzini
  2021-02-26  8:05 ` [PULL 16/29] qemu-options: update to show preferred boolean syntax for -chardev Paolo Bonzini
                   ` (15 subsequent siblings)
  30 siblings, 0 replies; 41+ messages in thread
From: Paolo Bonzini @ 2021-02-26  8:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: Daniel P. Berrangé

From: Daniel P. Berrangé <berrange@redhat.com>

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20210216191027.595031-2-berrange@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 gdbstub.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdbstub.c b/gdbstub.c
index 759bb00bcf..3ee40479b6 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -3505,7 +3505,7 @@ int gdbserver_start(const char *device)
         if (strstart(device, "tcp:", NULL)) {
             /* enforce required TCP attributes */
             snprintf(gdbstub_device_name, sizeof(gdbstub_device_name),
-                     "%s,nowait,nodelay,server", device);
+                     "%s,wait=off,delay=off,server=on", device);
             device = gdbstub_device_name;
         }
 #ifndef _WIN32
-- 
2.29.2




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

* [PULL 16/29] qemu-options: update to show preferred boolean syntax for -chardev
  2021-02-26  8:04 [PULL 00/29] Misc patches for 2021-02-25 Paolo Bonzini
                   ` (14 preceding siblings ...)
  2021-02-26  8:05 ` [PULL 15/29] gdbstub: use preferred boolean option syntax Paolo Bonzini
@ 2021-02-26  8:05 ` Paolo Bonzini
  2021-02-26  8:05 ` [PULL 17/29] qemu-options: update to show preferred boolean syntax for -spice Paolo Bonzini
                   ` (14 subsequent siblings)
  30 siblings, 0 replies; 41+ messages in thread
From: Paolo Bonzini @ 2021-02-26  8:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: Daniel P. Berrangé

From: Daniel P. Berrangé <berrange@redhat.com>

The preferred syntax is to use "foo=on|off", rather than a bare
"foo" or "nofoo".

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20210216191027.595031-3-berrange@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 qemu-options.hx | 78 ++++++++++++++++++++++++-------------------------
 1 file changed, 39 insertions(+), 39 deletions(-)

diff --git a/qemu-options.hx b/qemu-options.hx
index 6c34c7050f..972ef412cc 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -3032,13 +3032,13 @@ DEFHEADING(Character device options:)
 DEF("chardev", HAS_ARG, QEMU_OPTION_chardev,
     "-chardev help\n"
     "-chardev null,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
-    "-chardev socket,id=id[,host=host],port=port[,to=to][,ipv4][,ipv6][,nodelay][,reconnect=seconds]\n"
-    "         [,server][,nowait][,telnet][,websocket][,reconnect=seconds][,mux=on|off]\n"
+    "-chardev socket,id=id[,host=host],port=port[,to=to][,ipv4=on|off][,ipv6=on|off][,delay=on|off][,reconnect=seconds]\n"
+    "         [,server=on|off][,wait=on|off][,telnet=on|off][,websocket=on|off][,reconnect=seconds][,mux=on|off]\n"
     "         [,logfile=PATH][,logappend=on|off][,tls-creds=ID][,tls-authz=ID] (tcp)\n"
-    "-chardev socket,id=id,path=path[,server][,nowait][,telnet][,websocket][,reconnect=seconds]\n"
+    "-chardev socket,id=id,path=path[,server=on|off][,wait=on|off][,telnet=on|off][,websocket=on|off][,reconnect=seconds]\n"
     "         [,mux=on|off][,logfile=PATH][,logappend=on|off][,abstract=on|off][,tight=on|off] (unix)\n"
     "-chardev udp,id=id[,host=host],port=port[,localaddr=localaddr]\n"
-    "         [,localport=localport][,ipv4][,ipv6][,mux=on|off]\n"
+    "         [,localport=localport][,ipv4=on|off][,ipv6=on|off][,mux=on|off]\n"
     "         [,logfile=PATH][,logappend=on|off]\n"
     "-chardev msmouse,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
     "-chardev vc,id=id[[,width=width][,height=height]][[,cols=cols][,rows=rows]]\n"
@@ -3148,21 +3148,21 @@ The available backends are:
     A void device. This device will not emit any data, and will drop any
     data it receives. The null backend does not take any options.
 
-``-chardev socket,id=id[,TCP options or unix options][,server][,nowait][,telnet][,websocket][,reconnect=seconds][,tls-creds=id][,tls-authz=id]``
+``-chardev socket,id=id[,TCP options or unix options][,server=on|off][,wait=on|off][,telnet=on|off][,websocket=on|off][,reconnect=seconds][,tls-creds=id][,tls-authz=id]``
     Create a two-way stream socket, which can be either a TCP or a unix
     socket. A unix socket will be created if ``path`` is specified.
     Behaviour is undefined if TCP options are specified for a unix
     socket.
 
-    ``server`` specifies that the socket shall be a listening socket.
+    ``server=on|off`` specifies that the socket shall be a listening socket.
 
-    ``nowait`` specifies that QEMU should not block waiting for a client
+    ``wait=on|off`` specifies that QEMU should not block waiting for a client
     to connect to a listening socket.
 
-    ``telnet`` specifies that traffic on the socket should interpret
+    ``telnet=on|off`` specifies that traffic on the socket should interpret
     telnet escape sequences.
 
-    ``websocket`` specifies that the socket uses WebSocket protocol for
+    ``websocket=on|off`` specifies that the socket uses WebSocket protocol for
     communication.
 
     ``reconnect`` sets the timeout for reconnecting on non-server
@@ -3183,7 +3183,7 @@ The available backends are:
 
     TCP and unix socket options are given below:
 
-    ``TCP options: port=port[,host=host][,to=to][,ipv4][,ipv6][,nodelay]``
+    ``TCP options: port=port[,host=host][,to=to][,ipv4=on|off][,ipv6=on|off][,delay=on|off]``
         ``host`` for a listening socket specifies the local address to
         be bound. For a connecting socket species the remote host to
         connect to. ``host`` is optional for listening sockets. If not
@@ -3199,21 +3199,21 @@ The available backends are:
         bind to subsequent ports up to and including ``to`` until it
         succeeds. ``to`` must be specified as a port number.
 
-        ``ipv4`` and ``ipv6`` specify that either IPv4 or IPv6 must be
-        used. If neither is specified the socket may use either
-        protocol.
+        ``ipv4=on|off`` and ``ipv6=on|off`` specify that either IPv4
+        or IPv6 must be used. If neither is specified the socket may
+        use either protocol.
 
-        ``nodelay`` disables the Nagle algorithm.
+        ``delay=on|off`` disables the Nagle algorithm.
 
     ``unix options: path=path[,abstract=on|off][,tight=on|off]``
         ``path`` specifies the local path of the unix socket. ``path``
         is required.
-        ``abstract`` specifies the use of the abstract socket namespace,
+        ``abstract=on|off`` specifies the use of the abstract socket namespace,
         rather than the filesystem.  Optional, defaults to false.
-        ``tight`` sets the socket length of abstract sockets to their minimum,
+        ``tight=on|off`` sets the socket length of abstract sockets to their minimum,
         rather than the full sun_path length.  Optional, defaults to true.
 
-``-chardev udp,id=id[,host=host],port=port[,localaddr=localaddr][,localport=localport][,ipv4][,ipv6]``
+``-chardev udp,id=id[,host=host],port=port[,localaddr=localaddr][,localport=localport][,ipv4=on|off][,ipv6=on|off]``
     Sends all traffic from the guest to a remote host over UDP.
 
     ``host`` specifies the remote host to connect to. If not specified
@@ -3228,7 +3228,7 @@ The available backends are:
     ``localport`` specifies the local port to bind to. If not specified
     any available local port will be used.
 
-    ``ipv4`` and ``ipv6`` specify that either IPv4 or IPv6 must be used.
+    ``ipv4=on|off`` and ``ipv6=on|off`` specify that either IPv4 or IPv6 must be used.
     If neither is specified the device may use either protocol.
 
 ``-chardev msmouse,id=id``
@@ -3592,30 +3592,30 @@ SRST
         ``telnet options:``
             localhost 5555
 
-    ``tcp:[host]:port[,server][,nowait][,nodelay][,reconnect=seconds]``
+    ``tcp:[host]:port[,server=on|off][,wait=on|off][,delay=on|off][,reconnect=seconds]``
         The TCP Net Console has two modes of operation. It can send the
         serial I/O to a location or wait for a connection from a
         location. By default the TCP Net Console is sent to host at the
-        port. If you use the server option QEMU will wait for a client
+        port. If you use the ``server=on`` option QEMU will wait for a client
         socket application to connect to the port before continuing,
-        unless the ``nowait`` option was specified. The ``nodelay``
-        option disables the Nagle buffering algorithm. The ``reconnect``
-        option only applies if noserver is set, if the connection goes
+        unless the ``wait=on|off`` option was specified. The ``delay=on|off``
+        option disables the Nagle buffering algorithm. The ``reconnect=on``
+        option only applies if ``server=no`` is set, if the connection goes
         down it will attempt to reconnect at the given interval. If host
         is omitted, 0.0.0.0 is assumed. Only one TCP connection at a
-        time is accepted. You can use ``telnet`` to connect to the
+        time is accepted. You can use ``telnet=on`` to connect to the
         corresponding character device.
 
         ``Example to send tcp console to 192.168.0.2 port 4444``
             -serial tcp:192.168.0.2:4444
 
         ``Example to listen and wait on port 4444 for connection``
-            -serial tcp::4444,server
+            -serial tcp::4444,server=on
 
         ``Example to not wait and listen on ip 192.168.0.100 port 4444``
-            -serial tcp:192.168.0.100:4444,server,nowait
+            -serial tcp:192.168.0.100:4444,server=on,wait=off
 
-    ``telnet:host:port[,server][,nowait][,nodelay]``
+    ``telnet:host:port[,server=on|off][,wait=on|off][,delay=on|off]``
         The telnet protocol is used instead of raw tcp sockets. The
         options work the same as if you had specified ``-serial tcp``.
         The difference is that the port acts like a telnet server or
@@ -3625,11 +3625,11 @@ SRST
         you do it with Control-] and then type "send break" followed by
         pressing the enter key.
 
-    ``websocket:host:port,server[,nowait][,nodelay]``
+    ``websocket:host:port,server=on[,wait=on|off][,delay=on|off]``
         The WebSocket protocol is used instead of raw tcp socket. The
         port acts as a WebSocket server. Client mode is not supported.
 
-    ``unix:path[,server][,nowait][,reconnect=seconds]``
+    ``unix:path[,server=on|off][,wait=on|off][,reconnect=seconds]``
         A unix domain socket is used instead of a tcp socket. The option
         works the same as if you had specified ``-serial tcp`` except
         the unix domain socket path is used for connections.
@@ -3642,7 +3642,7 @@ SRST
         multiplex the monitor onto a telnet server listening on port
         4444 would be:
 
-        ``-serial mon:telnet::4444,server,nowait``
+        ``-serial mon:telnet::4444,server=on,wait=off``
 
         When the monitor is multiplexed to stdio in this way, Ctrl+C
         will not terminate QEMU any more but will be passed to the guest
@@ -4815,11 +4815,11 @@ SRST
             primary:
             -netdev tap,id=hn0,vhost=off,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown
             -device e1000,id=e0,netdev=hn0,mac=52:a4:00:12:78:66
-            -chardev socket,id=mirror0,host=3.3.3.3,port=9003,server,nowait
-            -chardev socket,id=compare1,host=3.3.3.3,port=9004,server,nowait
-            -chardev socket,id=compare0,host=3.3.3.3,port=9001,server,nowait
+            -chardev socket,id=mirror0,host=3.3.3.3,port=9003,server=on,wait=off
+            -chardev socket,id=compare1,host=3.3.3.3,port=9004,server=on,wait=off
+            -chardev socket,id=compare0,host=3.3.3.3,port=9001,server=on,wait=off
             -chardev socket,id=compare0-0,host=3.3.3.3,port=9001
-            -chardev socket,id=compare_out,host=3.3.3.3,port=9005,server,nowait
+            -chardev socket,id=compare_out,host=3.3.3.3,port=9005,server=on,wait=off
             -chardev socket,id=compare_out0,host=3.3.3.3,port=9005
             -object iothread,id=iothread1
             -object filter-mirror,id=m0,netdev=hn0,queue=tx,outdev=mirror0
@@ -4841,13 +4841,13 @@ SRST
             primary:
             -netdev tap,id=hn0,vhost=off,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown
             -device e1000,id=e0,netdev=hn0,mac=52:a4:00:12:78:66
-            -chardev socket,id=mirror0,host=3.3.3.3,port=9003,server,nowait
-            -chardev socket,id=compare1,host=3.3.3.3,port=9004,server,nowait
-            -chardev socket,id=compare0,host=3.3.3.3,port=9001,server,nowait
+            -chardev socket,id=mirror0,host=3.3.3.3,port=9003,server=on,wait=off
+            -chardev socket,id=compare1,host=3.3.3.3,port=9004,server=on,wait=off
+            -chardev socket,id=compare0,host=3.3.3.3,port=9001,server=on,wait=off
             -chardev socket,id=compare0-0,host=3.3.3.3,port=9001
-            -chardev socket,id=compare_out,host=3.3.3.3,port=9005,server,nowait
+            -chardev socket,id=compare_out,host=3.3.3.3,port=9005,server=on,wait=off
             -chardev socket,id=compare_out0,host=3.3.3.3,port=9005
-            -chardev socket,id=notify_way,host=3.3.3.3,port=9009,server,nowait
+            -chardev socket,id=notify_way,host=3.3.3.3,port=9009,server=on,wait=off
             -object filter-mirror,id=m0,netdev=hn0,queue=tx,outdev=mirror0
             -object filter-redirector,netdev=hn0,id=redire0,queue=rx,indev=compare_out
             -object filter-redirector,netdev=hn0,id=redire1,queue=rx,outdev=compare0
-- 
2.29.2




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

* [PULL 17/29] qemu-options: update to show preferred boolean syntax for -spice
  2021-02-26  8:04 [PULL 00/29] Misc patches for 2021-02-25 Paolo Bonzini
                   ` (15 preceding siblings ...)
  2021-02-26  8:05 ` [PULL 16/29] qemu-options: update to show preferred boolean syntax for -chardev Paolo Bonzini
@ 2021-02-26  8:05 ` Paolo Bonzini
  2021-02-26  8:05 ` [PULL 18/29] qemu-options: update to show preferred boolean syntax for -netdev Paolo Bonzini
                   ` (13 subsequent siblings)
  30 siblings, 0 replies; 41+ messages in thread
From: Paolo Bonzini @ 2021-02-26  8:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: Daniel P. Berrangé

From: Daniel P. Berrangé <berrange@redhat.com>

The preferred syntax is to use "foo=on|off", rather than a bare
"foo" or "nofoo".

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20210216191027.595031-4-berrange@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 qemu-options.hx | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/qemu-options.hx b/qemu-options.hx
index 972ef412cc..bdf159c929 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -1894,16 +1894,17 @@ DEF("spice", HAS_ARG, QEMU_OPTION_spice,
     "-spice [port=port][,tls-port=secured-port][,x509-dir=<dir>]\n"
     "       [,x509-key-file=<file>][,x509-key-password=<file>]\n"
     "       [,x509-cert-file=<file>][,x509-cacert-file=<file>]\n"
-    "       [,x509-dh-key-file=<file>][,addr=addr][,ipv4|ipv6|unix]\n"
+    "       [,x509-dh-key-file=<file>][,addr=addr]\n"
+    "       [,ipv4=on|off][,ipv6=on|off][,unix=on|off]\n"
     "       [,tls-ciphers=<list>]\n"
     "       [,tls-channel=[main|display|cursor|inputs|record|playback]]\n"
     "       [,plaintext-channel=[main|display|cursor|inputs|record|playback]]\n"
-    "       [,sasl][,password=<secret>][,disable-ticketing]\n"
+    "       [,sasl=on|off][,password=<secret>][,disable-ticketing=on|off]\n"
     "       [,image-compression=[auto_glz|auto_lz|quic|glz|lz|off]]\n"
     "       [,jpeg-wan-compression=[auto|never|always]]\n"
     "       [,zlib-glz-wan-compression=[auto|never|always]]\n"
-    "       [,streaming-video=[off|all|filter]][,disable-copy-paste]\n"
-    "       [,disable-agent-file-xfer][,agent-mouse=[on|off]]\n"
+    "       [,streaming-video=[off|all|filter]][,disable-copy-paste=on|off]\n"
+    "       [,disable-agent-file-xfer=on|off][,agent-mouse=[on|off]]\n"
     "       [,playback-compression=[on|off]][,seamless-migration=[on|off]]\n"
     "       [,gl=[on|off]][,rendernode=<file>]\n"
     "   enable spice\n"
@@ -1920,13 +1921,13 @@ SRST
         Set the IP address spice is listening on. Default is any
         address.
 
-    ``ipv4``; \ ``ipv6``; \ ``unix``
+    ``ipv4=on|off``; \ ``ipv6=on|off``; \ ``unix=on|off``
         Force using the specified IP version.
 
     ``password=<secret>``
         Set the password you need to authenticate.
 
-    ``sasl``
+    ``sasl=on|off``
         Require that the client use SASL to authenticate with the spice.
         The exact choice of authentication method used is controlled
         from the system / user's SASL configuration file for the 'qemu'
@@ -1940,13 +1941,13 @@ SRST
         data encryption preventing compromise of authentication
         credentials.
 
-    ``disable-ticketing``
+    ``disable-ticketing=on|off``
         Allow client connects without authentication.
 
-    ``disable-copy-paste``
+    ``disable-copy-paste=on|off``
         Disable copy paste between the client and the guest.
 
-    ``disable-agent-file-xfer``
+    ``disable-agent-file-xfer=on|off``
         Disable spice-vdagent based file-xfer between the client and the
         guest.
 
-- 
2.29.2




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

* [PULL 18/29] qemu-options: update to show preferred boolean syntax for -netdev
  2021-02-26  8:04 [PULL 00/29] Misc patches for 2021-02-25 Paolo Bonzini
                   ` (16 preceding siblings ...)
  2021-02-26  8:05 ` [PULL 17/29] qemu-options: update to show preferred boolean syntax for -spice Paolo Bonzini
@ 2021-02-26  8:05 ` Paolo Bonzini
  2021-02-26  8:05 ` [PULL 19/29] qemu-options: update to show preferred boolean syntax for -incoming Paolo Bonzini
                   ` (12 subsequent siblings)
  30 siblings, 0 replies; 41+ messages in thread
From: Paolo Bonzini @ 2021-02-26  8:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: Daniel P. Berrangé

From: Daniel P. Berrangé <berrange@redhat.com>

The preferred syntax is to use "foo=on|off", rather than a bare
"foo" or "nofoo".

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20210216191027.595031-5-berrange@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 qemu-options.hx | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/qemu-options.hx b/qemu-options.hx
index bdf159c929..fb2050cda9 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -2406,8 +2406,8 @@ DEFHEADING(Network options:)
 
 DEF("netdev", HAS_ARG, QEMU_OPTION_netdev,
 #ifdef CONFIG_SLIRP
-    "-netdev user,id=str[,ipv4[=on|off]][,net=addr[/mask]][,host=addr]\n"
-    "         [,ipv6[=on|off]][,ipv6-net=addr[/int]][,ipv6-host=addr]\n"
+    "-netdev user,id=str[,ipv4=on|off][,net=addr[/mask]][,host=addr]\n"
+    "         [,ipv6=on|off][,ipv6-net=addr[/int]][,ipv6-host=addr]\n"
     "         [,restrict=on|off][,hostname=host][,dhcpstart=addr]\n"
     "         [,dns=addr][,ipv6-dns=addr][,dnssearch=domain][,domainname=domain]\n"
     "         [,tftp=dir][,tftp-server-name=name][,bootfile=f][,hostfwd=rule][,guestfwd=rule]"
@@ -2454,8 +2454,8 @@ DEF("netdev", HAS_ARG, QEMU_OPTION_netdev,
 #endif
 #ifdef __linux__
     "-netdev l2tpv3,id=str,src=srcaddr,dst=dstaddr[,srcport=srcport][,dstport=dstport]\n"
-    "         [,rxsession=rxsession],txsession=txsession[,ipv6=on/off][,udp=on/off]\n"
-    "         [,cookie64=on/off][,counter][,pincounter][,txcookie=txcookie]\n"
+    "         [,rxsession=rxsession],txsession=txsession[,ipv6=on|off][,udp=on|off]\n"
+    "         [,cookie64=on|off][,counter][,pincounter][,txcookie=txcookie]\n"
     "         [,rxcookie=rxcookie][,offset=offset]\n"
     "                configure a network backend with ID 'str' connected to\n"
     "                an Ethernet over L2TPv3 pseudowire.\n"
@@ -2884,7 +2884,7 @@ SRST
                          -device e1000,netdev=n1,mac=52:54:00:12:34:56 \\
                          -netdev socket,id=n1,mcast=239.192.168.1:1102,localaddr=1.2.3.4
 
-``-netdev l2tpv3,id=id,src=srcaddr,dst=dstaddr[,srcport=srcport][,dstport=dstport],txsession=txsession[,rxsession=rxsession][,ipv6][,udp][,cookie64][,counter][,pincounter][,txcookie=txcookie][,rxcookie=rxcookie][,offset=offset]``
+``-netdev l2tpv3,id=id,src=srcaddr,dst=dstaddr[,srcport=srcport][,dstport=dstport],txsession=txsession[,rxsession=rxsession][,ipv6=on|off][,udp=on|off][,cookie64][,counter][,pincounter][,txcookie=txcookie][,rxcookie=rxcookie][,offset=offset]``
     Configure a L2TPv3 pseudowire host network backend. L2TPv3 (RFC3931)
     is a popular protocol to transport Ethernet (and other Layer 2) data
     frames between two systems. It is present in routers, firewalls and
-- 
2.29.2




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

* [PULL 19/29] qemu-options: update to show preferred boolean syntax for -incoming
  2021-02-26  8:04 [PULL 00/29] Misc patches for 2021-02-25 Paolo Bonzini
                   ` (17 preceding siblings ...)
  2021-02-26  8:05 ` [PULL 18/29] qemu-options: update to show preferred boolean syntax for -netdev Paolo Bonzini
@ 2021-02-26  8:05 ` Paolo Bonzini
  2021-02-26  8:05 ` [PULL 20/29] qemu-options: update to show preferred boolean syntax for -vnc Paolo Bonzini
                   ` (11 subsequent siblings)
  30 siblings, 0 replies; 41+ messages in thread
From: Paolo Bonzini @ 2021-02-26  8:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: Daniel P. Berrangé

From: Daniel P. Berrangé <berrange@redhat.com>

The preferred syntax is to use "foo=on|off", rather than a bare
"foo" or "nofoo".

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20210216191027.595031-6-berrange@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 qemu-options.hx | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/qemu-options.hx b/qemu-options.hx
index fb2050cda9..da0ddf8a3a 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -4135,8 +4135,8 @@ SRST
 ERST
 
 DEF("incoming", HAS_ARG, QEMU_OPTION_incoming, \
-    "-incoming tcp:[host]:port[,to=maxport][,ipv4][,ipv6]\n" \
-    "-incoming rdma:host:port[,ipv4][,ipv6]\n" \
+    "-incoming tcp:[host]:port[,to=maxport][,ipv4=on|off][,ipv6=on|off]\n" \
+    "-incoming rdma:host:port[,ipv4=on|off][,ipv6=on|off]\n" \
     "-incoming unix:socketpath\n" \
     "                prepare for incoming migration, listen on\n" \
     "                specified protocol and socket address\n" \
@@ -4148,9 +4148,9 @@ DEF("incoming", HAS_ARG, QEMU_OPTION_incoming, \
     "                wait for the URI to be specified via migrate_incoming\n",
     QEMU_ARCH_ALL)
 SRST
-``-incoming tcp:[host]:port[,to=maxport][,ipv4][,ipv6]``
+``-incoming tcp:[host]:port[,to=maxport][,ipv4=on|off][,ipv6=on|off]``
   \ 
-``-incoming rdma:host:port[,ipv4][,ipv6]``
+``-incoming rdma:host:port[,ipv4=on|off][,ipv6=on|off]``
     Prepare for incoming migration, listen on a given tcp port.
 
 ``-incoming unix:socketpath``
-- 
2.29.2




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

* [PULL 20/29] qemu-options: update to show preferred boolean syntax for -vnc
  2021-02-26  8:04 [PULL 00/29] Misc patches for 2021-02-25 Paolo Bonzini
                   ` (18 preceding siblings ...)
  2021-02-26  8:05 ` [PULL 19/29] qemu-options: update to show preferred boolean syntax for -incoming Paolo Bonzini
@ 2021-02-26  8:05 ` Paolo Bonzini
  2021-02-26  8:05 ` [PULL 21/29] docs: update to show preferred boolean syntax for -chardev Paolo Bonzini
                   ` (10 subsequent siblings)
  30 siblings, 0 replies; 41+ messages in thread
From: Paolo Bonzini @ 2021-02-26  8:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: Daniel P. Berrangé

From: Daniel P. Berrangé <berrange@redhat.com>

The preferred syntax is to use "foo=on|off", rather than a bare
"foo" or "nofoo".

The on|off syntax has been supported since -vnc switched to use
QemuOpts in commit 4db14629c38611061fc19ec6927405923de84f08

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20210216191027.595031-7-berrange@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 qemu-options.hx | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/qemu-options.hx b/qemu-options.hx
index da0ddf8a3a..34be5a7a2d 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -2123,13 +2123,13 @@ SRST
     Following the display value there may be one or more option flags
     separated by commas. Valid options are
 
-    ``reverse``
+    ``reverse=on|off``
         Connect to a listening VNC client via a "reverse" connection.
         The client is specified by the display. For reverse network
         connections (host:d,``reverse``), the d argument is a TCP port
         number, not a display number.
 
-    ``websocket``
+    ``websocket=on|off``
         Opens an additional TCP listening port dedicated to VNC
         Websocket connections. If a bare websocket option is given, the
         Websocket port is 5700+display. An alternative port can be
@@ -2143,7 +2143,7 @@ SRST
         runs in unencrypted mode. If TLS credentials are provided, the
         websocket connection requires encrypted client connections.
 
-    ``password``
+    ``password=on|off``
         Require that password based authentication is used for client
         connections.
 
@@ -2180,7 +2180,7 @@ SRST
         on the fly while the VNC server is active. If missing, it will
         default to denying access.
 
-    ``sasl``
+    ``sasl=on|off``
         Require that the client use SASL to authenticate with the VNC
         server. The exact choice of authentication method used is
         controlled from the system / user's SASL configuration file for
@@ -2203,7 +2203,7 @@ SRST
         fly while the VNC server is active. If missing, it will default
         to denying access.
 
-    ``acl``
+    ``acl=on|off``
         Legacy method for enabling authorization of clients against the
         x509 distinguished name and SASL username. It results in the
         creation of two ``authz-list`` objects with IDs of
@@ -2213,13 +2213,13 @@ SRST
         This option is deprecated and should no longer be used. The new
         ``sasl-authz`` and ``tls-authz`` options are a replacement.
 
-    ``lossy``
+    ``lossy=on|off``
         Enable lossy compression methods (gradient, JPEG, ...). If this
         option is set, VNC client may receive lossy framebuffer updates
         depending on its encoding settings. Enabling this option can
         save a lot of bandwidth at the expense of quality.
 
-    ``non-adaptive``
+    ``non-adaptive=on|off``
         Disable adaptive encodings. Adaptive encodings are enabled by
         default. An adaptive encoding will try to detect frequently
         updated screen regions, and send updates in these regions using
@@ -2254,7 +2254,7 @@ SRST
         must be omitted, otherwise is must be present and specify a
         valid audiodev.
 
-    ``power-control``
+    ``power-control=on|off``
         Permit the remote client to issue shutdown, reboot or reset power
         control requests.
 ERST
-- 
2.29.2




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

* [PULL 21/29] docs: update to show preferred boolean syntax for -chardev
  2021-02-26  8:04 [PULL 00/29] Misc patches for 2021-02-25 Paolo Bonzini
                   ` (19 preceding siblings ...)
  2021-02-26  8:05 ` [PULL 20/29] qemu-options: update to show preferred boolean syntax for -vnc Paolo Bonzini
@ 2021-02-26  8:05 ` Paolo Bonzini
  2021-02-26  8:05 ` [PULL 22/29] docs: update to show preferred boolean syntax for -vnc Paolo Bonzini
                   ` (9 subsequent siblings)
  30 siblings, 0 replies; 41+ messages in thread
From: Paolo Bonzini @ 2021-02-26  8:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: Daniel P. Berrangé

From: Daniel P. Berrangé <berrange@redhat.com>

The preferred syntax is to use "foo=on|off", rather than a bare
"foo" or "nofoo".

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20210216191027.595031-8-berrange@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 docs/COLO-FT.txt                       |  8 ++++----
 docs/ccid.txt                          |  6 ++++--
 docs/colo-proxy.txt                    | 16 ++++++++--------
 docs/devel/writing-qmp-commands.txt    |  2 +-
 docs/interop/live-block-operations.rst |  4 ++--
 docs/interop/qmp-intro.txt             |  4 ++--
 docs/system/cpu-hotplug.rst            |  2 +-
 docs/system/s390x/3270.rst             |  2 +-
 docs/system/target-avr.rst             |  2 +-
 docs/tools/qemu-storage-daemon.rst     |  4 ++--
 scripts/qmp/qemu-ga-client             |  2 +-
 tests/test-char.c                      |  4 ++--
 12 files changed, 29 insertions(+), 27 deletions(-)

diff --git a/docs/COLO-FT.txt b/docs/COLO-FT.txt
index bc5fb2a1bb..8874690e83 100644
--- a/docs/COLO-FT.txt
+++ b/docs/COLO-FT.txt
@@ -162,11 +162,11 @@ instance.
    -device piix3-usb-uhci -device usb-tablet -name primary \
    -netdev tap,id=hn0,vhost=off,helper=/usr/lib/qemu/qemu-bridge-helper \
    -device rtl8139,id=e0,netdev=hn0 \
-   -chardev socket,id=mirror0,host=0.0.0.0,port=9003,server,nowait \
-   -chardev socket,id=compare1,host=0.0.0.0,port=9004,server,wait \
-   -chardev socket,id=compare0,host=127.0.0.1,port=9001,server,nowait \
+   -chardev socket,id=mirror0,host=0.0.0.0,port=9003,server=on,wait=off \
+   -chardev socket,id=compare1,host=0.0.0.0,port=9004,server=on,wait=on \
+   -chardev socket,id=compare0,host=127.0.0.1,port=9001,server=on,wait=off \
    -chardev socket,id=compare0-0,host=127.0.0.1,port=9001 \
-   -chardev socket,id=compare_out,host=127.0.0.1,port=9005,server,nowait \
+   -chardev socket,id=compare_out,host=127.0.0.1,port=9005,server=on,wait=off \
    -chardev socket,id=compare_out0,host=127.0.0.1,port=9005 \
    -object filter-mirror,id=m0,netdev=hn0,queue=tx,outdev=mirror0 \
    -object filter-redirector,netdev=hn0,id=redire0,queue=rx,indev=compare_out \
diff --git a/docs/ccid.txt b/docs/ccid.txt
index c7fda6d07d..c97fbd2de0 100644
--- a/docs/ccid.txt
+++ b/docs/ccid.txt
@@ -109,7 +109,8 @@ NSS.  Registration can be done from Firefox or the command line:
 
 on the host specify the ccid-card-passthru device with a suitable chardev:
 
-    qemu -chardev socket,server,host=0.0.0.0,port=2001,id=ccid,nowait -usb -device usb-ccid -device ccid-card-passthru,chardev=ccid
+    qemu -chardev socket,server=on,host=0.0.0.0,port=2001,id=ccid,wait=off \
+         -usb -device usb-ccid -device ccid-card-passthru,chardev=ccid
 
 on the client run vscclient, built when you built QEMU:
 
@@ -125,7 +126,8 @@ Follow instructions as per #4, except run QEMU and vscclient as follows:
 Run qemu as per #5, and run vscclient from the "fake-smartcard"
 directory as follows:
 
-    qemu -chardev socket,server,host=0.0.0.0,port=2001,id=ccid,nowait -usb -device usb-ccid -device ccid-card-passthru,chardev=ccid
+    qemu -chardev socket,server=on,host=0.0.0.0,port=2001,id=ccid,wait=off \
+         -usb -device usb-ccid -device ccid-card-passthru,chardev=ccid
     vscclient -e "db=\"sql:$PWD\" use_hw=no soft=(,Test,CAC,,id-cert,signing-cert,encryption-cert)" <qemu-host> 2001
 
 
diff --git a/docs/colo-proxy.txt b/docs/colo-proxy.txt
index fa1cef0278..1fc38aed1b 100644
--- a/docs/colo-proxy.txt
+++ b/docs/colo-proxy.txt
@@ -164,11 +164,11 @@ clearly describe the usage.
 Primary(ip:3.3.3.3):
 -netdev tap,id=hn0,vhost=off,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown
 -device e1000,id=e0,netdev=hn0,mac=52:a4:00:12:78:66
--chardev socket,id=mirror0,host=3.3.3.3,port=9003,server,nowait
--chardev socket,id=compare1,host=3.3.3.3,port=9004,server,nowait
--chardev socket,id=compare0,host=3.3.3.3,port=9001,server,nowait
+-chardev socket,id=mirror0,host=3.3.3.3,port=9003,server=on,wait=off
+-chardev socket,id=compare1,host=3.3.3.3,port=9004,server=on,wait=off
+-chardev socket,id=compare0,host=3.3.3.3,port=9001,server=on,wait=off
 -chardev socket,id=compare0-0,host=3.3.3.3,port=9001
--chardev socket,id=compare_out,host=3.3.3.3,port=9005,server,nowait
+-chardev socket,id=compare_out,host=3.3.3.3,port=9005,server=on,wait=off
 -chardev socket,id=compare_out0,host=3.3.3.3,port=9005
 -object iothread,id=iothread1
 -object filter-mirror,id=m0,netdev=hn0,queue=tx,outdev=mirror0
@@ -190,11 +190,11 @@ If you want to use virtio-net-pci or other driver with vnet_header:
 Primary(ip:3.3.3.3):
 -netdev tap,id=hn0,vhost=off,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown
 -device e1000,id=e0,netdev=hn0,mac=52:a4:00:12:78:66
--chardev socket,id=mirror0,host=3.3.3.3,port=9003,server,nowait
--chardev socket,id=compare1,host=3.3.3.3,port=9004,server,nowait
--chardev socket,id=compare0,host=3.3.3.3,port=9001,server,nowait
+-chardev socket,id=mirror0,host=3.3.3.3,port=9003,server=on,wait=off
+-chardev socket,id=compare1,host=3.3.3.3,port=9004,server=on,wait=off
+-chardev socket,id=compare0,host=3.3.3.3,port=9001,server=on,wait=off
 -chardev socket,id=compare0-0,host=3.3.3.3,port=9001
--chardev socket,id=compare_out,host=3.3.3.3,port=9005,server,nowait
+-chardev socket,id=compare_out,host=3.3.3.3,port=9005,server=on,wait=off
 -chardev socket,id=compare_out0,host=3.3.3.3,port=9005
 -object filter-mirror,id=m0,netdev=hn0,queue=tx,outdev=mirror0,vnet_hdr_support
 -object filter-redirector,netdev=hn0,id=redire0,queue=rx,indev=compare_out,vnet_hdr_support
diff --git a/docs/devel/writing-qmp-commands.txt b/docs/devel/writing-qmp-commands.txt
index 258e63bff5..b1e31d56c0 100644
--- a/docs/devel/writing-qmp-commands.txt
+++ b/docs/devel/writing-qmp-commands.txt
@@ -39,7 +39,7 @@ shown here.
 First, QEMU should be started like this:
 
 # qemu-system-TARGET [...] \
-    -chardev socket,id=qmp,port=4444,host=localhost,server \
+    -chardev socket,id=qmp,port=4444,host=localhost,server=on \
     -mon chardev=qmp,mode=control,pretty=on
 
 Then, in a different terminal:
diff --git a/docs/interop/live-block-operations.rst b/docs/interop/live-block-operations.rst
index e13f5a21f8..1073b930dc 100644
--- a/docs/interop/live-block-operations.rst
+++ b/docs/interop/live-block-operations.rst
@@ -133,7 +133,7 @@ socket::
         -M q35 -nodefaults -m 512 \
         -blockdev node-name=node-A,driver=qcow2,file.driver=file,file.node-name=file,file.filename=./a.qcow2 \
         -device virtio-blk,drive=node-A,id=virtio0 \
-        -monitor stdio -qmp unix:/tmp/qmp-sock,server,nowait
+        -monitor stdio -qmp unix:/tmp/qmp-sock,server=on,wait=off
 
 The ``-blockdev`` command-line option, used above, is available from
 QEMU 2.9 onwards.  In the above invocation, notice the ``node-name``
@@ -698,7 +698,7 @@ it could be located elsewhere)::
         -M q35 -nodefaults -m 512 \
         -blockdev node-name=node-TargetDisk,driver=qcow2,file.driver=file,file.node-name=file,file.filename=./target-disk.qcow2 \
         -device virtio-blk,drive=node-TargetDisk,id=virtio0 \
-        -S -monitor stdio -qmp unix:./qmp-sock2,server,nowait \
+        -S -monitor stdio -qmp unix:./qmp-sock2,server=on,wait=off \
         -incoming tcp:localhost:6666
 
 Given the disk image chain on source QEMU::
diff --git a/docs/interop/qmp-intro.txt b/docs/interop/qmp-intro.txt
index 9d54a718b8..1c745a7af0 100644
--- a/docs/interop/qmp-intro.txt
+++ b/docs/interop/qmp-intro.txt
@@ -26,7 +26,7 @@ Usage
 You can use the -qmp option to enable QMP. For example, the following
 makes QMP available on localhost port 4444:
 
-$ qemu [...] -qmp tcp:localhost:4444,server,nowait
+$ qemu [...] -qmp tcp:localhost:4444,server=on,wait=off
 
 However, for more flexibility and to make use of more options, the -mon
 command-line option should be used. For instance, the following example
@@ -34,7 +34,7 @@ creates one HMP instance (human monitor) on stdio and one QMP instance
 on localhost port 4444:
 
 $ qemu [...] -chardev stdio,id=mon0 -mon chardev=mon0,mode=readline \
-             -chardev socket,id=mon1,host=localhost,port=4444,server,nowait \
+             -chardev socket,id=mon1,host=localhost,port=4444,server=on,wait=off \
              -mon chardev=mon1,mode=control,pretty=on
 
 Please, refer to QEMU's manpage for more information.
diff --git a/docs/system/cpu-hotplug.rst b/docs/system/cpu-hotplug.rst
index d0b06403f1..bd0663616e 100644
--- a/docs/system/cpu-hotplug.rst
+++ b/docs/system/cpu-hotplug.rst
@@ -14,7 +14,7 @@ vCPU hotplug
       $ qemu-system-x86_64 -display none -no-user-config -m 2048 \
           -nodefaults -monitor stdio -machine pc,accel=kvm,usb=off \
           -smp 1,maxcpus=2 -cpu IvyBridge-IBRS \
-          -qmp unix:/tmp/qmp-sock,server,nowait
+          -qmp unix:/tmp/qmp-sock,server=on,wait=off
 
 (2) Run 'qmp-shell' (located in the source tree, under: "scripts/qmp/)
     to connect to the just-launched QEMU::
diff --git a/docs/system/s390x/3270.rst b/docs/system/s390x/3270.rst
index 0554a70a9f..0e173b323f 100644
--- a/docs/system/s390x/3270.rst
+++ b/docs/system/s390x/3270.rst
@@ -24,7 +24,7 @@ Example configuration
 
 * Add a ``tn3270`` chardev and a ``x-terminal3270`` to the QEMU command line::
 
-   -chardev socket,id=ch0,host=0.0.0.0,port=2300,nowait,server,tn3270
+   -chardev socket,id=ch0,host=0.0.0.0,port=2300,wait=off,server=on,tn3270=on
    -device x-terminal3270,chardev=ch0,devno=fe.0.000a,id=terminal0
 
 * Start the guest. In the guest, use ``chccwdev -e 0.0.000a`` to enable
diff --git a/docs/system/target-avr.rst b/docs/system/target-avr.rst
index 25ab46ef05..03d5ab51c1 100644
--- a/docs/system/target-avr.rst
+++ b/docs/system/target-avr.rst
@@ -24,7 +24,7 @@ AVR cpu
 - Continuous non interrupted execution with serial output into telnet window::
 
    qemu-system-avr -M mega2560 -bios demo.elf -nographic \
-                   -serial tcp::5678,server,nowait
+                   -serial tcp::5678,server=on,wait=off
 
   and then in another shell::
 
diff --git a/docs/tools/qemu-storage-daemon.rst b/docs/tools/qemu-storage-daemon.rst
index f63627eaf6..c05b3d3811 100644
--- a/docs/tools/qemu-storage-daemon.rst
+++ b/docs/tools/qemu-storage-daemon.rst
@@ -69,7 +69,7 @@ Standard options:
   a description of character device properties. A common character device
   definition configures a UNIX domain socket::
 
-  --chardev socket,id=char1,path=/tmp/qmp.sock,server,nowait
+  --chardev socket,id=char1,path=/tmp/qmp.sock,server=on,wait=off
 
 .. option:: --export [type=]nbd,id=<id>,node-name=<node-name>[,name=<export-name>][,writable=on|off][,bitmap=<name>]
   --export [type=]vhost-user-blk,id=<id>,node-name=<node-name>,addr.type=unix,addr.path=<socket-path>[,writable=on|off][,logical-block-size=<block-size>][,num-queues=<num-queues>]
@@ -124,7 +124,7 @@ Launch the daemon with QMP monitor socket ``qmp.sock`` so clients can execute
 QMP commands::
 
   $ qemu-storage-daemon \
-      --chardev socket,path=qmp.sock,server,nowait,id=char1 \
+      --chardev socket,path=qmp.sock,server=on,wait=off,id=char1 \
       --monitor chardev=char1
 
 Export raw image file ``disk.img`` over NBD UNIX domain socket ``nbd.sock``::
diff --git a/scripts/qmp/qemu-ga-client b/scripts/qmp/qemu-ga-client
index ce122984a9..348d85864c 100755
--- a/scripts/qmp/qemu-ga-client
+++ b/scripts/qmp/qemu-ga-client
@@ -11,7 +11,7 @@
 #
 # Start QEMU with:
 #
-# # qemu [...] -chardev socket,path=/tmp/qga.sock,server,nowait,id=qga0 \
+# # qemu [...] -chardev socket,path=/tmp/qga.sock,server=on,wait=off,id=qga0 \
 #   -device virtio-serial -device virtserialport,chardev=qga0,name=org.qemu.guest_agent.0
 #
 # Run the script:
diff --git a/tests/test-char.c b/tests/test-char.c
index 469d25989c..755d54c15e 100644
--- a/tests/test-char.c
+++ b/tests/test-char.c
@@ -780,7 +780,7 @@ static void char_socket_server_test(gconstpointer opaque)
 
     g_setenv("QTEST_SILENT_ERRORS", "1", 1);
     /*
-     * We rely on config->addr containing "nowait", otherwise
+     * We rely on config->addr containing "wait=off", otherwise
      * qemu_chr_new() will block until a client connects. We
      * can't spawn our client thread though, because until
      * qemu_chr_new() returns we don't know what TCP port was
@@ -1114,7 +1114,7 @@ static void char_socket_server_two_clients_test(gconstpointer opaque)
 
     g_setenv("QTEST_SILENT_ERRORS", "1", 1);
     /*
-     * We rely on addr containing "nowait", otherwise
+     * We rely on addr containing "wait=off", otherwise
      * qemu_chr_new() will block until a client connects. We
      * can't spawn our client thread though, because until
      * qemu_chr_new() returns we don't know what TCP port was
-- 
2.29.2




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

* [PULL 22/29] docs: update to show preferred boolean syntax for -vnc
  2021-02-26  8:04 [PULL 00/29] Misc patches for 2021-02-25 Paolo Bonzini
                   ` (20 preceding siblings ...)
  2021-02-26  8:05 ` [PULL 21/29] docs: update to show preferred boolean syntax for -chardev Paolo Bonzini
@ 2021-02-26  8:05 ` Paolo Bonzini
  2021-02-26  8:05 ` [PULL 23/29] docs: update to show preferred boolean syntax for -cpu Paolo Bonzini
                   ` (8 subsequent siblings)
  30 siblings, 0 replies; 41+ messages in thread
From: Paolo Bonzini @ 2021-02-26  8:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: Daniel P. Berrangé

From: Daniel P. Berrangé <berrange@redhat.com>

The preferred syntax is to use "foo=on|off", rather than a bare
"foo" or "nofoo".

The on|off syntax has been supported since -vnc switched to use
QemuOpts in commit 4db14629c38611061fc19ec6927405923de84f08

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20210216191027.595031-9-berrange@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 docs/system/vnc-security.rst | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/docs/system/vnc-security.rst b/docs/system/vnc-security.rst
index ebca656d87..830f6acc73 100644
--- a/docs/system/vnc-security.rst
+++ b/docs/system/vnc-security.rst
@@ -44,7 +44,7 @@ the password all clients will be rejected.
 
 .. parsed-literal::
 
-   |qemu_system| [...OPTIONS...] -vnc :1,password -monitor stdio
+   |qemu_system| [...OPTIONS...] -vnc :1,password=on -monitor stdio
    (qemu) change vnc password
    Password: ********
    (qemu)
@@ -104,7 +104,7 @@ authentication to provide two layers of authentication for clients.
 
    |qemu_system| [...OPTIONS...] \
      -object tls-creds-x509,id=tls0,dir=/etc/pki/qemu,endpoint=server,verify-peer=on \
-     -vnc :1,tls-creds=tls0,password -monitor stdio
+     -vnc :1,tls-creds=tls0,password=on -monitor stdio
    (qemu) change vnc password
    Password: ********
    (qemu)
@@ -128,7 +128,7 @@ can be launched with:
 
 .. parsed-literal::
 
-   |qemu_system| [...OPTIONS...] -vnc :1,sasl -monitor stdio
+   |qemu_system| [...OPTIONS...] -vnc :1,sasl=on -monitor stdio
 
 .. _vnc_005fsec_005fcertificate_005fsasl:
 
@@ -146,7 +146,7 @@ x509 options:
 
    |qemu_system| [...OPTIONS...] \
      -object tls-creds-x509,id=tls0,dir=/etc/pki/qemu,endpoint=server,verify-peer=on \
-     -vnc :1,tls-creds=tls0,sasl -monitor stdio
+     -vnc :1,tls-creds=tls0,sasl=on -monitor stdio
 
 .. _vnc_005fsetup_005fsasl:
 
-- 
2.29.2




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

* [PULL 23/29] docs: update to show preferred boolean syntax for -cpu
  2021-02-26  8:04 [PULL 00/29] Misc patches for 2021-02-25 Paolo Bonzini
                   ` (21 preceding siblings ...)
  2021-02-26  8:05 ` [PULL 22/29] docs: update to show preferred boolean syntax for -vnc Paolo Bonzini
@ 2021-02-26  8:05 ` Paolo Bonzini
  2021-02-26  8:05 ` [PULL 24/29] target/i386: " Paolo Bonzini
                   ` (7 subsequent siblings)
  30 siblings, 0 replies; 41+ messages in thread
From: Paolo Bonzini @ 2021-02-26  8:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: Daniel P. Berrangé

From: Daniel P. Berrangé <berrange@redhat.com>

The preferred syntax is to use "foo=on|off", rather than a bare
"+foo" or "-foo"

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20210216191027.595031-10-berrange@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 docs/COLO-FT.txt                   | 4 ++--
 docs/interop/firmware.json         | 2 +-
 docs/system/cpu-models-x86.rst.inc | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/docs/COLO-FT.txt b/docs/COLO-FT.txt
index 8874690e83..8d6d53a5a2 100644
--- a/docs/COLO-FT.txt
+++ b/docs/COLO-FT.txt
@@ -158,7 +158,7 @@ instance.
 
 # imagefolder="/mnt/vms/colo-test-primary"
 
-# qemu-system-x86_64 -enable-kvm -cpu qemu64,+kvmclock -m 512 -smp 1 -qmp stdio \
+# qemu-system-x86_64 -enable-kvm -cpu qemu64,kvmclock=on -m 512 -smp 1 -qmp stdio \
    -device piix3-usb-uhci -device usb-tablet -name primary \
    -netdev tap,id=hn0,vhost=off,helper=/usr/lib/qemu/qemu-bridge-helper \
    -device rtl8139,id=e0,netdev=hn0 \
@@ -189,7 +189,7 @@ any IP's here, except for the $primary_ip variable.
 
 # qemu-img create -f qcow2 $imagefolder/secondary-hidden.qcow2 10G
 
-# qemu-system-x86_64 -enable-kvm -cpu qemu64,+kvmclock -m 512 -smp 1 -qmp stdio \
+# qemu-system-x86_64 -enable-kvm -cpu qemu64,kvmclock=on -m 512 -smp 1 -qmp stdio \
    -device piix3-usb-uhci -device usb-tablet -name secondary \
    -netdev tap,id=hn0,vhost=off,helper=/usr/lib/qemu/qemu-bridge-helper \
    -device rtl8139,id=e0,netdev=hn0 \
diff --git a/docs/interop/firmware.json b/docs/interop/firmware.json
index 989f10b626..9d94ccafa9 100644
--- a/docs/interop/firmware.json
+++ b/docs/interop/firmware.json
@@ -129,7 +129,7 @@
 #                "-machine smm=on". (On the "pc-q35-*" machine types of
 #                the @i386 emulation target, @requires-smm presents
 #                further CPU requirements; one combination known to work
-#                is "-cpu coreduo,-nx".) If the firmware is marked as
+#                is "-cpu coreduo,nx=off".) If the firmware is marked as
 #                both @secure-boot and @requires-smm, then write
 #                accesses to the pflash chip (NVRAM) that holds the UEFI
 #                variable store must be restricted to code that executes
diff --git a/docs/system/cpu-models-x86.rst.inc b/docs/system/cpu-models-x86.rst.inc
index 9a2327828e..867c8216b5 100644
--- a/docs/system/cpu-models-x86.rst.inc
+++ b/docs/system/cpu-models-x86.rst.inc
@@ -364,7 +364,7 @@ Host passthrough with feature customization:
 
 .. parsed-literal::
 
-  |qemu_system| -cpu host,-vmx,...
+  |qemu_system| -cpu host,vmx=off,...
 
 Named CPU models:
 
@@ -376,7 +376,7 @@ Named CPU models with feature customization:
 
 .. parsed-literal::
 
-  |qemu_system| -cpu Westmere,+pcid,...
+  |qemu_system| -cpu Westmere,pcid=on,...
 
 Libvirt guest XML
 ^^^^^^^^^^^^^^^^^
-- 
2.29.2




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

* [PULL 24/29] target/i386: update to show preferred boolean syntax for -cpu
  2021-02-26  8:04 [PULL 00/29] Misc patches for 2021-02-25 Paolo Bonzini
                   ` (22 preceding siblings ...)
  2021-02-26  8:05 ` [PULL 23/29] docs: update to show preferred boolean syntax for -cpu Paolo Bonzini
@ 2021-02-26  8:05 ` Paolo Bonzini
  2021-02-26  8:05 ` [PULL 25/29] qom/object.c: Fix typo Paolo Bonzini
                   ` (6 subsequent siblings)
  30 siblings, 0 replies; 41+ messages in thread
From: Paolo Bonzini @ 2021-02-26  8:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: Daniel P. Berrangé

From: Daniel P. Berrangé <berrange@redhat.com>

The preferred syntax is to use "foo=on|off", rather than a bare
"+foo" or "-foo"

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20210216191027.595031-11-berrange@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 target/i386/cpu.c                   |  2 +-
 tests/qtest/test-x86-cpuid-compat.c | 52 ++++++++++++++---------------
 2 files changed, 27 insertions(+), 27 deletions(-)

diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 6a53446e6a..bc6956561a 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -6557,7 +6557,7 @@ static void x86_cpu_expand_features(X86CPU *cpu, Error **errp)
             } else if (cpu->env.cpuid_min_level < 0x14) {
                 mark_unavailable_features(cpu, FEAT_7_0_EBX,
                     CPUID_7_0_EBX_INTEL_PT,
-                    "Intel PT need CPUID leaf 0x14, please set by \"-cpu ...,+intel-pt,min-level=0x14\"");
+                    "Intel PT need CPUID leaf 0x14, please set by \"-cpu ...,intel-pt=on,min-level=0x14\"");
             }
         }
 
diff --git a/tests/qtest/test-x86-cpuid-compat.c b/tests/qtest/test-x86-cpuid-compat.c
index 7ca1883a29..6470f0a85d 100644
--- a/tests/qtest/test-x86-cpuid-compat.c
+++ b/tests/qtest/test-x86-cpuid-compat.c
@@ -235,82 +235,82 @@ int main(int argc, char **argv)
     /* If level is not large enough, it should increase automatically: */
     /* CPUID[6].EAX: */
     add_cpuid_test("x86/cpuid/auto-level/phenom/arat",
-                   "-cpu 486,+arat", "level", 6);
+                   "-cpu 486,arat=on", "level", 6);
     /* CPUID[EAX=7,ECX=0].EBX: */
     add_cpuid_test("x86/cpuid/auto-level/phenom/fsgsbase",
-                   "-cpu phenom,+fsgsbase", "level", 7);
+                   "-cpu phenom,fsgsbase=on", "level", 7);
     /* CPUID[EAX=7,ECX=0].ECX: */
     add_cpuid_test("x86/cpuid/auto-level/phenom/avx512vbmi",
-                   "-cpu phenom,+avx512vbmi", "level", 7);
+                   "-cpu phenom,avx512vbmi=on", "level", 7);
     /* CPUID[EAX=0xd,ECX=1].EAX: */
     add_cpuid_test("x86/cpuid/auto-level/phenom/xsaveopt",
-                   "-cpu phenom,+xsaveopt", "level", 0xd);
+                   "-cpu phenom,xsaveopt=on", "level", 0xd);
     /* CPUID[8000_0001].EDX: */
     add_cpuid_test("x86/cpuid/auto-xlevel/486/3dnow",
-                   "-cpu 486,+3dnow", "xlevel", 0x80000001);
+                   "-cpu 486,3dnow=on", "xlevel", 0x80000001);
     /* CPUID[8000_0001].ECX: */
     add_cpuid_test("x86/cpuid/auto-xlevel/486/sse4a",
-                   "-cpu 486,+sse4a", "xlevel", 0x80000001);
+                   "-cpu 486,sse4a=on", "xlevel", 0x80000001);
     /* CPUID[8000_0007].EDX: */
     add_cpuid_test("x86/cpuid/auto-xlevel/486/invtsc",
-                   "-cpu 486,+invtsc", "xlevel", 0x80000007);
+                   "-cpu 486,invtsc=on", "xlevel", 0x80000007);
     /* CPUID[8000_000A].EDX: */
     add_cpuid_test("x86/cpuid/auto-xlevel/486/npt",
-                   "-cpu 486,+svm,+npt", "xlevel", 0x8000000A);
+                   "-cpu 486,svm=on,npt=on", "xlevel", 0x8000000A);
     /* CPUID[C000_0001].EDX: */
     add_cpuid_test("x86/cpuid/auto-xlevel2/phenom/xstore",
-                   "-cpu phenom,+xstore", "xlevel2", 0xC0000001);
+                   "-cpu phenom,xstore=on", "xlevel2", 0xC0000001);
     /* SVM needs CPUID[0x8000000A] */
     add_cpuid_test("x86/cpuid/auto-xlevel/athlon/svm",
-                   "-cpu athlon,+svm", "xlevel", 0x8000000A);
+                   "-cpu athlon,svm=on", "xlevel", 0x8000000A);
 
 
     /* If level is already large enough, it shouldn't change: */
     add_cpuid_test("x86/cpuid/auto-level/SandyBridge/multiple",
-                   "-cpu SandyBridge,+arat,+fsgsbase,+avx512vbmi",
+                   "-cpu SandyBridge,arat=on,fsgsbase=on,avx512vbmi=on",
                    "level", 0xd);
     /* If level is explicitly set, it shouldn't change: */
     add_cpuid_test("x86/cpuid/auto-level/486/fixed/0xF",
-                   "-cpu 486,level=0xF,+arat,+fsgsbase,+avx512vbmi,+xsaveopt",
+                   "-cpu 486,level=0xF,arat=on,fsgsbase=on,avx512vbmi=on,xsaveopt=on",
                    "level", 0xF);
     add_cpuid_test("x86/cpuid/auto-level/486/fixed/2",
-                   "-cpu 486,level=2,+arat,+fsgsbase,+avx512vbmi,+xsaveopt",
+                   "-cpu 486,level=2,arat=on,fsgsbase=on,avx512vbmi=on,xsaveopt=on",
                    "level", 2);
     add_cpuid_test("x86/cpuid/auto-level/486/fixed/0",
-                   "-cpu 486,level=0,+arat,+fsgsbase,+avx512vbmi,+xsaveopt",
+                   "-cpu 486,level=0,arat=on,fsgsbase=on,avx512vbmi=on,xsaveopt=on",
                    "level", 0);
 
     /* if xlevel is already large enough, it shouldn't change: */
     add_cpuid_test("x86/cpuid/auto-xlevel/phenom/3dnow",
-                   "-cpu phenom,+3dnow,+sse4a,+invtsc,+npt,+svm",
+                   "-cpu phenom,3dnow=on,sse4a=on,invtsc=on,npt=on,svm=on",
                    "xlevel", 0x8000001A);
     /* If xlevel is explicitly set, it shouldn't change: */
     add_cpuid_test("x86/cpuid/auto-xlevel/486/fixed/80000002",
-                   "-cpu 486,xlevel=0x80000002,+3dnow,+sse4a,+invtsc,+npt,+svm",
+                   "-cpu 486,xlevel=0x80000002,3dnow=on,sse4a=on,invtsc=on,npt=on,svm=on",
                    "xlevel", 0x80000002);
     add_cpuid_test("x86/cpuid/auto-xlevel/486/fixed/8000001A",
-                   "-cpu 486,xlevel=0x8000001A,+3dnow,+sse4a,+invtsc,+npt,+svm",
+                   "-cpu 486,xlevel=0x8000001A,3dnow=on,sse4a=on,invtsc=on,npt=on,svm=on",
                    "xlevel", 0x8000001A);
     add_cpuid_test("x86/cpuid/auto-xlevel/phenom/fixed/0",
-                   "-cpu 486,xlevel=0,+3dnow,+sse4a,+invtsc,+npt,+svm",
+                   "-cpu 486,xlevel=0,3dnow=on,sse4a=on,invtsc=on,npt=on,svm=on",
                    "xlevel", 0);
 
     /* if xlevel2 is already large enough, it shouldn't change: */
     add_cpuid_test("x86/cpuid/auto-xlevel2/486/fixed",
-                   "-cpu 486,xlevel2=0xC0000002,+xstore",
+                   "-cpu 486,xlevel2=0xC0000002,xstore=on",
                    "xlevel2", 0xC0000002);
 
     /* Check compatibility of old machine-types that didn't
      * auto-increase level/xlevel/xlevel2: */
 
     add_cpuid_test("x86/cpuid/auto-level/pc-2.7",
-                   "-machine pc-i440fx-2.7 -cpu 486,+arat,+avx512vbmi,+xsaveopt",
+                   "-machine pc-i440fx-2.7 -cpu 486,arat=on,avx512vbmi=on,xsaveopt=on",
                    "level", 1);
     add_cpuid_test("x86/cpuid/auto-xlevel/pc-2.7",
-                   "-machine pc-i440fx-2.7 -cpu 486,+3dnow,+sse4a,+invtsc,+npt,+svm",
+                   "-machine pc-i440fx-2.7 -cpu 486,3dnow=on,sse4a=on,invtsc=on,npt=on,svm=on",
                    "xlevel", 0);
     add_cpuid_test("x86/cpuid/auto-xlevel2/pc-2.7",
-                   "-machine pc-i440fx-2.7 -cpu 486,+xstore",
+                   "-machine pc-i440fx-2.7 -cpu 486,xstore=on",
                    "xlevel2", 0);
     /*
      * QEMU 1.4.0 had auto-level enabled for CPUID[7], already,
@@ -321,19 +321,19 @@ int main(int argc, char **argv)
                    "-machine pc-i440fx-1.4 -cpu Nehalem",
                    "level", 2);
     add_cpuid_test("x86/cpuid/auto-level7/pc-i440fx-1.5/on",
-                   "-machine pc-i440fx-1.4 -cpu Nehalem,+smap",
+                   "-machine pc-i440fx-1.4 -cpu Nehalem,smap=on",
                    "level", 7);
     add_cpuid_test("x86/cpuid/auto-level7/pc-i440fx-2.3/off",
                    "-machine pc-i440fx-2.3 -cpu Penryn",
                    "level", 4);
     add_cpuid_test("x86/cpuid/auto-level7/pc-i440fx-2.3/on",
-                   "-machine pc-i440fx-2.3 -cpu Penryn,+erms",
+                   "-machine pc-i440fx-2.3 -cpu Penryn,erms=on",
                    "level", 7);
     add_cpuid_test("x86/cpuid/auto-level7/pc-i440fx-2.9/off",
                    "-machine pc-i440fx-2.9 -cpu Conroe",
                    "level", 10);
     add_cpuid_test("x86/cpuid/auto-level7/pc-i440fx-2.9/on",
-                   "-machine pc-i440fx-2.9 -cpu Conroe,+erms",
+                   "-machine pc-i440fx-2.9 -cpu Conroe,erms=on",
                    "level", 10);
 
     /*
@@ -348,7 +348,7 @@ int main(int argc, char **argv)
                    "-machine pc-i440fx-2.4 -cpu SandyBridge,",
                    "xlevel", 0x80000008);
     add_cpuid_test("x86/cpuid/xlevel-compat/pc-i440fx-2.4/npt-on",
-                   "-machine pc-i440fx-2.4 -cpu SandyBridge,+svm,+npt",
+                   "-machine pc-i440fx-2.4 -cpu SandyBridge,svm=on,npt=on",
                    "xlevel", 0x80000008);
 
     /* Test feature parsing */
-- 
2.29.2




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

* [PULL 25/29] qom/object.c: Fix typo
  2021-02-26  8:04 [PULL 00/29] Misc patches for 2021-02-25 Paolo Bonzini
                   ` (23 preceding siblings ...)
  2021-02-26  8:05 ` [PULL 24/29] target/i386: " Paolo Bonzini
@ 2021-02-26  8:05 ` Paolo Bonzini
  2021-02-26  8:05 ` [PULL 26/29] target/i386: Add bus lock debug exception support Paolo Bonzini
                   ` (5 subsequent siblings)
  30 siblings, 0 replies; 41+ messages in thread
From: Paolo Bonzini @ 2021-02-26  8:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: Doug Evans

From: Doug Evans <dje@google.com>

A simple typo (noticed by inspection).

Signed-off-by: Doug Evans <dje@google.com>
Message-Id: <000000000000530c7105bb191b33@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

Signed-off-by: Doug Evans <dje@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 qom/object.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qom/object.c b/qom/object.c
index 491823db4a..6a01d56546 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -695,7 +695,7 @@ static void object_finalize(void *data)
 
 /* Find the minimum alignment guaranteed by the system malloc. */
 #if __STDC_VERSION__ >= 201112L
-typddef max_align_t qemu_max_align_t;
+typedef max_align_t qemu_max_align_t;
 #else
 typedef union {
     long l;
-- 
2.29.2




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

* [PULL 26/29] target/i386: Add bus lock debug exception support
  2021-02-26  8:04 [PULL 00/29] Misc patches for 2021-02-25 Paolo Bonzini
                   ` (24 preceding siblings ...)
  2021-02-26  8:05 ` [PULL 25/29] qom/object.c: Fix typo Paolo Bonzini
@ 2021-02-26  8:05 ` Paolo Bonzini
  2021-02-26  8:05 ` [PULL 27/29] vl: deprecate -writeconfig Paolo Bonzini
                   ` (4 subsequent siblings)
  30 siblings, 0 replies; 41+ messages in thread
From: Paolo Bonzini @ 2021-02-26  8:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: Chenyi Qiang

From: Chenyi Qiang <chenyi.qiang@intel.com>

Bus lock debug exception is a feature that can notify the kernel by
generate an #DB trap after the instruction acquires a bus lock when
CPL>0. This allows the kernel to enforce user application throttling or
mitigations.

This feature is enumerated via CPUID.(EAX=7,ECX=0).ECX[bit 24].

Signed-off-by: Chenyi Qiang <chenyi.qiang@intel.com>
Message-Id: <20210202090224.13274-1-chenyi.qiang@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 target/i386/cpu.c | 2 +-
 target/i386/cpu.h | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index bc6956561a..50008431c3 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -963,7 +963,7 @@ static FeatureWordInfo feature_word_info[FEATURE_WORDS] = {
             "avx512bitalg", NULL, "avx512-vpopcntdq", NULL,
             "la57", NULL, NULL, NULL,
             NULL, NULL, "rdpid", NULL,
-            NULL, "cldemote", NULL, "movdiri",
+            "bus-lock-detect", "cldemote", NULL, "movdiri",
             "movdir64b", NULL, NULL, "pks",
         },
         .cpuid = {
diff --git a/target/i386/cpu.h b/target/i386/cpu.h
index 8be39cfb62..b4b136cd0d 100644
--- a/target/i386/cpu.h
+++ b/target/i386/cpu.h
@@ -769,6 +769,8 @@ typedef uint64_t FeatureWordArray[FEATURE_WORDS];
 #define CPUID_7_0_ECX_LA57              (1U << 16)
 /* Read Processor ID */
 #define CPUID_7_0_ECX_RDPID             (1U << 22)
+/* Bus Lock Debug Exception */
+#define CPUID_7_0_ECX_BUS_LOCK_DETECT   (1U << 24)
 /* Cache Line Demote Instruction */
 #define CPUID_7_0_ECX_CLDEMOTE          (1U << 25)
 /* Move Doubleword as Direct Store Instruction */
-- 
2.29.2




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

* [PULL 27/29] vl: deprecate -writeconfig
  2021-02-26  8:04 [PULL 00/29] Misc patches for 2021-02-25 Paolo Bonzini
                   ` (25 preceding siblings ...)
  2021-02-26  8:05 ` [PULL 26/29] target/i386: Add bus lock debug exception support Paolo Bonzini
@ 2021-02-26  8:05 ` Paolo Bonzini
  2021-03-01  8:00   ` Markus Armbruster
  2021-03-01 16:03   ` About '-readconfig' [Was: Re: [PULL 27/29] vl: deprecate -writeconfig] Kashyap Chamarthy
  2021-02-26  8:05 ` [PULL 28/29] chardev: do not use short form boolean options in non-QemuOpts character device descriptions Paolo Bonzini
                   ` (3 subsequent siblings)
  30 siblings, 2 replies; 41+ messages in thread
From: Paolo Bonzini @ 2021-02-26  8:05 UTC (permalink / raw)
  To: qemu-devel

The functionality of -writeconfig is limited and the code
does not even try to detect cases where it prints incorrect
syntax (for example if values have a quote in them, since
qemu_config_parse does not support any kind of escaping)
so remove it.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 docs/system/deprecated.rst | 7 +++++++
 qemu-options.hx            | 7 +------
 softmmu/vl.c               | 1 +
 3 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst
index 2fcac7861e..561c916da2 100644
--- a/docs/system/deprecated.rst
+++ b/docs/system/deprecated.rst
@@ -146,6 +146,13 @@ library enabled as a cryptography provider.
 Neither the ``nettle`` library, or the built-in cryptography provider are
 supported on FIPS enabled hosts.
 
+``-writeconfig`` (since 6.0)
+'''''''''''''''''''''''''''''
+
+The ``-writeconfig`` option is not able to serialize the entire contents
+of the QEMU command line.  It is thus considered a failed experiment
+and deprecated, with no current replacement.
+
 QEMU Machine Protocol (QMP) commands
 ------------------------------------
 
diff --git a/qemu-options.hx b/qemu-options.hx
index 34be5a7a2d..252db9357c 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -4335,13 +4335,8 @@ SRST
 ERST
 DEF("writeconfig", HAS_ARG, QEMU_OPTION_writeconfig,
     "-writeconfig <file>\n"
-    "                read/write config file\n", QEMU_ARCH_ALL)
+    "                read/write config file (deprecated)\n", QEMU_ARCH_ALL)
 SRST
-``-writeconfig file``
-    Write device configuration to file. The file can be either filename
-    to save command line and device configuration into file or dash
-    ``-``) character to print the output to stdout. This can be later
-    used as input file for ``-readconfig`` option.
 ERST
 
 DEF("no-user-config", 0, QEMU_OPTION_nouserconfig,
diff --git a/softmmu/vl.c b/softmmu/vl.c
index b219ce1f35..6d8393b6f7 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -3356,6 +3356,7 @@ void qemu_init(int argc, char **argv, char **envp)
             case QEMU_OPTION_writeconfig:
                 {
                     FILE *fp;
+                    warn_report("-writeconfig is deprecated.  It will go away in QEMU 6.2 with no replacement");
                     if (strcmp(optarg, "-") == 0) {
                         fp = stdout;
                     } else {
-- 
2.29.2




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

* [PULL 28/29] chardev: do not use short form boolean options in non-QemuOpts character device descriptions
  2021-02-26  8:04 [PULL 00/29] Misc patches for 2021-02-25 Paolo Bonzini
                   ` (26 preceding siblings ...)
  2021-02-26  8:05 ` [PULL 27/29] vl: deprecate -writeconfig Paolo Bonzini
@ 2021-02-26  8:05 ` Paolo Bonzini
  2021-02-26  8:05 ` [PULL 29/29] tcg/i386: rdpmc: fix the the condtions Paolo Bonzini
                   ` (2 subsequent siblings)
  30 siblings, 0 replies; 41+ messages in thread
From: Paolo Bonzini @ 2021-02-26  8:05 UTC (permalink / raw)
  To: qemu-devel

Options such as "-gdb" or "-serial" accept a part-QemuOpts part-parsed-by-hand
character device description.  Do not use short form boolean options in the
QemuOpts part.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 chardev/char-socket.c         | 10 +++++-----
 qapi/char.json                |  4 ++--
 tests/guest-debug/run-test.py |  8 ++++----
 3 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/chardev/char-socket.c b/chardev/char-socket.c
index b7863b8aae..06a37c0cc8 100644
--- a/chardev/char-socket.c
+++ b/chardev/char-socket.c
@@ -452,7 +452,7 @@ static char *qemu_chr_socket_address(SocketChardev *s, const char *prefix)
                                qemu_chr_socket_protocol(s),
                                s->addr->u.inet.host,
                                s->addr->u.inet.port,
-                               s->is_listen ? ",server" : "");
+                               s->is_listen ? ",server=on" : "");
         break;
     case SOCKET_ADDRESS_TYPE_UNIX:
     {
@@ -470,12 +470,12 @@ static char *qemu_chr_socket_address(SocketChardev *s, const char *prefix)
 
         return g_strdup_printf("%sunix:%s%s%s%s", prefix, sa->path,
                                abstract, tight,
-                               s->is_listen ? ",server" : "");
+                               s->is_listen ? ",server=on" : "");
         break;
     }
     case SOCKET_ADDRESS_TYPE_FD:
         return g_strdup_printf("%sfd:%s%s", prefix, s->addr->u.fd.str,
-                               s->is_listen ? ",server" : "");
+                               s->is_listen ? ",server=on" : "");
         break;
     case SOCKET_ADDRESS_TYPE_VSOCK:
         return g_strdup_printf("%svsock:%s:%s", prefix,
@@ -607,7 +607,7 @@ static char *qemu_chr_compute_filename(SocketChardev *s)
     case AF_UNIX:
         return g_strdup_printf("unix:%s%s",
                                ((struct sockaddr_un *)(ss))->sun_path,
-                               s->is_listen ? ",server" : "");
+                               s->is_listen ? ",server=on" : "");
 #endif
     case AF_INET6:
         left  = "[";
@@ -621,7 +621,7 @@ static char *qemu_chr_compute_filename(SocketChardev *s)
         return g_strdup_printf("%s:%s%s%s:%s%s <-> %s%s%s:%s",
                                qemu_chr_socket_protocol(s),
                                left, shost, right, sserv,
-                               s->is_listen ? ",server" : "",
+                               s->is_listen ? ",server=on" : "",
                                left, phost, right, pserv);
 
     default:
diff --git a/qapi/char.json b/qapi/char.json
index 58338ed62d..6413970fa7 100644
--- a/qapi/char.json
+++ b/qapi/char.json
@@ -47,12 +47,12 @@
 #       "return": [
 #          {
 #             "label": "charchannel0",
-#             "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.agent,server",
+#             "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.agent,server=on",
 #             "frontend-open": false
 #          },
 #          {
 #             "label": "charmonitor",
-#             "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.monitor,server",
+#             "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.monitor,server=on",
 #             "frontend-open": true
 #          },
 #          {
diff --git a/tests/guest-debug/run-test.py b/tests/guest-debug/run-test.py
index 8b91ff95af..2e58795a10 100755
--- a/tests/guest-debug/run-test.py
+++ b/tests/guest-debug/run-test.py
@@ -64,10 +64,10 @@ def log(output, msg):
 
     # Launch QEMU with binary
     if "system" in args.qemu:
-        cmd = "%s %s %s -gdb unix:path=%s,server" % (args.qemu,
-                                                     args.qargs,
-                                                     args.binary,
-                                                     socket_name)
+        cmd = "%s %s %s -gdb unix:path=%s,server=on" % (args.qemu,
+                                                        args.qargs,
+                                                        args.binary,
+                                                        socket_name)
     else:
         cmd = "%s %s -g %s %s" % (args.qemu, args.qargs, socket_name,
                                   args.binary)
-- 
2.29.2




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

* [PULL 29/29] tcg/i386: rdpmc: fix the the condtions
  2021-02-26  8:04 [PULL 00/29] Misc patches for 2021-02-25 Paolo Bonzini
                   ` (27 preceding siblings ...)
  2021-02-26  8:05 ` [PULL 28/29] chardev: do not use short form boolean options in non-QemuOpts character device descriptions Paolo Bonzini
@ 2021-02-26  8:05 ` Paolo Bonzini
  2021-02-26  8:51 ` [PULL 00/29] Misc patches for 2021-02-25 no-reply
  2021-03-03 16:54 ` Peter Maydell
  30 siblings, 0 replies; 41+ messages in thread
From: Paolo Bonzini @ 2021-02-26  8:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: Zheng Zhan Liang

From: Zheng Zhan Liang <linuxmaker@163.com>

Signed-off-by: Zheng Zhan Liang <linuxmaker@163.com>
Message-Id: <20210225054756.35962-1-linuxmaker@163.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 target/i386/tcg/misc_helper.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/target/i386/tcg/misc_helper.c b/target/i386/tcg/misc_helper.c
index f02e4fd400..90b87fdef0 100644
--- a/target/i386/tcg/misc_helper.c
+++ b/target/i386/tcg/misc_helper.c
@@ -222,7 +222,8 @@ void helper_rdtscp(CPUX86State *env)
 
 void helper_rdpmc(CPUX86State *env)
 {
-    if ((env->cr[4] & CR4_PCE_MASK) && ((env->hflags & HF_CPL_MASK) != 0)) {
+    if (((env->cr[4] & CR4_PCE_MASK) == 0 ) &&
+        ((env->hflags & HF_CPL_MASK) != 0)) {
         raise_exception_ra(env, EXCP0D_GPF, GETPC());
     }
     cpu_svm_check_intercept_param(env, SVM_EXIT_RDPMC, 0, GETPC());
-- 
2.29.2



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

* Re: [PULL 00/29] Misc patches for 2021-02-25
  2021-02-26  8:04 [PULL 00/29] Misc patches for 2021-02-25 Paolo Bonzini
                   ` (28 preceding siblings ...)
  2021-02-26  8:05 ` [PULL 29/29] tcg/i386: rdpmc: fix the the condtions Paolo Bonzini
@ 2021-02-26  8:51 ` no-reply
  2021-03-03 16:54 ` Peter Maydell
  30 siblings, 0 replies; 41+ messages in thread
From: no-reply @ 2021-02-26  8:51 UTC (permalink / raw)
  To: pbonzini; +Cc: qemu-devel

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



Hi,

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

Type: series
Message-id: 20210226080526.651705-1-pbonzini@redhat.com
Subject: [PULL 00/29] Misc patches for 2021-02-25

=== 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
 - [tag update]      patchew/20210224104707.88430-1-vsementsov@virtuozzo.com -> patchew/20210224104707.88430-1-vsementsov@virtuozzo.com
 - [tag update]      patchew/20210225230238.3719051-1-philmd@redhat.com -> patchew/20210225230238.3719051-1-philmd@redhat.com
 * [new tag]         patchew/20210226080526.651705-1-pbonzini@redhat.com -> patchew/20210226080526.651705-1-pbonzini@redhat.com
Switched to a new branch 'test'
fd845d2 tcg/i386: rdpmc: fix the the condtions
6cca88e chardev: do not use short form boolean options in non-QemuOpts character device descriptions
c2d0b1e vl: deprecate -writeconfig
c6f0672 target/i386: Add bus lock debug exception support
6b7da9a qom/object.c: Fix typo
b047080 target/i386: update to show preferred boolean syntax for -cpu
28b0198 docs: update to show preferred boolean syntax for -cpu
9f60b11 docs: update to show preferred boolean syntax for -vnc
e30703a docs: update to show preferred boolean syntax for -chardev
2206acf qemu-options: update to show preferred boolean syntax for -vnc
7b7eee8 qemu-options: update to show preferred boolean syntax for -incoming
b37488e qemu-options: update to show preferred boolean syntax for -netdev
1b9e964 qemu-options: update to show preferred boolean syntax for -spice
2e5713d qemu-options: update to show preferred boolean syntax for -chardev
08175f4 gdbstub: use preferred boolean option syntax
8351a83 char: don't fail when client is not connected
a8f06f3 scsi: drop 'result' argument from command_complete callback
35e1184 scsi-disk: pass guest recoverable errors through even for rerror=stop
2b29728 scsi-disk: pass SCSI status to scsi_handle_rw_error
e675011 scsi: introduce scsi_sense_from_errno()
47e724a scsi-disk: do not complete requests early for rerror/werror=ignore
7b99c1e scsi-disk: move scsi_handle_rw_error earlier
4e79a75 virtio-scsi: don't process IO on fenced dataplane
3562b18 scsi: allow user to set werror as report
6b78981 scsi: add tracing for SG_IO commands
2852a13 scsi: make io_timeout configurable
d59ba35 multiprocess: move feature to meson_options.txt
12cf51e configure: fix --enable-fuzzing linker failures
fab94e9 hvf: Sign the code after installation

=== OUTPUT BEGIN ===
1/29 Checking commit fab94e9db883 (hvf: Sign the code after installation)
2/29 Checking commit 12cf51e986e9 (configure: fix --enable-fuzzing linker failures)
3/29 Checking commit d59ba353744e (multiprocess: move feature to meson_options.txt)
4/29 Checking commit 2852a13fda3c (scsi: make io_timeout configurable)
5/29 Checking commit 6b78981b63fb (scsi: add tracing for SG_IO commands)
6/29 Checking commit 3562b1842165 (scsi: allow user to set werror as report)
7/29 Checking commit 4e79a75c1ba4 (virtio-scsi: don't process IO on fenced dataplane)
8/29 Checking commit 7b99c1ea8a0e (scsi-disk: move scsi_handle_rw_error earlier)
WARNING: Block comments use a leading /* on a separate line
#53: FILE: hw/scsi/scsi-disk.c:204:
+            /* A passthrough command has run and has produced sense data; check

WARNING: line over 80 characters
#58: FILE: hw/scsi/scsi-disk.c:209:
+            if (scsi_sense_buf_is_guest_recoverable(r->req.sense, sizeof(r->req.sense))) {

WARNING: Block comments use a leading /* on a separate line
#67: FILE: hw/scsi/scsi-disk.c:218:
+            /* These errno mapping are specific to Linux.  For more information:

total: 0 errors, 3 warnings, 186 lines checked

Patch 8/29 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
9/29 Checking commit 47e724ab13a3 (scsi-disk: do not complete requests early for rerror/werror=ignore)
10/29 Checking commit e6750118d606 (scsi: introduce scsi_sense_from_errno())
WARNING: Block comments use a leading /* on a separate line
#116: FILE: scsi/utils.c:576:
+        /* These errno mapping are specific to Linux.  For more information:

total: 0 errors, 1 warnings, 130 lines checked

Patch 10/29 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
11/29 Checking commit 2b2972801829 (scsi-disk: pass SCSI status to scsi_handle_rw_error)
12/29 Checking commit 35e118474be4 (scsi-disk: pass guest recoverable errors through even for rerror=stop)
WARNING: line over 80 characters
#36: FILE: hw/scsi/scsi-disk.c:222:
+        scsi_sense_buf_is_guest_recoverable(r->req.sense, sizeof(r->req.sense))) {

total: 0 errors, 1 warnings, 67 lines checked

Patch 12/29 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
13/29 Checking commit a8f06f393647 (scsi: drop 'result' argument from command_complete callback)
14/29 Checking commit 8351a83ca714 (char: don't fail when client is not connected)
15/29 Checking commit 08175f4c58a0 (gdbstub: use preferred boolean option syntax)
16/29 Checking commit 2e5713d9eeac (qemu-options: update to show preferred boolean syntax for -chardev)
17/29 Checking commit 1b9e96482163 (qemu-options: update to show preferred boolean syntax for -spice)
18/29 Checking commit b37488efe677 (qemu-options: update to show preferred boolean syntax for -netdev)
19/29 Checking commit 7b7eee8a1d72 (qemu-options: update to show preferred boolean syntax for -incoming)
20/29 Checking commit 2206acf6a11e (qemu-options: update to show preferred boolean syntax for -vnc)
21/29 Checking commit e30703a0788d (docs: update to show preferred boolean syntax for -chardev)
22/29 Checking commit 9f60b1136ad1 (docs: update to show preferred boolean syntax for -vnc)
23/29 Checking commit 28b01988c540 (docs: update to show preferred boolean syntax for -cpu)
24/29 Checking commit b047080a0ea4 (target/i386: update to show preferred boolean syntax for -cpu)
25/29 Checking commit 6b7da9a79357 (qom/object.c: Fix typo)
26/29 Checking commit c6f0672a2a0b (target/i386: Add bus lock debug exception support)
27/29 Checking commit c2d0b1e59151 (vl: deprecate -writeconfig)
ERROR: line over 90 characters
#66: FILE: softmmu/vl.c:3359:
+                    warn_report("-writeconfig is deprecated.  It will go away in QEMU 6.2 with no replacement");

total: 1 errors, 0 warnings, 34 lines checked

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

28/29 Checking commit 6cca88eea4e4 (chardev: do not use short form boolean options in non-QemuOpts character device descriptions)
29/29 Checking commit fd845d25a429 (tcg/i386: rdpmc: fix the the condtions)
ERROR: space prohibited before that close parenthesis ')'
#24: FILE: target/i386/tcg/misc_helper.c:225:
+    if (((env->cr[4] & CR4_PCE_MASK) == 0 ) &&

total: 1 errors, 0 warnings, 9 lines checked

Patch 29/29 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/20210226080526.651705-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] 41+ messages in thread

* Re: [PULL 27/29] vl: deprecate -writeconfig
  2021-02-26  8:05 ` [PULL 27/29] vl: deprecate -writeconfig Paolo Bonzini
@ 2021-03-01  8:00   ` Markus Armbruster
  2021-03-01 10:09     ` Paolo Bonzini
  2021-03-01 16:03   ` About '-readconfig' [Was: Re: [PULL 27/29] vl: deprecate -writeconfig] Kashyap Chamarthy
  1 sibling, 1 reply; 41+ messages in thread
From: Markus Armbruster @ 2021-03-01  8:00 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel

Paolo Bonzini <pbonzini@redhat.com> writes:

> The functionality of -writeconfig is limited and the code
> does not even try to detect cases where it prints incorrect
> syntax (for example if values have a quote in them, since
> qemu_config_parse does not support any kind of escaping)
> so remove it.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  docs/system/deprecated.rst | 7 +++++++
>  qemu-options.hx            | 7 +------
>  softmmu/vl.c               | 1 +
>  3 files changed, 9 insertions(+), 6 deletions(-)
>
> diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst
> index 2fcac7861e..561c916da2 100644
> --- a/docs/system/deprecated.rst
> +++ b/docs/system/deprecated.rst
> @@ -146,6 +146,13 @@ library enabled as a cryptography provider.
>  Neither the ``nettle`` library, or the built-in cryptography provider are
>  supported on FIPS enabled hosts.
>  
> +``-writeconfig`` (since 6.0)
> +'''''''''''''''''''''''''''''
> +
> +The ``-writeconfig`` option is not able to serialize the entire contents
> +of the QEMU command line.  It is thus considered a failed experiment
> +and deprecated, with no current replacement.
> +
>  QEMU Machine Protocol (QMP) commands
>  ------------------------------------
>  
> diff --git a/qemu-options.hx b/qemu-options.hx
> index 34be5a7a2d..252db9357c 100644
> --- a/qemu-options.hx
> +++ b/qemu-options.hx
> @@ -4335,13 +4335,8 @@ SRST
>  ERST
>  DEF("writeconfig", HAS_ARG, QEMU_OPTION_writeconfig,
>      "-writeconfig <file>\n"
> -    "                read/write config file\n", QEMU_ARCH_ALL)
> +    "                read/write config file (deprecated)\n", QEMU_ARCH_ALL)
>  SRST
> -``-writeconfig file``
> -    Write device configuration to file. The file can be either filename
> -    to save command line and device configuration into file or dash
> -    ``-``) character to print the output to stdout. This can be later
> -    used as input file for ``-readconfig`` option.
>  ERST
>  
>  DEF("no-user-config", 0, QEMU_OPTION_nouserconfig,
> diff --git a/softmmu/vl.c b/softmmu/vl.c
> index b219ce1f35..6d8393b6f7 100644
> --- a/softmmu/vl.c
> +++ b/softmmu/vl.c
> @@ -3356,6 +3356,7 @@ void qemu_init(int argc, char **argv, char **envp)
>              case QEMU_OPTION_writeconfig:
>                  {
>                      FILE *fp;
> +                    warn_report("-writeconfig is deprecated.  It will go away in QEMU 6.2 with no replacement");
>                      if (strcmp(optarg, "-") == 0) {
>                          fp = stdout;
>                      } else {

Forgot to tweak the warning to "-writeconfig is deprecated and will go
away without a replacement"?



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

* Re: [PULL 27/29] vl: deprecate -writeconfig
  2021-03-01  8:00   ` Markus Armbruster
@ 2021-03-01 10:09     ` Paolo Bonzini
  2021-03-01 13:26       ` Markus Armbruster
  0 siblings, 1 reply; 41+ messages in thread
From: Paolo Bonzini @ 2021-03-01 10:09 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: qemu-devel

On 01/03/21 09:00, Markus Armbruster wrote:
>> +                    warn_report("-writeconfig is deprecated.  It will go away in QEMU 6.2 with no replacement");
>>                       if (strcmp(optarg, "-") == 0) {
>>                           fp = stdout;
>>                       } else {
> 
> Forgot to tweak the warning to "-writeconfig is deprecated and will go
> away without a replacement"?

Didn't really forget; being pretty sure that there's no usage in the 
wild and having good reasons to remove the code, giving a firm removal 
date should encourage people to speak up sooner rather than later.

Paolo



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

* Re: [PULL 27/29] vl: deprecate -writeconfig
  2021-03-01 10:09     ` Paolo Bonzini
@ 2021-03-01 13:26       ` Markus Armbruster
  2021-03-01 13:45         ` Paolo Bonzini
  0 siblings, 1 reply; 41+ messages in thread
From: Markus Armbruster @ 2021-03-01 13:26 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel

Paolo Bonzini <pbonzini@redhat.com> writes:

> On 01/03/21 09:00, Markus Armbruster wrote:
>>> +                    warn_report("-writeconfig is deprecated.  It will go away in QEMU 6.2 with no replacement");
>>>                       if (strcmp(optarg, "-") == 0) {
>>>                           fp = stdout;
>>>                       } else {
>>
>> Forgot to tweak the warning to "-writeconfig is deprecated and will go
>> away without a replacement"?
>
> Didn't really forget; being pretty sure that there's no usage in the
> wild and having good reasons to remove the code, giving a firm removal 
> date should encourage people to speak up sooner rather than later.

Second thoughts after agreeing to change something are okay.  Keeping
them for yourself not so much, because it deprives your reviewers of a
chance to raise further points.

In this case, the point I didn't make because I wanted to reach
agreement on contents before nitpicking form: you're not using
warn_report() the way it wants to be used:

    /*
     * Print a warning message to current monitor if we have one, else to stderr.
     * Format arguments like sprintf(). The resulting message should be a
---> * single phrase, with no newline or trailing punctuation.
     * Prepend the current location and append a newline.
     */
    void warn_report(const char *fmt, ...)

Please tidy up.



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

* Re: [PULL 27/29] vl: deprecate -writeconfig
  2021-03-01 13:26       ` Markus Armbruster
@ 2021-03-01 13:45         ` Paolo Bonzini
  2021-03-01 14:54           ` Markus Armbruster
  0 siblings, 1 reply; 41+ messages in thread
From: Paolo Bonzini @ 2021-03-01 13:45 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: qemu-devel

On 01/03/21 14:26, Markus Armbruster wrote:
>> Didn't really forget; being pretty sure that there's no usage in the
>> wild and having good reasons to remove the code, giving a firm removal
>> date should encourage people to speak up sooner rather than later.
> Second thoughts after agreeing to change something are okay.  Keeping
> them for yourself not so much, because it deprives your reviewers of a
> chance to raise further points.

Sorry about that.

> In this case, the point I didn't make because I wanted to reach
> agreement on contents before nitpicking form: you're not using
> warn_report() the way it wants to be used:
> 
>      /*
>       * Print a warning message to current monitor if we have one, else to stderr.
>       * Format arguments like sprintf(). The resulting message should be a
> ---> * single phrase, with no newline or trailing punctuation.
>       * Prepend the current location and append a newline.
>       */
>      void warn_report(const char *fmt, ...)

I knew about the rules for no newline or trailing punctuation, but I 
didn't remember the other.  I can certainly respin, that said:

- the comment should say "sentence", not "phrase".  For example "a 
single phrase" is a single phrase, while "the resulting message should 
be a single phrase" is a single sentence.

- I'm not sure how to interpret the rule above.  First of all, the 
sentence mixes part that are mandatory part ("no newline", checked by 
checkpatch.pl) is mixed with the style guide ("no trailing punctuation" 
and "a single sentence").  Second, whether a single sentence is better 
often depends on the case.  For example, comparing these four:

WARNING: -writeconfig foo: -writeconfig is deprecated.  It will go away 
in QEMU 6.2 with no replacement

WARNING: -writeconfig foo: -writeconfig is deprecated and will go away 
in QEMU 6.2 with no replacement

WARNING: -writeconfig foo: -writeconfig is deprecated; it will go away 
in QEMU 6.2 with no replacement

WARNING: -writeconfig foo: -writeconfig is deprecated
WARNING: -writeconfig foo: it will go away in QEMU 6.2 with no replacement

The first one is what was in this patch.

The second does sound fine to me and it's probably what I'll use in v2, 
with or without the "in QEMU 6.2" part.  However some could consider it 
to be worse style due to the longer sentence.

The third one is playing with the rules; a semicolon would be separating 
two sentences.  However usage of the semicolon is quite common in error 
messages, so maybe it would be good too?

The last one also complies, but it is not clear what "it" refers to so 
it seems to be the worst in this case.  In other cases it's the obvious 
choice, and we even have an API for it (error_append_hint... however it 
doesn't play well with error_fatal which I'm otherwise a big fan of). 
In this case, not so much.

Paolo



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

* Re: [PULL 27/29] vl: deprecate -writeconfig
  2021-03-01 13:45         ` Paolo Bonzini
@ 2021-03-01 14:54           ` Markus Armbruster
  2021-03-01 15:05             ` Paolo Bonzini
  0 siblings, 1 reply; 41+ messages in thread
From: Markus Armbruster @ 2021-03-01 14:54 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel

Paolo Bonzini <pbonzini@redhat.com> writes:

> On 01/03/21 14:26, Markus Armbruster wrote:
>>> Didn't really forget; being pretty sure that there's no usage in the
>>> wild and having good reasons to remove the code, giving a firm removal
>>> date should encourage people to speak up sooner rather than later.
>> Second thoughts after agreeing to change something are okay.  Keeping
>> them for yourself not so much, because it deprives your reviewers of a
>> chance to raise further points.
>
> Sorry about that.
>
>> In this case, the point I didn't make because I wanted to reach
>> agreement on contents before nitpicking form: you're not using
>> warn_report() the way it wants to be used:
>> 
>>      /*
>>       * Print a warning message to current monitor if we have one, else to stderr.
>>       * Format arguments like sprintf(). The resulting message should be a
>> ---> * single phrase, with no newline or trailing punctuation.
>>       * Prepend the current location and append a newline.
>>       */
>>      void warn_report(const char *fmt, ...)
>
> I knew about the rules for no newline or trailing punctuation, but I 
> didn't remember the other.  I can certainly respin, that said:
>
> - the comment should say "sentence", not "phrase".  For example "a 
> single phrase" is a single phrase, while "the resulting message should 
> be a single phrase" is a single sentence.

I avoided "sentence", because good error messages aren't always
grammatically complete sentences.  My use of "phrase" may well be wrong.
I tried!  Patches welcome :)

Dicking around on the web, I just found

    https://www.postgres-xl.org/documentation/error-style-guide.html

Drop the Postgres-specific parts, and what's left is pretty close to my
thoughts on error message style.

> - I'm not sure how to interpret the rule above.  First of all, the 
> sentence mixes part that are mandatory part ("no newline", checked by 
> checkpatch.pl) is mixed with the style guide ("no trailing punctuation" 
> and "a single sentence").  Second, whether a single sentence is better 
> often depends on the case.  For example, comparing these four:
>
> WARNING: -writeconfig foo: -writeconfig is deprecated.  It will go away 
> in QEMU 6.2 with no replacement
>
> WARNING: -writeconfig foo: -writeconfig is deprecated and will go away 
> in QEMU 6.2 with no replacement
>
> WARNING: -writeconfig foo: -writeconfig is deprecated; it will go away 
> in QEMU 6.2 with no replacement
>
> WARNING: -writeconfig foo: -writeconfig is deprecated
> WARNING: -writeconfig foo: it will go away in QEMU 6.2 with no replacement
>
> The first one is what was in this patch.
>
> The second does sound fine to me and it's probably what I'll use in v2, 
> with or without the "in QEMU 6.2" part.  However some could consider it 
> to be worse style due to the longer sentence.
>
> The third one is playing with the rules; a semicolon would be separating 
> two sentences.  However usage of the semicolon is quite common in error 
> messages, so maybe it would be good too?

Semicolons can be okay, as long the resulting message is still short.

Still short:

    warning: -writeconfig foo: -writeconfig is deprecated without replacement

    warning: -writeconfig foo: option is deprecated; there is no replacement

No longer short:

    warning: -writeconfig foo: -writeconfig is deprecated; it will go away in QEMU 6.2 with no replacement

There is no need to squeeze all the information into the "primary" error
message!  That one should state what's wrong *concisely*.  If you feel
you should explain further, or would like to advise on what could be
done to fix the problem, a separate "hint" message often reads better
than overloading the primary message with information.

When reporting to the user, use error_report() / warn_report() for the
"primary", and error_printf() for the "hint".

When setting an Error, use error_setg() for the "primary", and
error_append_hint() for the "hint".  error_report_err() will then use
error_report() and error_printf() correctly.

> The last one also complies, but it is not clear what "it" refers to so 
> it seems to be the worst in this case.  In other cases it's the obvious 
> choice, and we even have an API for it (error_append_hint... however it 
> doesn't play well with error_fatal which I'm otherwise a big fan of). 
> In this case, not so much.

Use of error_append_hint() requires ERRP_GUARD().  Without ERRP_GUARD(),
the hint indeed gets lost when errp == &error_fatal.

Properly guarded, we could have something like

    warning: -writeconfig foo: option -writeconfig is deprecated
    This option will go away with no replacement.

I'm glad you like &error_fatal, too!  I have had to defend it a few
times :)



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

* Re: [PULL 27/29] vl: deprecate -writeconfig
  2021-03-01 14:54           ` Markus Armbruster
@ 2021-03-01 15:05             ` Paolo Bonzini
  0 siblings, 0 replies; 41+ messages in thread
From: Paolo Bonzini @ 2021-03-01 15:05 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: qemu-devel

On 01/03/21 15:54, Markus Armbruster wrote:
>      warning: -writeconfig foo: -writeconfig is deprecated without replacement
> 
>      warning: -writeconfig foo: option is deprecated; there is no replacement

Hmm I don't know.  I like the brevity, but I find it to be less 
user-friendly.  And the "it" and "this option" sound wrong on a separate 
line.  Maybe it's just me.

Paolo

> 
> Properly guarded, we could have something like
> 
>     warning: -writeconfig foo: option -writeconfig is deprecated
>     This option will go away with no replacement.
> 
> I'm glad you like &error_fatal, too!  I have had to defend it a few
> times 



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

* About '-readconfig' [Was: Re: [PULL 27/29] vl: deprecate -writeconfig]
  2021-02-26  8:05 ` [PULL 27/29] vl: deprecate -writeconfig Paolo Bonzini
  2021-03-01  8:00   ` Markus Armbruster
@ 2021-03-01 16:03   ` Kashyap Chamarthy
  2021-03-01 16:24     ` Paolo Bonzini
  1 sibling, 1 reply; 41+ messages in thread
From: Kashyap Chamarthy @ 2021-03-01 16:03 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel

On Fri, Feb 26, 2021 at 09:05:24AM +0100, Paolo Bonzini wrote:
> The functionality of -writeconfig is limited and the code
> does not even try to detect cases where it prints incorrect
> syntax (for example if values have a quote in them, since
> qemu_config_parse does not support any kind of escaping)
> so remove it.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  docs/system/deprecated.rst | 7 +++++++
>  qemu-options.hx            | 7 +------
>  softmmu/vl.c               | 1 +
>  3 files changed, 9 insertions(+), 6 deletions(-)

[...]

Hi,

Sorry, I'm coming very late[1] to the discussion.  Will there be a
replacement for '-readconfig'?

I agree with Gerd's comment[2] in the last year's thread (I missed to
notice at that time) about '-readconfig' being useful.  I'm familiar
with least one hosting provider who uses[3] '-readconfig'.  And I've
also used it for small snippets myself.  I understand, these simple
use-cases doesn't make it right to keep it. :-)

I'm not saying "don't deprecate '-readconfig'", but just noting its
usefulness, even in its current form.  So I'm just curious if there's
be a suggested replacement.  Even if it means: "use libvirt; or use your
own bespoke scripts".

[1] https://lists.nongnu.org/archive/html/qemu-devel/2020-05/msg03681.html
    "proposal: deprecate -readconfig/-writeconfig"
[2] https://lists.nongnu.org/archive/html/qemu-devel/2020-05/msg03681.html
[3] https://github.com/flyingcircusio/fc.qemu/blob/f789e57f605969a0/src/fc/qemu/agent.py#L1153

-- 
/kashyap



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

* Re: About '-readconfig' [Was: Re: [PULL 27/29] vl: deprecate -writeconfig]
  2021-03-01 16:03   ` About '-readconfig' [Was: Re: [PULL 27/29] vl: deprecate -writeconfig] Kashyap Chamarthy
@ 2021-03-01 16:24     ` Paolo Bonzini
  2021-03-02 15:36       ` Kashyap Chamarthy
  0 siblings, 1 reply; 41+ messages in thread
From: Paolo Bonzini @ 2021-03-01 16:24 UTC (permalink / raw)
  To: Kashyap Chamarthy; +Cc: qemu-devel

On 01/03/21 17:03, Kashyap Chamarthy wrote:
> On Fri, Feb 26, 2021 at 09:05:24AM +0100, Paolo Bonzini wrote:
>> The functionality of -writeconfig is limited and the code
>> does not even try to detect cases where it prints incorrect
>> syntax (for example if values have a quote in them, since
>> qemu_config_parse does not support any kind of escaping)
>> so remove it.
>>
>> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
>> ---
>>   docs/system/deprecated.rst | 7 +++++++
>>   qemu-options.hx            | 7 +------
>>   softmmu/vl.c               | 1 +
>>   3 files changed, 9 insertions(+), 6 deletions(-)
> 
> [...]
> 
> Hi,
> 
> Sorry, I'm coming very late[1] to the discussion.  Will there be a
> replacement for '-readconfig'?

-readconfig is not being deprecated, there will be some code new to 
integrate it with the changes I'm planning to option parsing.

Paolo

> I agree with Gerd's comment[2] in the last year's thread (I missed to
> notice at that time) about '-readconfig' being useful.  I'm familiar
> with least one hosting provider who uses[3] '-readconfig'.  And I've
> also used it for small snippets myself.  I understand, these simple
> use-cases doesn't make it right to keep it. :-)
> 
> I'm not saying "don't deprecate '-readconfig'", but just noting its
> usefulness, even in its current form.  So I'm just curious if there's
> be a suggested replacement.  Even if it means: "use libvirt; or use your
> own bespoke scripts".
> 
> [1] https://lists.nongnu.org/archive/html/qemu-devel/2020-05/msg03681.html
>      "proposal: deprecate -readconfig/-writeconfig"
> [2] https://lists.nongnu.org/archive/html/qemu-devel/2020-05/msg03681.html
> [3] https://github.com/flyingcircusio/fc.qemu/blob/f789e57f605969a0/src/fc/qemu/agent.py#L1153
> 



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

* Re: About '-readconfig' [Was: Re: [PULL 27/29] vl: deprecate -writeconfig]
  2021-03-01 16:24     ` Paolo Bonzini
@ 2021-03-02 15:36       ` Kashyap Chamarthy
  0 siblings, 0 replies; 41+ messages in thread
From: Kashyap Chamarthy @ 2021-03-02 15:36 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel

On Mon, Mar 01, 2021 at 05:24:10PM +0100, Paolo Bonzini wrote:
> On 01/03/21 17:03, Kashyap Chamarthy wrote:
> > On Fri, Feb 26, 2021 at 09:05:24AM +0100, Paolo Bonzini wrote:
> > > The functionality of -writeconfig is limited and the code
> > > does not even try to detect cases where it prints incorrect
> > > syntax (for example if values have a quote in them, since
> > > qemu_config_parse does not support any kind of escaping)
> > > so remove it.
> > > 
> > > Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> > > ---
> > >   docs/system/deprecated.rst | 7 +++++++
> > >   qemu-options.hx            | 7 +------
> > >   softmmu/vl.c               | 1 +
> > >   3 files changed, 9 insertions(+), 6 deletions(-)
> > 
> > [...]
> > 
> > Hi,
> > 
> > Sorry, I'm coming very late[1] to the discussion.  Will there be a
> > replacement for '-readconfig'?
> 
> -readconfig is not being deprecated, there will be some code new to
> integrate it with the changes I'm planning to option parsing.

I see; thanks for the clarification.  (I wasn't quite sure from the
2020 discussion thread.)

[...]

-- 
/kashyap



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

* Re: [PULL 00/29] Misc patches for 2021-02-25
  2021-02-26  8:04 [PULL 00/29] Misc patches for 2021-02-25 Paolo Bonzini
                   ` (29 preceding siblings ...)
  2021-02-26  8:51 ` [PULL 00/29] Misc patches for 2021-02-25 no-reply
@ 2021-03-03 16:54 ` Peter Maydell
  30 siblings, 0 replies; 41+ messages in thread
From: Peter Maydell @ 2021-03-03 16:54 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: QEMU Developers

On Fri, 26 Feb 2021 at 08:09, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> The following changes since commit 00d8ba9e0d62ea1c7459c25aeabf9c8bb7659462:
>
>   Merge remote-tracking branch 'remotes/philmd-gitlab/tags/mips-20210221' into staging (2021-02-21 19:52:58 +0000)
>
> are available in the Git repository at:
>
>   https://gitlab.com/bonzini/qemu.git tags/for-upstream
>
> for you to fetch changes up to b7ea7d82903f125e393b7957d1add25cf6b522dd:
>
>   tcg/i386: rdpmc: fix the the condtions (2021-02-25 14:49:01 +0100)
>
> ----------------------------------------------------------------
> * fix --enable-fuzzing linker failures (Alexander)
> * target/i386: Add bus lock debug exception support (Chenyi)
> * update documentation for preferred boolean option syntax (Daniel)
> * make SCSI io_timeout configurable (Hannes)
> * fix handling of guest recoverable SCSI errors (myself)
> * misc fixes (Pavel, Zheng Zhan Liang, Zihao)
> * fix installation of binaries with entitlements (Akihiko)


Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/6.0
for any user-visible changes.

-- PMM


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

end of thread, other threads:[~2021-03-03 16:57 UTC | newest]

Thread overview: 41+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-26  8:04 [PULL 00/29] Misc patches for 2021-02-25 Paolo Bonzini
2021-02-26  8:04 ` [PULL 01/29] hvf: Sign the code after installation Paolo Bonzini
2021-02-26  8:04 ` [PULL 02/29] configure: fix --enable-fuzzing linker failures Paolo Bonzini
2021-02-26  8:05 ` [PULL 03/29] multiprocess: move feature to meson_options.txt Paolo Bonzini
2021-02-26  8:05 ` [PULL 04/29] scsi: make io_timeout configurable Paolo Bonzini
2021-02-26  8:05 ` [PULL 05/29] scsi: add tracing for SG_IO commands Paolo Bonzini
2021-02-26  8:05 ` [PULL 06/29] scsi: allow user to set werror as report Paolo Bonzini
2021-02-26  8:05 ` [PULL 07/29] virtio-scsi: don't process IO on fenced dataplane Paolo Bonzini
2021-02-26  8:05 ` [PULL 08/29] scsi-disk: move scsi_handle_rw_error earlier Paolo Bonzini
2021-02-26  8:05 ` [PULL 09/29] scsi-disk: do not complete requests early for rerror/werror=ignore Paolo Bonzini
2021-02-26  8:05 ` [PULL 10/29] scsi: introduce scsi_sense_from_errno() Paolo Bonzini
2021-02-26  8:05 ` [PULL 11/29] scsi-disk: pass SCSI status to scsi_handle_rw_error Paolo Bonzini
2021-02-26  8:05 ` [PULL 12/29] scsi-disk: pass guest recoverable errors through even for rerror=stop Paolo Bonzini
2021-02-26  8:05 ` [PULL 13/29] scsi: drop 'result' argument from command_complete callback Paolo Bonzini
2021-02-26  8:05 ` [PULL 14/29] char: don't fail when client is not connected Paolo Bonzini
2021-02-26  8:05 ` [PULL 15/29] gdbstub: use preferred boolean option syntax Paolo Bonzini
2021-02-26  8:05 ` [PULL 16/29] qemu-options: update to show preferred boolean syntax for -chardev Paolo Bonzini
2021-02-26  8:05 ` [PULL 17/29] qemu-options: update to show preferred boolean syntax for -spice Paolo Bonzini
2021-02-26  8:05 ` [PULL 18/29] qemu-options: update to show preferred boolean syntax for -netdev Paolo Bonzini
2021-02-26  8:05 ` [PULL 19/29] qemu-options: update to show preferred boolean syntax for -incoming Paolo Bonzini
2021-02-26  8:05 ` [PULL 20/29] qemu-options: update to show preferred boolean syntax for -vnc Paolo Bonzini
2021-02-26  8:05 ` [PULL 21/29] docs: update to show preferred boolean syntax for -chardev Paolo Bonzini
2021-02-26  8:05 ` [PULL 22/29] docs: update to show preferred boolean syntax for -vnc Paolo Bonzini
2021-02-26  8:05 ` [PULL 23/29] docs: update to show preferred boolean syntax for -cpu Paolo Bonzini
2021-02-26  8:05 ` [PULL 24/29] target/i386: " Paolo Bonzini
2021-02-26  8:05 ` [PULL 25/29] qom/object.c: Fix typo Paolo Bonzini
2021-02-26  8:05 ` [PULL 26/29] target/i386: Add bus lock debug exception support Paolo Bonzini
2021-02-26  8:05 ` [PULL 27/29] vl: deprecate -writeconfig Paolo Bonzini
2021-03-01  8:00   ` Markus Armbruster
2021-03-01 10:09     ` Paolo Bonzini
2021-03-01 13:26       ` Markus Armbruster
2021-03-01 13:45         ` Paolo Bonzini
2021-03-01 14:54           ` Markus Armbruster
2021-03-01 15:05             ` Paolo Bonzini
2021-03-01 16:03   ` About '-readconfig' [Was: Re: [PULL 27/29] vl: deprecate -writeconfig] Kashyap Chamarthy
2021-03-01 16:24     ` Paolo Bonzini
2021-03-02 15:36       ` Kashyap Chamarthy
2021-02-26  8:05 ` [PULL 28/29] chardev: do not use short form boolean options in non-QemuOpts character device descriptions Paolo Bonzini
2021-02-26  8:05 ` [PULL 29/29] tcg/i386: rdpmc: fix the the condtions Paolo Bonzini
2021-02-26  8:51 ` [PULL 00/29] Misc patches for 2021-02-25 no-reply
2021-03-03 16:54 ` Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).