qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 4c9ab1: scripts: Remove check-qerror.sh


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 4c9ab1: scripts: Remove check-qerror.sh
Date: Tue, 23 Oct 2018 11:57:49 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 4c9ab1e693c46f3db9c1e7c0e4251ba37bff5e39
      
https://github.com/qemu/qemu/commit/4c9ab1e693c46f3db9c1e7c0e4251ba37bff5e39
  Author: Alberto Garcia <address@hidden>
  Date:   2018-10-19 (Fri, 19 Oct 2018)

  Changed paths:
    M include/qapi/qmp/qerror.h
    R scripts/check-qerror.sh

  Log Message:
  -----------
  scripts: Remove check-qerror.sh

qerror.h contains leftovers from the now-defunct QError API.

There's only a handful of string macros left, and no one is supposed
to add anything else. The check-qerror.sh script was used to make sure
that all definitions on the qerror.c and qerror.h files were sorted
alphabetically. The former was removed three years ago, and the latter
is now in a different location, so the script doesn't even work (as
a matter of fact the alphabetical order was broken last time someone
added a macro -also in 2015- and no one seemed to notice).

There's no point in fixing this script so let's just remove it.
The rogue macro is also moved to its correct location.

Signed-off-by: Alberto Garcia <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: d7ecf712382486ef0d79fe335f5abb333b44d279
      
https://github.com/qemu/qemu/commit/d7ecf712382486ef0d79fe335f5abb333b44d279
  Author: Philippe Mathieu-Daudé <address@hidden>
  Date:   2018-10-19 (Fri, 19 Oct 2018)

  Changed paths:
    M vl.c

  Log Message:
  -----------
  vl: Print error when using incorrect backend for debugcon

When using an incorrect backend for the debugcon, QEMU exits silently
without any error indication, which is confusing.
Add a message that the character backend is invalid.

Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Marc-André Lureau <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: 4b5766488fd3549dc47a75331cf4db62f477536c
      
https://github.com/qemu/qemu/commit/4b5766488fd3549dc47a75331cf4db62f477536c
  Author: Markus Armbruster <address@hidden>
  Date:   2018-10-19 (Fri, 19 Oct 2018)

  Changed paths:
    M block.c
    M block/qcow2.c
    M block/qed.c
    M hw/9pfs/9p-local.c
    M hw/intc/xics.c
    M hw/ppc/pnv_core.c
    M hw/ppc/spapr_pci.c
    M hw/timer/aspeed_timer.c
    M hw/usb/bus.c
    M hw/vfio/pci.c
    M include/qapi/error.h
    M migration/migration.c
    M util/error.c

  Log Message:
  -----------
  error: Fix use of error_prepend() with &error_fatal, &error_abort

>From include/qapi/error.h:

  * Pass an existing error to the caller with the message modified:
  *     error_propagate(errp, err);
  *     error_prepend(errp, "Could not frobnicate '%s': ", name);

Fei Li pointed out that doing error_propagate() first doesn't work
well when @errp is &error_fatal or &error_abort: the error_prepend()
is never reached.

Since I doubt fixing the documentation will stop people from getting
it wrong, introduce error_propagate_prepend(), in the hope that it
lures people away from using its constituents in the wrong order.
Update the instructions in error.h accordingly.

Convert existing error_prepend() next to error_propagate to
error_propagate_prepend().  If any of these get reached with
&error_fatal or &error_abort, the error messages improve.  I didn't
check whether that's the case anywhere.

Cc: Fei Li <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-Id: <address@hidden>


  Commit: 50beeb680949117017343e593dd7323632a6d872
      
https://github.com/qemu/qemu/commit/50beeb680949117017343e593dd7323632a6d872
  Author: Markus Armbruster <address@hidden>
  Date:   2018-10-19 (Fri, 19 Oct 2018)

  Changed paths:
    M hw/intc/xics_kvm.c
    M qemu-nbd.c
    A scripts/coccinelle/use-error_fatal.cocci
    M vl.c

  Log Message:
  -----------
  Use error_fatal to simplify obvious fatal errors (again)

Add a slight improvement of the Coccinelle semantic patch from commit
007b06578ab, and use it to clean up.  It leaves dead Error * variables
behind, cleaned up manually.

Cc: David Gibson <address@hidden>
Cc: Alexander Graf <address@hidden>
Cc: Eric Blake <address@hidden>
Cc: Paolo Bonzini <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Acked-by: David Gibson <address@hidden>
Message-Id: <address@hidden>


  Commit: 5197f44584114c40cc5df92e508c2c458d6683ab
      
https://github.com/qemu/qemu/commit/5197f44584114c40cc5df92e508c2c458d6683ab
  Author: Markus Armbruster <address@hidden>
  Date:   2018-10-19 (Fri, 19 Oct 2018)

  Changed paths:
    M block/iscsi.c
    M block/rbd.c
    M block/sheepdog.c

  Log Message:
  -----------
  block: Use warn_report() & friends to report warnings

Calling error_report() in a function that takes an Error ** argument
is suspicious.  Convert a few that are actually warnings to
warn_report().

While there, split warnings consisting of multiple sentences to
conform to conventions spelled out in warn_report()'s contract, and
improve a rather useless warning in sheepdog.c.

Cc: Kevin Wolf <address@hidden>
Cc: Ronnie Sahlberg <address@hidden>
Cc: Paolo Bonzini <address@hidden>
Cc: Peter Lieven <address@hidden>
Cc: Liu Yuan <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-Id: <address@hidden>

Drop changes to "without an explicit read-only=on" warnings, because
there's a series removing them pending.  Also drop a cc: to a former
Sheepdog maintainer.

Reviewed-by: Kevin Wolf <address@hidden>


  Commit: 0765691e9744ed966d40a104f9808924578f2e3b
      
https://github.com/qemu/qemu/commit/0765691e9744ed966d40a104f9808924578f2e3b
  Author: Markus Armbruster <address@hidden>
  Date:   2018-10-19 (Fri, 19 Oct 2018)

  Changed paths:
    M cpus.c
    M hw/display/cg3.c
    M hw/display/tcx.c
    M hw/misc/ivshmem.c
    M hw/net/virtio-net.c
    M hw/virtio/virtio-pci.c
    M target/i386/cpu.c
    M target/ppc/translate_init.inc.c

  Log Message:
  -----------
  cpus hw target: Use warn_report() & friends to report warnings

Calling error_report() in a function that takes an Error ** argument
is suspicious.  Convert a few that are actually warnings to
warn_report().

While there, split a warning consisting of multiple sentences to
conform to conventions spelled out in warn_report()'s contract.

Cc: Alex Bennée <address@hidden>
Cc: Mark Cave-Ayland <address@hidden>
Cc: Alex Williamson <address@hidden>
Cc: Fam Zheng <address@hidden>
Cc: Wei Huang <address@hidden>
Cc: David Gibson <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
Acked-by: David Gibson <address@hidden>
Reviewed-by: Alex Bennée <address@hidden>
Message-Id: <address@hidden>


  Commit: e1eb292acec5e9806b1afc33f39629e6d0859732
      
https://github.com/qemu/qemu/commit/e1eb292acec5e9806b1afc33f39629e6d0859732
  Author: Markus Armbruster <address@hidden>
  Date:   2018-10-19 (Fri, 19 Oct 2018)

  Changed paths:
    M hw/vfio/pci.c
    M hw/vfio/platform.c
    M include/hw/vfio/vfio-common.h

  Log Message:
  -----------
  vfio: Use warn_report() & friends to report warnings

The vfio code reports warnings like

    error_report(WARN_PREFIX "Could not frobnicate", DEV-NAME);

where WARN_PREFIX is defined so the message comes out as

    vfio warning: DEV-NAME: Could not frobnicate

This usage predates the introduction of warn_report() & friends in
commit 97f40301f1d.  It's time to convert to that interface.  Since
these functions already prefix the message with "warning: ", replace
WARN_PREFIX by VFIO_MSG_PREFIX, so the messages come out like

    warning: vfio DEV-NAME: Could not frobnicate

The next commit will replace ERR_PREFIX.

Cc: Alex Williamson <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
Acked-by: Alex Williamson <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-Id: <address@hidden>


  Commit: c3b8e3e0ed40112367369683da1e3745cf203ac0
      
https://github.com/qemu/qemu/commit/c3b8e3e0ed40112367369683da1e3745cf203ac0
  Author: Markus Armbruster <address@hidden>
  Date:   2018-10-19 (Fri, 19 Oct 2018)

  Changed paths:
    M hw/vfio/pci-quirks.c
    M hw/vfio/pci.c
    M hw/vfio/platform.c
    M include/hw/vfio/vfio-common.h

  Log Message:
  -----------
  vfio: Clean up error reporting after previous commit

The previous commit changed vfio's warning messages from

    vfio warning: DEV-NAME: Could not frobnicate

to

    warning: vfio DEV-NAME: Could not frobnicate

To match this change, change error messages from

    vfio error: DEV-NAME: On fire

to

    vfio DEV-NAME: On fire

Note the loss of "error".  If we think marking error messages that way
is a good idea, we should mark *all* error messages, i.e. make
error_report() print it.

Cc: Alex Williamson <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
Acked-by: Alex Williamson <address@hidden>
Message-Id: <address@hidden>


  Commit: b1b769b0f3fd672886ade16da07b540acafeb1cc
      
https://github.com/qemu/qemu/commit/b1b769b0f3fd672886ade16da07b540acafeb1cc
  Author: Markus Armbruster <address@hidden>
  Date:   2018-10-19 (Fri, 19 Oct 2018)

  Changed paths:
    M chardev/char-pty.c
    M chardev/char.c

  Log Message:
  -----------
  char: Use error_printf() to print help and such

Calling error_report() in a function that takes an Error ** argument
is suspicious.  Convert a few that are actually help and such to
error_printf().

Improves output of -chardev help from

    qemu-system-x86_64: -chardev help: Available chardev backend types:
    serial
    ...

to

    Available chardev backend types:
    serial
    ...

Cc: Paolo Bonzini <address@hidden>
Cc: "Marc-André Lureau" <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Message-Id: <address@hidden>


  Commit: 1245402e3c9be20200dcc469805f4156d93381e2
      
https://github.com/qemu/qemu/commit/1245402e3c9be20200dcc469805f4156d93381e2
  Author: Markus Armbruster <address@hidden>
  Date:   2018-10-19 (Fri, 19 Oct 2018)

  Changed paths:
    M hw/9pfs/9p-handle.c

  Log Message:
  -----------
  9pfs: Fix CLI parsing crash on error

Calling error_report() in a function that takes an Error ** argument
is suspicious.  9p-handle.c's handle_parse_opts() does that, and then
fails without setting an error.  Wrong.  Its caller crashes when it
tries to report the error:

    $ qemu-system-x86_64 -nodefaults -fsdev id=foo,fsdriver=handle
    qemu-system-x86_64: -fsdev id=foo,fsdriver=handle: warning: handle backend 
is deprecated
    qemu-system-x86_64: -fsdev id=foo,fsdriver=handle: fsdev: No path specified
    Segmentation fault (core dumped)

Screwed up when commit 91cda4e8f37 (v2.12.0) converted the function to
Error.  Fix by calling error_setg() instead of error_report().

Fixes: 91cda4e8f372602795e3a2f4bd2e3adaf9f82255
Cc: Greg Kurz <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
Acked-by: Greg Kurz <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-Id: <address@hidden>


  Commit: d319e05d6f24350272e7f600a43d0c0091924512
      
https://github.com/qemu/qemu/commit/d319e05d6f24350272e7f600a43d0c0091924512
  Author: Markus Armbruster <address@hidden>
  Date:   2018-10-19 (Fri, 19 Oct 2018)

  Changed paths:
    M hw/i386/pc.c

  Log Message:
  -----------
  pc: Fix machine property nvdimm-persistence error handling

Calling error_report() in a function that takes an Error ** argument
is suspicious.  pc.c's pc_machine_set_nvdimm_persistence() does that,
and then exit()s.  Wrong.  Attempting to set machine property
nvdimm-persistence to a bad value instantly kills the VM:

    $ qemu-system-x86_64 -nodefaults -S -display none -qmp stdio
    {"QMP": {"version": {"qemu": {"micro": 50, "minor": 0, "major": 3}, 
"package": "v3.0.0-837-gc5e4e49258"}, "capabilities": []}}
    {"execute": "qmp_capabilities"}
    {"return": {}}
    {"execute": "qom-set", "arguments": {"path": "/machine", "property": 
"nvdimm-persistence", "value": "instadeath"}}
    -machine nvdimm-persistence=instadeath: unsupported option
    $ echo $?
    1

Broken when commit 11c39b5cd96 (v3.0.0) replaced error_propagate();
return by error_report(); exit() instead of error_setg(); return.  Fix
that.

Fixes: 11c39b5cd966ddc067a1ca0c5392ec9b666c45b7
Cc: "Michael S. Tsirkin" <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Marc-André Lureau <address@hidden>
Message-Id: <address@hidden>


  Commit: 11ab69d6e7a81c35f109a399a39d56e777f41d8a
      
https://github.com/qemu/qemu/commit/11ab69d6e7a81c35f109a399a39d56e777f41d8a
  Author: Markus Armbruster <address@hidden>
  Date:   2018-10-19 (Fri, 19 Oct 2018)

  Changed paths:
    M hw/intc/ioapic.c

  Log Message:
  -----------
  ioapic: Fix error handling in realize()

Calling error_report() in a function that takes an Error ** argument
is suspicious.  ioapic_realize() does that, and then exit()s.
Currently mostly harmless, as the device cannot be hot-plugged.

Fixes: 20fd4b7b6d9282fe0cb83601f1821f31bd257458
Cc: Peter Xu <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Peter Xu <address@hidden>
Reviewed-by: Marc-André Lureau <address@hidden>
Message-Id: <address@hidden>


  Commit: 1028283c60e6e35911bb80b959a533b4af1b8b65
      
https://github.com/qemu/qemu/commit/1028283c60e6e35911bb80b959a533b4af1b8b65
  Author: Markus Armbruster <address@hidden>
  Date:   2018-10-19 (Fri, 19 Oct 2018)

  Changed paths:
    M hw/smbios/smbios.c

  Log Message:
  -----------
  smbios: Clean up error handling in smbios_add()

Calling error_report() in a function that takes an Error ** argument
is suspicious.  smbios_entry_add() does that, and then exit()s.  It
also passes &error_fatal to qemu_opts_validate().  Both wrong, but
currently harmless, as its only caller passes &error_fatal.  Messed up
in commit 1007a37e208.  Clean it up.

Cc: Paolo Bonzini <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Marc-André Lureau <address@hidden>
Acked-by: Paolo Bonzini <address@hidden>
Message-Id: <address@hidden>


  Commit: 4dd32b3dda3ebc3ac9dd6b951a40a3e4f2f0fd47
      
https://github.com/qemu/qemu/commit/4dd32b3dda3ebc3ac9dd6b951a40a3e4f2f0fd47
  Author: Markus Armbruster <address@hidden>
  Date:   2018-10-19 (Fri, 19 Oct 2018)

  Changed paths:
    M migration/savevm.c

  Log Message:
  -----------
  migration: Fix !replay_can_snapshot() error handling

Calling error_report() in a function that takes an Error ** argument
is suspicious.  save_snapshot() and load_snapshot() do that, and then
fail without setting an error.  Wrong.  The HMP commands survive this
unscathed, since hmp_handle_error() does nothing when no error has
been set.  Callers main() (on behalf of -loadvm) and
replay_vmstate_init() crash, but I'm not sure the error is possible
there.

Screwed up when commit 377b21ccea1 (v2.12.0) added incorrect error
handling right next to correct examples.  Fix by calling error_setg()
instead of error_report().

Fixes: 377b21ccea1755a8b0dae822c29567c58dda6939
Cc: Paolo Bonzini <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Marc-André Lureau <address@hidden>
Message-Id: <address@hidden>


  Commit: 007e5f8782673d8e476398baaa5b4813741e970b
      
https://github.com/qemu/qemu/commit/007e5f8782673d8e476398baaa5b4813741e970b
  Author: Markus Armbruster <address@hidden>
  Date:   2018-10-19 (Fri, 19 Oct 2018)

  Changed paths:
    M net/l2tpv3.c

  Log Message:
  -----------
  l2tpv3: Improve -netdev/netdev_add/-net/... error reporting

When -netdev l2tpv3 fails, it first reports a specific error, then a
generic one, like this:

    $ qemu-system-x86_64 -netdev l2tpv3,id=foo,src=,dst=,txsession=1
    qemu-system-x86_64: -netdev l2tpv3,id=foo,src=,dst=,txsession=1: 
l2tpv3_open : could not resolve src, errno = Name or service not known
    qemu-system-x86_64: Device 'l2tpv3' could not be initialized

With the command line, the messages go to stderr.  In HMP, they go to
the monitor.  In QMP, the second one becomes the error reply, and the
first one goes to stderr.

Convert net_init_tap() to Error.  This suppresses the unwanted second
message, and makes the specific error the QMP error reply.

Cc: Jason Wang <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Marc-André Lureau <address@hidden>
Message-Id: <address@hidden>


  Commit: 8c42dbe3956ac3eb8b1db18b941867936ce54b08
      
https://github.com/qemu/qemu/commit/8c42dbe3956ac3eb8b1db18b941867936ce54b08
  Author: Markus Armbruster <address@hidden>
  Date:   2018-10-19 (Fri, 19 Oct 2018)

  Changed paths:
    M net/socket.c

  Log Message:
  -----------
  net/socket: Fix invalid socket type error handling

Calling error_report() in a function that takes an Error ** argument
is suspicious.  net_socket_fd_init() does that, and then fails without
setting an error.  Wrong.  I didn't analyze how exactly this can
break.  A caller that reports the error on failure would crash.

Broken when commit c37f0bb1d0d (v2.11.0) converted the function to
Error.  Fix by calling error_setg() instead of error_report().

Fixes: c37f0bb1d0d24e3a6b5f4659bb305913dcb798a6
Cc: Jason Wang <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Marc-André Lureau <address@hidden>
Message-Id: <address@hidden>


  Commit: a22528b918c7d29795129b5a64c4cb44bb57a44d
      
https://github.com/qemu/qemu/commit/a22528b918c7d29795129b5a64c4cb44bb57a44d
  Author: Markus Armbruster <address@hidden>
  Date:   2018-10-19 (Fri, 19 Oct 2018)

  Changed paths:
    M numa.c

  Log Message:
  -----------
  numa: Fix QMP command set-numa-node error handling

Calling error_report() in a function that takes an Error ** argument
is suspicious.  parse_numa_node() does that, and then exit()s.  It
also passes &error_fatal to machine_set_cpu_numa_node().  Both wrong.
Attempting to configure numa when the machine doesn't support it kills
the VM:

    $ qemu-system-x86_64 -nodefaults -S -display none -M none -preconfig -qmp 
stdio
    {"QMP": {"version": {"qemu": {"micro": 50, "minor": 0, "major": 3}, 
"package": "v3.0.0-837-gc5e4e49258"}, "capabilities": []}}
    {"execute": "qmp_capabilities"}
    {"return": {}}
    {"execute": "set-numa-node", "arguments": {"type": "node"}}
    NUMA is not supported by this machine-type
    $ echo $?
    1

Messed up when commit 64c2a8f6d3f and 7c88e65d9e9 (v2.10.0) added
incorrect error handling right next to correct examples.  Latent bug
until commit f3be67812c2 (v3.0.0) made it accessible via QMP.  Fairly
harmless in practice, because it's limited to RUN_STATE_PRECONFIG.
The fix is obvious: replace error_report(); exit() by error_setg();
return.

This affects parse_numa_node()'s other caller
numa_complete_configuration(): since it ignores errors, the "NUMA is
not supported by this machine-type" is now ignored, too.  But that
error is as unexpected there as any other.  Change it to abort on
error instead.

Fixes: f3be67812c226162f86ce92634bd913714445420
Cc: Igor Mammedov <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Igor Mammedov <address@hidden>
Message-Id: <address@hidden>


  Commit: fff4c9c32595e71bca3d1a89beb0781a5be2201b
      
https://github.com/qemu/qemu/commit/fff4c9c32595e71bca3d1a89beb0781a5be2201b
  Author: Markus Armbruster <address@hidden>
  Date:   2018-10-19 (Fri, 19 Oct 2018)

  Changed paths:
    M hw/xen/xen_pt.c

  Log Message:
  -----------
  xen/pt: Fix incomplete conversion to realize()

The conversion of "xen-pci-passthrough" to realize() (commit
5a11d0f7549, v2.6.0) neglected to convert the xen_pt_config_init()
error path.  If xen_pt_config_init() fails, xen_pt_realize() reports
the error, then returns success without completing its job.  I don't
know the exact impact, but it can't be good.

Belatedly convert the error path.

Fixes: 5a11d0f7549e24a10e178a9dc8ff5e698031d9a6
Cc: Stefano Stabellini <address@hidden>
Cc: Anthony Perard <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
Acked-by: Anthony PERARD <address@hidden>
Message-Id: <address@hidden>


  Commit: 6548459769e5e8b8d23a90ce0adffd067b240059
      
https://github.com/qemu/qemu/commit/6548459769e5e8b8d23a90ce0adffd067b240059
  Author: Markus Armbruster <address@hidden>
  Date:   2018-10-19 (Fri, 19 Oct 2018)

  Changed paths:
    M qemu-seccomp.c
    M vl.c

  Log Message:
  -----------
  seccomp: Clean up error reporting in parse_sandbox()

Calling error_report() in a function that takes an Error ** argument
is suspicious.  parse_sandbox() does that, and then fails without
setting an error.  Its caller main(), via qemu_opts_foreach(), is fine
with it, but clean it up anyway.

Cc: Eduardo Otubo <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Marc-André Lureau <address@hidden>
Acked-by: Eduardo Otubo <address@hidden>
Message-Id: <address@hidden>


  Commit: 6353218b8c54dc6be6abb01c07a087add07ee5ce
      
https://github.com/qemu/qemu/commit/6353218b8c54dc6be6abb01c07a087add07ee5ce
  Author: Markus Armbruster <address@hidden>
  Date:   2018-10-19 (Fri, 19 Oct 2018)

  Changed paths:
    M vl.c

  Log Message:
  -----------
  vl: Clean up error reporting in parse_add_fd()

Calling error_report() in a function that takes an Error ** argument
is suspicious.  parse_add_fd() does that, and then fails without
setting an error.  Its caller main(), via qemu_opts_foreach(), is fine
with it, but clean it up anyway.

Also change call of cleanup_add_fd(), which can't fail, for symmetry.

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Marc-André Lureau <address@hidden>
Message-Id: <address@hidden>


  Commit: 7e1e0c11127bde81cff260fc6859690435c509d6
      
https://github.com/qemu/qemu/commit/7e1e0c11127bde81cff260fc6859690435c509d6
  Author: Markus Armbruster <address@hidden>
  Date:   2018-10-19 (Fri, 19 Oct 2018)

  Changed paths:
    M qemu-io.c
    M qemu-nbd.c
    M qom/object_interfaces.c
    M vl.c

  Log Message:
  -----------
  qom: Clean up error reporting in user_creatable_add_opts_foreach()

Calling error_report() in a function that takes an Error ** argument
is suspicious.  user_creatable_add_opts_foreach() does that, and then
fails without setting an error.  Its caller main(), via
qemu_opts_foreach(), is fine with it, but clean it up anyway.

Cc: Daniel P. Berrangé <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Marc-André Lureau <address@hidden>
Message-Id: <address@hidden>


  Commit: dd4af97733401e200c39184ecca4c8eabb222637
      
https://github.com/qemu/qemu/commit/dd4af97733401e200c39184ecca4c8eabb222637
  Author: Markus Armbruster <address@hidden>
  Date:   2018-10-19 (Fri, 19 Oct 2018)

  Changed paths:
    M vl.c

  Log Message:
  -----------
  vl: Clean up error reporting in chardev_init_func()

Calling error_report() in a function that takes an Error ** argument
is suspicious.  chardev_init_func() does that, and then fails without
setting an error.  Its caller main(), via qemu_opts_foreach(), is fine
with it, but clean it up anyway.

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Marc-André Lureau <address@hidden>
Message-Id: <address@hidden>


  Commit: 702832b8c0444fd3ea703ab494e9e955ce0433b1
      
https://github.com/qemu/qemu/commit/702832b8c0444fd3ea703ab494e9e955ce0433b1
  Author: Markus Armbruster <address@hidden>
  Date:   2018-10-19 (Fri, 19 Oct 2018)

  Changed paths:
    M vl.c

  Log Message:
  -----------
  vl: Clean up error reporting in machine_set_property()

Calling error_report() in a function that takes an Error ** argument
is suspicious.  machine_set_property() does that, and then fails without
setting an error.  Its caller main(), via qemu_opts_foreach(), is fine
with it, but clean it up anyway.

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Marc-André Lureau <address@hidden>
Message-Id: <address@hidden>


  Commit: 2d5a3a8b02aeed25a46b311abf9088f62ec61d66
      
https://github.com/qemu/qemu/commit/2d5a3a8b02aeed25a46b311abf9088f62ec61d66
  Author: Markus Armbruster <address@hidden>
  Date:   2018-10-19 (Fri, 19 Oct 2018)

  Changed paths:
    M vl.c

  Log Message:
  -----------
  vl: Clean up error reporting in mon_init_func()

Calling error_report() in a function that takes an Error ** argument
is suspicious.  mon_init_func() does that, and then fails without
setting an error.  Its caller main(), via qemu_opts_foreach(), is fine
with it, but clean it up anyway.

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Marc-André Lureau <address@hidden>
Message-Id: <address@hidden>


  Commit: 406b6367e19cdaf4ad948c469f82875f8af24ab2
      
https://github.com/qemu/qemu/commit/406b6367e19cdaf4ad948c469f82875f8af24ab2
  Author: Markus Armbruster <address@hidden>
  Date:   2018-10-19 (Fri, 19 Oct 2018)

  Changed paths:
    M vl.c

  Log Message:
  -----------
  vl: Clean up error reporting in parse_fw_cfg()

Calling error_report() in a function that takes an Error ** argument
is suspicious.  parse_fw_cfg() does that, and then fails without
setting an error.  Its caller main(), via qemu_opts_foreach(), is fine
with it, but clean it up anyway.

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Marc-André Lureau <address@hidden>
Message-Id: <address@hidden>


  Commit: cd65f34991f01c23c9e3e1691953b79e36a1b911
      
https://github.com/qemu/qemu/commit/cd65f34991f01c23c9e3e1691953b79e36a1b911
  Author: Markus Armbruster <address@hidden>
  Date:   2018-10-19 (Fri, 19 Oct 2018)

  Changed paths:
    M vl.c

  Log Message:
  -----------
  vl: Clean up error reporting in device_init_func()

Calling error_report() in a function that takes an Error ** argument
is suspicious.  device_init_func() does that, and then fails without
setting an error.  Its caller main(), via qemu_opts_foreach(), is fine
with it, but clean it up anyway.

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Message-Id: <address@hidden>


  Commit: f7b9e299a44343115148246b4de53fb3ac6e7b22
      
https://github.com/qemu/qemu/commit/f7b9e299a44343115148246b4de53fb3ac6e7b22
  Author: Markus Armbruster <address@hidden>
  Date:   2018-10-19 (Fri, 19 Oct 2018)

  Changed paths:
    M ui/keymaps.c

  Log Message:
  -----------
  ui/keymaps: Fix handling of erroneous include files

While errors in the keyboard layout named with -k are fatal, errors in
included files are reported, but otherwise ignored:

    $ cat worst
    include bad
    include worse
    $ ls -l bad worse
    ls: cannot access 'bad': No such file or directory
    ls: cannot access 'worse': No such file or directory
    $ qemu-system-x86_64 -nodefaults -S -monitor stdio -display vnc=:0 -k bad
    QEMU 3.0.50 monitor - type 'help' for more information
    (qemu) Could not read keymap file: 'bad'
    $ qemu-system-x86_64 -nodefaults -S -monitor stdio -display vnc=:0 -k worst
    QEMU 3.0.50 monitor - type 'help' for more information
    (qemu) Could not read keymap file: 'bad'
    Could not read keymap file: 'worse'

Fix that.

Note that parse_keyboard_layout() allocates the keymap, except when
it's parsing an include file.  To keep error handling simple, move the
memory management to its caller init_keyboard_layout().

Cc: Gerd Hoffmann <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Gerd Hoffmann <address@hidden>


  Commit: ab4f931e9f0a6e1c6dd6ecd79118efca418d941f
      
https://github.com/qemu/qemu/commit/ab4f931e9f0a6e1c6dd6ecd79118efca418d941f
  Author: Fei Li <address@hidden>
  Date:   2018-10-19 (Fri, 19 Oct 2018)

  Changed paths:
    M include/ui/console.h
    M ui/curses.c
    M ui/keymaps.c
    M ui/keymaps.h
    M ui/sdl.c
    M ui/vnc.c

  Log Message:
  -----------
  ui: Convert vnc_display_init(), init_keyboard_layout() to Error

Signed-off-by: Fei Li <address@hidden>
Cc: Gerd Hoffmann <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Gerd Hoffmann <address@hidden>


  Commit: 612aea201738cd747b02d2c2acd6e0bf406531cf
      
https://github.com/qemu/qemu/commit/612aea201738cd747b02d2c2acd6e0bf406531cf
  Author: Markus Armbruster <address@hidden>
  Date:   2018-10-19 (Fri, 19 Oct 2018)

  Changed paths:
    M ui/vnc.c
    M vl.c

  Log Message:
  -----------
  vnc: Clean up error reporting in vnc_init_func()

Calling error_report() in a function that takes an Error ** argument
is suspicious.  vnc_init_func() does that, and then fails without
setting an error.  Its caller main(), via qemu_opts_foreach(), is fine
with it, but clean it up anyway.

While there, drop a "Failed to start VNC server: " error message
prefix that doesn't really add value.

Cc: Gerd Hoffmann <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Gerd Hoffmann <address@hidden>


  Commit: 4f7ec696f4b124364c1b145dbe835984edc4c887
      
https://github.com/qemu/qemu/commit/4f7ec696f4b124364c1b145dbe835984edc4c887
  Author: Markus Armbruster <address@hidden>
  Date:   2018-10-19 (Fri, 19 Oct 2018)

  Changed paths:
    M include/sysemu/numa.h
    M numa.c

  Log Message:
  -----------
  numa: Clean up error reporting in parse_numa()

Calling error_report() in a function that takes an Error ** argument
is suspicious.  parse_numa() does that, and then fails without setting
an error.  Its caller main(), via qemu_opts_foreach(), is fine with
it, but clean it up anyway.

While there, give parse_numa() internal linkage.

Cc: Eduardo Habkost <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eduardo Habkost <address@hidden>
Message-Id: <address@hidden>


  Commit: d10e05f15d5c3dd5e5cc59c5dfff460d89d48580
      
https://github.com/qemu/qemu/commit/d10e05f15d5c3dd5e5cc59c5dfff460d89d48580
  Author: Markus Armbruster <address@hidden>
  Date:   2018-10-19 (Fri, 19 Oct 2018)

  Changed paths:
    M include/sysemu/tpm.h
    M stubs/tpm.c
    M tpm.c
    M vl.c

  Log Message:
  -----------
  tpm: Clean up error reporting in tpm_init_tpmdev()

Calling error_report() in a function that takes an Error ** argument
is suspicious.  tpm_init_tpmdev() does that, and then fails without
setting an error.  Its caller main(), via tpm_init() and
qemu_opts_foreach(), is fine with it, but clean it up anyway.

Cc: Stefan Berger <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Marc-André Lureau <address@hidden>
Reviewed-by: Stefan Berger <address@hidden>
Message-Id: <address@hidden>


  Commit: 9338570b7b0b8890269222b7b40e0b819f824dab
      
https://github.com/qemu/qemu/commit/9338570b7b0b8890269222b7b40e0b819f824dab
  Author: Markus Armbruster <address@hidden>
  Date:   2018-10-19 (Fri, 19 Oct 2018)

  Changed paths:
    M ui/spice-core.c

  Log Message:
  -----------
  spice: Clean up error reporting in add_channel()

Calling error_report() in a function that takes an Error ** argument
is suspicious.  add_channel() does that, and then exit()s.  Its caller
main(), via qemu_opts_foreach(), is fine with it, but clean it up
anyway.

Cc: Gerd Hoffmann <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Marc-André Lureau <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Gerd Hoffmann <address@hidden>


  Commit: b836723dfe642a67904bcd047feaaa0cda662d38
      
https://github.com/qemu/qemu/commit/b836723dfe642a67904bcd047feaaa0cda662d38
  Author: Markus Armbruster <address@hidden>
  Date:   2018-10-19 (Fri, 19 Oct 2018)

  Changed paths:
    M fsdev/qemu-fsdev-dummy.c
    M fsdev/qemu-fsdev.c
    M fsdev/qemu-fsdev.h
    M hw/9pfs/xen-9p-backend.c
    M vl.c

  Log Message:
  -----------
  fsdev: Clean up error reporting in qemu_fsdev_add()

Calling error_report() from within a function that takes an Error **
argument is suspicious.  qemu_fsdev_add() does that, and its caller
fsdev_init_func() then fails without setting an error.  Its caller
main(), via qemu_opts_foreach(), is fine with it, but clean it up
anyway.

Cc: Greg Kurz <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
Acked-by: Greg Kurz <address@hidden>
Message-Id: <address@hidden>


  Commit: f881ca19f1942965490a70d23566c6287c49ceac
      
https://github.com/qemu/qemu/commit/f881ca19f1942965490a70d23566c6287c49ceac
  Author: Markus Armbruster <address@hidden>
  Date:   2018-10-19 (Fri, 19 Oct 2018)

  Changed paths:
    M vl.c

  Log Message:
  -----------
  vl: Assert drive_new() does not fail in default_drive()

If creating (empty) default drives fails, it's a bug.  Therefore,
assert() is more appropriate than exit(1).

Cc: Kevin Wolf <address@hidden>
Cc: Max Reitz <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-Id: <address@hidden>


  Commit: c4f26c9f37ce511e5fe629c21c180dc6eb7c5a25
      
https://github.com/qemu/qemu/commit/c4f26c9f37ce511e5fe629c21c180dc6eb7c5a25
  Author: Markus Armbruster <address@hidden>
  Date:   2018-10-19 (Fri, 19 Oct 2018)

  Changed paths:
    M blockdev.c
    M device-hotplug.c
    M include/sysemu/blockdev.h
    M vl.c

  Log Message:
  -----------
  blockdev: Convert drive_new() to Error

Calling error_report() from within a function that takes an Error **
argument is suspicious.  drive_new() calls error_report() even though
it can run within drive_init_func(), which takes an Error ** argument.
drive_init_func()'s caller main(), via qemu_opts_foreach(), is fine
with it, but clean it up anyway:

* Convert drive_new() to Error

* Update add_init_drive() to report the error received from
  drive_new()

* Make main() pass &error_fatal through qemu_opts_foreach(),
  drive_init_func() to drive_new()

* Make default_drive() pass &error_abort through qemu_opts_foreach(),
  drive_init_func() to drive_new()

Cc: Kevin Wolf <address@hidden>
Cc: Max Reitz <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Message-Id: <address@hidden>


  Commit: 7c89fcbac865bed392bd645de3bf97f88b869318
      
https://github.com/qemu/qemu/commit/7c89fcbac865bed392bd645de3bf97f88b869318
  Author: Markus Armbruster <address@hidden>
  Date:   2018-10-19 (Fri, 19 Oct 2018)

  Changed paths:
    M vl.c

  Log Message:
  -----------
  vl: Fix exit status for -drive format=help

Signed-off-by: Markus Armbruster <address@hidden>
Message-Id: <address@hidden>


  Commit: 5343bda42ba1abe61d81ac6b7712e118a3f74280
      
https://github.com/qemu/qemu/commit/5343bda42ba1abe61d81ac6b7712e118a3f74280
  Author: Markus Armbruster <address@hidden>
  Date:   2018-10-19 (Fri, 19 Oct 2018)

  Changed paths:
    M vl.c

  Log Message:
  -----------
  vl: Simplify call of parse_name()

main() checks for parse_name() failure even though it can't actually
fail.  That's okay.  Simplify it to check by passing &error_fatal,
like the other users of qemu_opts_foreach().

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Message-Id: <address@hidden>


  Commit: da7e92cac95fd3b7f91354d2d65b5d59ea36dc13
      
https://github.com/qemu/qemu/commit/da7e92cac95fd3b7f91354d2d65b5d59ea36dc13
  Author: Markus Armbruster <address@hidden>
  Date:   2018-10-19 (Fri, 19 Oct 2018)

  Changed paths:
    M block.c
    M tests/qemu-iotests/049.out

  Log Message:
  -----------
  block: Clean up bdrv_img_create()'s error reporting

bdrv_img_create() takes an Error ** argument and uses it in the
conventional way, except for one place: when qemu_opts_do_parse()
fails, it first reports its error to stderr or the HMP monitor with
error_report_err(), then error_setg()'s a generic error.

When the caller reports that second error similarly, this produces two
consecutive error messages on stderr or the HMP monitor.

When the caller does something else with it, such as send it via QMP,
the first error still goes to stderr or the HMP monitor.  Fortunately,
no such caller exists.

Simply use the first error as is.  Update expected output of
qemu-iotest 049 accordingly.

Cc: Kevin Wolf <address@hidden>
Cc: Max Reitz <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Kevin Wolf <address@hidden>


  Commit: 04788ba2edb4dc30c934e49581a8c645937667c5
      
https://github.com/qemu/qemu/commit/04788ba2edb4dc30c934e49581a8c645937667c5
  Author: Markus Armbruster <address@hidden>
  Date:   2018-10-19 (Fri, 19 Oct 2018)

  Changed paths:
    M block/vpc.c

  Log Message:
  -----------
  vpc: Fail open on bad header checksum

vpc_open() merely prints a warning when it finds a bad header
checksum.  Turn that into a hard error.

Cc: Kevin Wolf <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
Message-Id: <address@hidden>
[Error message capitalized for local consistency]
Reviewed-by: Kevin Wolf <address@hidden>


  Commit: 80313fb53d8048882848b6f63daaeb29dc319765
      
https://github.com/qemu/qemu/commit/80313fb53d8048882848b6f63daaeb29dc319765
  Author: Markus Armbruster <address@hidden>
  Date:   2018-10-19 (Fri, 19 Oct 2018)

  Changed paths:
    M util/qemu-error.c

  Log Message:
  -----------
  error: Drop bogus "use error_setg() instead" admonitions

Commit 97f40301f1d "error: Functions to report warnings and
informational messages" copied the "use error_setg() instead"
admonition from the error reporting functions to new functions even
though it doesn't actually apply there.  Drop it.  Also drop it from
vreport(), where it doesn't apply anymore.

Reported-by: Kevin Wolf <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Eric Blake <address@hidden>


  Commit: 13399aad4fa87b2878c49d02a5d3bafa6c966ba3
      
https://github.com/qemu/qemu/commit/13399aad4fa87b2878c49d02a5d3bafa6c966ba3
  Author: Peter Maydell <address@hidden>
  Date:   2018-10-23 (Tue, 23 Oct 2018)

  Changed paths:
    M block.c
    M block/iscsi.c
    M block/qcow2.c
    M block/qed.c
    M block/rbd.c
    M block/sheepdog.c
    M block/vpc.c
    M blockdev.c
    M chardev/char-pty.c
    M chardev/char.c
    M cpus.c
    M device-hotplug.c
    M fsdev/qemu-fsdev-dummy.c
    M fsdev/qemu-fsdev.c
    M fsdev/qemu-fsdev.h
    M hw/9pfs/9p-handle.c
    M hw/9pfs/9p-local.c
    M hw/9pfs/xen-9p-backend.c
    M hw/display/cg3.c
    M hw/display/tcx.c
    M hw/i386/pc.c
    M hw/intc/ioapic.c
    M hw/intc/xics.c
    M hw/intc/xics_kvm.c
    M hw/misc/ivshmem.c
    M hw/net/virtio-net.c
    M hw/ppc/pnv_core.c
    M hw/ppc/spapr_pci.c
    M hw/smbios/smbios.c
    M hw/timer/aspeed_timer.c
    M hw/usb/bus.c
    M hw/vfio/pci-quirks.c
    M hw/vfio/pci.c
    M hw/vfio/platform.c
    M hw/virtio/virtio-pci.c
    M hw/xen/xen_pt.c
    M include/hw/vfio/vfio-common.h
    M include/qapi/error.h
    M include/qapi/qmp/qerror.h
    M include/sysemu/blockdev.h
    M include/sysemu/numa.h
    M include/sysemu/tpm.h
    M include/ui/console.h
    M migration/migration.c
    M migration/savevm.c
    M net/l2tpv3.c
    M net/socket.c
    M numa.c
    M qemu-io.c
    M qemu-nbd.c
    M qemu-seccomp.c
    M qom/object_interfaces.c
    R scripts/check-qerror.sh
    A scripts/coccinelle/use-error_fatal.cocci
    M stubs/tpm.c
    M target/i386/cpu.c
    M target/ppc/translate_init.inc.c
    M tests/qemu-iotests/049.out
    M tpm.c
    M ui/curses.c
    M ui/keymaps.c
    M ui/keymaps.h
    M ui/sdl.c
    M ui/spice-core.c
    M ui/vnc.c
    M util/error.c
    M util/qemu-error.c
    M vl.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/armbru/tags/pull-error-2018-10-22' into 
staging

Error reporting patches for 2018-10-22

# gpg: Signature made Mon 22 Oct 2018 13:20:23 BST
# gpg:                using RSA key 3870B400EB918653
# gpg: Good signature from "Markus Armbruster <address@hidden>"
# gpg:                 aka "Markus Armbruster <address@hidden>"
# Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867  4E5F 3870 B400 EB91 8653

* remotes/armbru/tags/pull-error-2018-10-22: (40 commits)
  error: Drop bogus "use error_setg() instead" admonitions
  vpc: Fail open on bad header checksum
  block: Clean up bdrv_img_create()'s error reporting
  vl: Simplify call of parse_name()
  vl: Fix exit status for -drive format=help
  blockdev: Convert drive_new() to Error
  vl: Assert drive_new() does not fail in default_drive()
  fsdev: Clean up error reporting in qemu_fsdev_add()
  spice: Clean up error reporting in add_channel()
  tpm: Clean up error reporting in tpm_init_tpmdev()
  numa: Clean up error reporting in parse_numa()
  vnc: Clean up error reporting in vnc_init_func()
  ui: Convert vnc_display_init(), init_keyboard_layout() to Error
  ui/keymaps: Fix handling of erroneous include files
  vl: Clean up error reporting in device_init_func()
  vl: Clean up error reporting in parse_fw_cfg()
  vl: Clean up error reporting in mon_init_func()
  vl: Clean up error reporting in machine_set_property()
  vl: Clean up error reporting in chardev_init_func()
  qom: Clean up error reporting in user_creatable_add_opts_foreach()
  ...

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/9b29b44e8ee5...13399aad4fa8
      **NOTE:** This service has been marked for deprecation: 
https://developer.github.com/changes/2018-04-25-github-services-deprecation/

      Functionality will be removed from GitHub.com on January 31st, 2019.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]