qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 47ff5a: error: Fix examples in error.h's big


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] 47ff5a: error: Fix examples in error.h's big comment
Date: Fri, 10 Jul 2020 08:00:30 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 47ff5ac81e8bb3096500de7b132051691d533d36
      
https://github.com/qemu/qemu/commit/47ff5ac81e8bb3096500de7b132051691d533d36
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

  Changed paths:
    M include/qapi/error.h

  Log Message:
  -----------
  error: Fix examples in error.h's big comment

Mark a bad example more clearly.  Fix the error_propagate_prepend()
example.  Add a missing declaration and a second error pileup example.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Greg Kurz <groug@kaod.org>
Message-Id: <20200707160613.848843-2-armbru@redhat.com>


  Commit: 9aac7d486cc792191c25c30851f501624b0c2751
      
https://github.com/qemu/qemu/commit/9aac7d486cc792191c25c30851f501624b0c2751
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

  Changed paths:
    M include/qapi/error.h

  Log Message:
  -----------
  error: Improve error.h's big comment

Add headlines to the big comment.

Explain examples for NULL, &error_abort and &error_fatal argument
better.

Tweak rationale for error_propagate_prepend().

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20200707160613.848843-3-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Greg Kurz <groug@kaod.org>


  Commit: e3fe3988d7851cac30abffae06d2f555ff7bee62
      
https://github.com/qemu/qemu/commit/e3fe3988d7851cac30abffae06d2f555ff7bee62
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

  Changed paths:
    M include/qapi/error.h

  Log Message:
  -----------
  error: Document Error API usage rules

This merely codifies existing practice, with one exception: the rule
advising against returning void, where existing practice is mixed.

When the Error API was created, we adopted the (unwritten) rule to
return void when the function returns no useful value on success,
unlike GError, which recommends to return true on success and false on
error then.

When a function returns a distinct error value, say false, a checked
call that passes the error up looks like

    if (!frobnicate(..., errp)) {
        handle the error...
    }

When it returns void, we need

    Error *err = NULL;

    frobnicate(..., &err);
    if (err) {
        handle the error...
        error_propagate(errp, err);
    }

Not only is this more verbose, it also creates an Error object even
when @errp is null, &error_abort or &error_fatal.

People got tired of the additional boilerplate, and started to ignore
the unwritten rule.  The result is confusion among developers about
the preferred usage.

Make the rule advising against returning void official by putting it
in writing.  This will hopefully reduce confusion.

Update the examples accordingly.

The remainder of this series will update a substantial amount of code
to honor the rule.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Greg Kurz <groug@kaod.org>
Message-Id: <20200707160613.848843-4-armbru@redhat.com>
[Tweak prose as per advice from Eric]


  Commit: 118bfd76c9c604588cb3f97811710576f58e5a76
      
https://github.com/qemu/qemu/commit/118bfd76c9c604588cb3f97811710576f58e5a76
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

  Changed paths:
    M hw/arm/allwinner-a10.c
    M hw/arm/armsse.c
    M hw/arm/armv7m.c
    M hw/arm/aspeed_ast2600.c
    M hw/arm/aspeed_soc.c
    M hw/arm/bcm2835_peripherals.c
    M hw/arm/bcm2836.c
    M hw/arm/cubieboard.c
    M hw/arm/digic.c
    M hw/arm/digic_boards.c
    M hw/arm/fsl-imx25.c
    M hw/arm/fsl-imx31.c
    M hw/arm/fsl-imx6.c
    M hw/arm/msf2-soc.c
    M hw/arm/nrf51_soc.c
    M hw/arm/stm32f205_soc.c
    M hw/arm/stm32f405_soc.c
    M hw/arm/xlnx-zynqmp.c
    M hw/block/fdc.c
    M hw/block/xen-block.c
    M hw/char/serial-pci-multi.c
    M hw/char/serial-pci.c
    M hw/char/serial.c
    M hw/core/cpu.c
    M hw/cpu/a15mpcore.c
    M hw/cpu/a9mpcore.c
    M hw/cpu/arm11mpcore.c
    M hw/cpu/realview_mpcore.c
    M hw/display/virtio-gpu-pci.c
    M hw/display/virtio-vga.c
    M hw/intc/armv7m_nvic.c
    M hw/intc/pnv_xive.c
    M hw/intc/realview_gic.c
    M hw/intc/spapr_xive.c
    M hw/intc/xics.c
    M hw/intc/xive.c
    M hw/isa/piix4.c
    M hw/microblaze/xlnx-zynqmp-pmu.c
    M hw/mips/cps.c
    M hw/misc/macio/cuda.c
    M hw/misc/macio/macio.c
    M hw/misc/macio/pmu.c
    M hw/pci-host/pnv_phb3.c
    M hw/pci-host/pnv_phb4.c
    M hw/pci-host/pnv_phb4_pec.c
    M hw/ppc/e500.c
    M hw/ppc/pnv.c
    M hw/ppc/pnv_core.c
    M hw/ppc/pnv_psi.c
    M hw/ppc/spapr_cpu_core.c
    M hw/ppc/spapr_irq.c
    M hw/riscv/opentitan.c
    M hw/riscv/sifive_e.c
    M hw/riscv/sifive_u.c
    M hw/s390x/event-facility.c
    M hw/s390x/s390-pci-bus.c
    M hw/s390x/sclp.c
    M hw/s390x/virtio-ccw-crypto.c
    M hw/s390x/virtio-ccw-rng.c
    M hw/scsi/scsi-bus.c
    M hw/sd/aspeed_sdhci.c
    M hw/sd/ssi-sd.c
    M hw/usb/bus.c
    M hw/virtio/virtio-rng-pci.c
    M qdev-monitor.c

  Log Message:
  -----------
  qdev: Use returned bool to check for qdev_realize() etc. failure

Convert

    foo(..., &err);
    if (err) {
        ...
    }

to

    if (!foo(..., &err)) {
        ...
    }

for qdev_realize(), qdev_realize_and_unref(), qbus_realize() and their
wrappers isa_realize_and_unref(), pci_realize_and_unref(),
sysbus_realize(), sysbus_realize_and_unref(), usb_realize_and_unref().
Coccinelle script:

    @@
    identifier fun = {
        isa_realize_and_unref, pci_realize_and_unref, qbus_realize,
        qdev_realize, qdev_realize_and_unref, sysbus_realize,
        sysbus_realize_and_unref, usb_realize_and_unref
    };
    expression list args, args2;
    typedef Error;
    Error *err;
    @@
    -    fun(args, &err, args2);
    -    if (err)
    +    if (!fun(args, &err, args2))
         {
             ...
         }

Chokes on hw/arm/musicpal.c's lcd_refresh() with the unhelpful error
message "no position information".  Nothing to convert there; skipped.

Fails to convert hw/arm/armsse.c, because Coccinelle gets confused by
ARMSSE being used both as typedef and function-like macro there.
Converted manually.

A few line breaks tidied up manually.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Greg Kurz <groug@kaod.org>
Message-Id: <20200707160613.848843-5-armbru@redhat.com>


  Commit: 0a15a73236cb068cfd28f8c6846f66ab007f81bb
      
https://github.com/qemu/qemu/commit/0a15a73236cb068cfd28f8c6846f66ab007f81bb
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

  Changed paths:
    M hw/misc/macio/macio.c

  Log Message:
  -----------
  macio: Tidy up error handling in macio_newworld_realize()

macio_newworld_realize() effectively ignores ns->gpio realization
errors, leaking the Error object.  Fortunately, macio_gpio_realize()
can't actually fail.  Tidy up.

Cc: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Cc: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Greg Kurz <groug@kaod.org>
Message-Id: <20200707160613.848843-6-armbru@redhat.com>


  Commit: 79c3e2bc6e78eb9cb197a9b3a9fc885ec1b7c720
      
https://github.com/qemu/qemu/commit/79c3e2bc6e78eb9cb197a9b3a9fc885ec1b7c720
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

  Changed paths:
    M hw/virtio/virtio-crypto-pci.c

  Log Message:
  -----------
  virtio-crypto-pci: Tidy up virtio_crypto_pci_realize()

virtio_crypto_pci_realize() continues after realization of its
"virtio-crypto-device" fails.  Only an object_property_set_link()
follows; looks harmless to me.  Tidy up anyway: return after failure,
just like virtio_rng_pci_realize() does.

Cc: "Gonglei (Arei)" <arei.gonglei@huawei.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Gonglei < arei.gonglei@huawei.com>
Message-Id: <20200707160613.848843-7-armbru@redhat.com>


  Commit: c6ecec43b240b545ef2f1d6eed5b1e539dfdb2c1
      
https://github.com/qemu/qemu/commit/c6ecec43b240b545ef2f1d6eed5b1e539dfdb2c1
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

  Changed paths:
    M block/parallels.c
    M blockdev.c
    M qdev-monitor.c
    M util/qemu-config.c
    M util/qemu-option.c

  Log Message:
  -----------
  qemu-option: Check return value instead of @err where convenient

Convert uses like

    opts = qemu_opts_create(..., &err);
    if (err) {
        ...
    }

to

    opts = qemu_opts_create(..., errp);
    if (!opts) {
        ...
    }

Eliminate error_propagate() that are now unnecessary.  Delete @err
that are now unused.

Note that we can't drop parallels_open()'s error_propagate() here.  We
continue to execute it even in the converted case.  It's a no-op then:
local_err is null.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Greg Kurz <groug@kaod.org>
Message-Id: <20200707160613.848843-8-armbru@redhat.com>


  Commit: 9da7197a801eef8a0015d1079b7015432cf9e6b6
      
https://github.com/qemu/qemu/commit/9da7197a801eef8a0015d1079b7015432cf9e6b6
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

  Changed paths:
    M util/qemu-option.c

  Log Message:
  -----------
  qemu-option: Make uses of find_desc_by_name() more similar

This is to make the next commit easier to review.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Greg Kurz <groug@kaod.org>
Message-Id: <20200707160613.848843-9-armbru@redhat.com>


  Commit: f23db652cb87cfb9aacc7cfd92ea01c00ca0162b
      
https://github.com/qemu/qemu/commit/f23db652cb87cfb9aacc7cfd92ea01c00ca0162b
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

  Changed paths:
    M util/qemu-option.c

  Log Message:
  -----------
  qemu-option: Factor out helper find_default_by_name()

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Greg Kurz <groug@kaod.org>
Message-Id: <20200707160613.848843-10-armbru@redhat.com>


  Commit: 44b0b7d1758d105cea2d6156a071e8d9e2256f69
      
https://github.com/qemu/qemu/commit/44b0b7d1758d105cea2d6156a071e8d9e2256f69
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

  Changed paths:
    M util/qemu-option.c

  Log Message:
  -----------
  qemu-option: Simplify around find_default_by_name()

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20200707160613.848843-11-armbru@redhat.com>
Reviewed-by: Greg Kurz <groug@kaod.org>


  Commit: 81a8a0726a67b0f28d36201c1b9e0944e5849a76
      
https://github.com/qemu/qemu/commit/81a8a0726a67b0f28d36201c1b9e0944e5849a76
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

  Changed paths:
    M util/qemu-option.c

  Log Message:
  -----------
  qemu-option: Factor out helper opt_create()

There is just one use so far.  The next commit will add more.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20200707160613.848843-12-armbru@redhat.com>


  Commit: 64af7a8bad2cbda178730a842fa0d43d02415dbc
      
https://github.com/qemu/qemu/commit/64af7a8bad2cbda178730a842fa0d43d02415dbc
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

  Changed paths:
    M util/qemu-option.c

  Log Message:
  -----------
  qemu-option: Replace opt_set() by cleaner opt_validate()

opt_set() frees its argument @value on failure.  Slightly unclean;
functions ideally do nothing on failure.

To tidy this up, move opt_create() from opt_set() into its callers,
along with the cleanup.  Rename opt_set() to opt_validate(), noting
its similarity to qemu_opts_validate().  Drop redundant parameter
@opts; use opt->opts instead.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20200707160613.848843-13-armbru@redhat.com>


  Commit: c75d7f71918b8497a710f3f2b646567c09db3770
      
https://github.com/qemu/qemu/commit/c75d7f71918b8497a710f3f2b646567c09db3770
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

  Changed paths:
    M blockdev.c
    M include/qemu/option.h
    M util/qemu-option.c

  Log Message:
  -----------
  qemu-option: Make functions taking Error ** return bool, not void

See recent commit "error: Document Error API usage rules" for
rationale.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20200707160613.848843-14-armbru@redhat.com>


  Commit: 235e59cf03ed75d0ce96c97343194ed11c146231
      
https://github.com/qemu/qemu/commit/235e59cf03ed75d0ce96c97343194ed11c146231
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

  Changed paths:
    M block.c
    M block/blkdebug.c
    M block/blklogwrites.c
    M block/blkverify.c
    M block/crypto.c
    M block/curl.c
    M block/file-posix.c
    M block/file-win32.c
    M block/gluster.c
    M block/iscsi.c
    M block/nbd.c
    M block/parallels.c
    M block/qcow2.c
    M block/quorum.c
    M block/raw-format.c
    M block/replication.c
    M block/sheepdog.c
    M block/ssh.c
    M block/throttle.c
    M block/vpc.c
    M block/vvfat.c
    M block/vxhs.c
    M blockdev.c
    M chardev/char.c
    M contrib/ivshmem-server/main.c
    M hw/net/virtio-net.c
    M hw/smbios/smbios.c
    M qapi/string-input-visitor.c
    M qemu-img.c
    M tpm.c
    M util/qemu-config.c
    M util/qemu-option.c

  Log Message:
  -----------
  qemu-option: Use returned bool to check for failure

The previous commit enables conversion of

    foo(..., &err);
    if (err) {
        ...
    }

to

    if (!foo(..., &err)) {
        ...
    }

for QemuOpts functions that now return true / false on success /
error.  Coccinelle script:

    @@
    identifier fun = {
        opts_do_parse, parse_option_bool, parse_option_number,
        parse_option_size, qemu_opt_parse, qemu_opt_rename, qemu_opt_set,
        qemu_opt_set_bool, qemu_opt_set_number, qemu_opts_absorb_qdict,
        qemu_opts_do_parse, qemu_opts_from_qdict_entry, qemu_opts_set,
        qemu_opts_validate
    };
    expression list args, args2;
    typedef Error;
    Error *err;
    @@
    -    fun(args, &err, args2);
    -    if (err)
    +    if (!fun(args, &err, args2))
         {
             ...
         }

A few line breaks tidied up manually.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20200707160613.848843-15-armbru@redhat.com>
[Conflict with commit 0b6786a9c1 "block/amend: refactor qcow2 amend
options" resolved by rerunning Coccinelle on master's version]


  Commit: 3882578bb559e5caf9b79cabcb88b69270af68c0
      
https://github.com/qemu/qemu/commit/3882578bb559e5caf9b79cabcb88b69270af68c0
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

  Changed paths:
    M block.c

  Log Message:
  -----------
  block: Avoid error accumulation in bdrv_img_create()

When creating an image fails because the format doesn't support option
"backing_file" or "backing_fmt", bdrv_img_create() first has
qemu_opt_set() put a generic error into @local_err, then puts the real
error into @errp with error_setg(), and then propagates the former to
the latter, which throws away the generic error.  A bit complicated,
but works.

Now that qemu_opt_set() returns a useful value, we can simply ignore
the generic error instead.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20200707160613.848843-16-armbru@redhat.com>


  Commit: 3c4b89c3b209978f13bcb7ab4d375b81b6fdad99
      
https://github.com/qemu/qemu/commit/3c4b89c3b209978f13bcb7ab4d375b81b6fdad99
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

  Changed paths:
    M monitor/hmp-cmds.c

  Log Message:
  -----------
  hmp: Eliminate a variable in hmp_migrate_set_parameter()

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20200707160613.848843-17-armbru@redhat.com>


  Commit: 012d4c96e260f99d5ca95cd033274af4fb73b825
      
https://github.com/qemu/qemu/commit/012d4c96e260f99d5ca95cd033274af4fb73b825
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

  Changed paths:
    M audio/audio_legacy.c
    M docs/devel/qapi-code-gen.txt
    M include/qapi/clone-visitor.h
    M include/qapi/visitor-impl.h
    M include/qapi/visitor.h
    M qapi/opts-visitor.c
    M qapi/qapi-clone-visitor.c
    M qapi/qapi-dealloc-visitor.c
    M qapi/qapi-visit-core.c
    M qapi/qobject-input-visitor.c
    M qapi/qobject-output-visitor.c
    M qapi/string-input-visitor.c
    M qapi/string-output-visitor.c
    M scripts/qapi/visit.py

  Log Message:
  -----------
  qapi: Make visitor functions taking Error ** return bool, not void

See recent commit "error: Document Error API usage rules" for
rationale.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20200707160613.848843-18-armbru@redhat.com>


  Commit: 62a35aaa310807fa161ca041ddb0f308faeb582b
      
https://github.com/qemu/qemu/commit/62a35aaa310807fa161ca041ddb0f308faeb582b
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

  Changed paths:
    M accel/kvm/kvm-all.c
    M accel/tcg/tcg-all.c
    M backends/cryptodev.c
    M backends/hostmem-file.c
    M backends/hostmem-memfd.c
    M backends/hostmem.c
    M backends/tpm/tpm_util.c
    M block/blkdebug.c
    M block/nbd.c
    M block/sheepdog.c
    M block/throttle-groups.c
    M bootdevice.c
    M hw/block/xen-block.c
    M hw/core/machine.c
    M hw/core/qdev-properties-system.c
    M hw/core/qdev-properties.c
    M hw/cpu/core.c
    M hw/gpio/aspeed_gpio.c
    M hw/i386/pc.c
    M hw/ide/qdev.c
    M hw/intc/apic_common.c
    M hw/mem/nvdimm.c
    M hw/misc/aspeed_sdmc.c
    M hw/misc/pca9552.c
    M hw/misc/tmp105.c
    M hw/misc/tmp421.c
    M hw/net/ne2000-isa.c
    M hw/ppc/spapr_caps.c
    M hw/ppc/spapr_drc.c
    M hw/s390x/css.c
    M hw/usb/dev-storage.c
    M hw/vfio/pci-quirks.c
    M hw/virtio/virtio-balloon.c
    M iothread.c
    M monitor/hmp-cmds.c
    M net/colo-compare.c
    M net/dump.c
    M net/filter-buffer.c
    M qom/object.c
    M qom/object_interfaces.c
    M target/arm/cpu64.c
    M target/arm/monitor.c
    M target/i386/cpu.c
    M target/ppc/compat.c
    M target/s390x/cpu_models.c
    M target/sparc/cpu.c

  Log Message:
  -----------
  qapi: Use returned bool to check for failure, Coccinelle part

The previous commit enables conversion of

    visit_foo(..., &err);
    if (err) {
        ...
    }

to

    if (!visit_foo(..., errp)) {
        ...
    }

for visitor functions that now return true / false on success / error.
Coccinelle script:

    @@
    identifier fun =~ 
"check_list|input_type_enum|lv_start_struct|lv_type_bool|lv_type_int64|lv_type_str|lv_type_uint64|output_type_enum|parse_type_bool|parse_type_int64|parse_type_null|parse_type_number|parse_type_size|parse_type_str|parse_type_uint64|print_type_bool|print_type_int64|print_type_null|print_type_number|print_type_size|print_type_str|print_type_uint64|qapi_clone_start_alternate|qapi_clone_start_list|qapi_clone_start_struct|qapi_clone_type_bool|qapi_clone_type_int64|qapi_clone_type_null|qapi_clone_type_number|qapi_clone_type_str|qapi_clone_type_uint64|qapi_dealloc_start_list|qapi_dealloc_start_struct|qapi_dealloc_type_anything|qapi_dealloc_type_bool|qapi_dealloc_type_int64|qapi_dealloc_type_null|qapi_dealloc_type_number|qapi_dealloc_type_str|qapi_dealloc_type_uint64|qobject_input_check_list|qobject_input_check_struct|qobject_input_start_alternate|qobject_input_start_list|qobject_input_start_struct|qobject_input_type_any|qobject_input_type_bool|qobject_input_type_bool_keyval|qobject_input_type_int64|qobject_input_type_int64_keyval|qobject_input_type_null|qobject_input_type_number|qobject_input_type_number_keyval|qobject_input_type_size_keyval|qobject_input_type_str|qobject_input_type_str_keyval|qobject_input_type_uint64|qobject_input_type_uint64_keyval|qobject_output_start_list|qobject_output_start_struct|qobject_output_type_any|qobject_output_type_bool|qobject_output_type_int64|qobject_output_type_null|qobject_output_type_number|qobject_output_type_str|qobject_output_type_uint64|start_list|visit_check_list|visit_check_struct|visit_start_alternate|visit_start_list|visit_start_struct|visit_type_.*";
    expression list args;
    typedef Error;
    Error *err;
    @@
    -    fun(args, &err);
    -    if (err)
    +    if (!fun(args, &err))
         {
             ...
         }

A few line breaks tidied up manually.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20200707160613.848843-19-armbru@redhat.com>


  Commit: 14217038bc9e36246d311fa8e026a01a5d7bbd42
      
https://github.com/qemu/qemu/commit/14217038bc9e36246d311fa8e026a01a5d7bbd42
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

  Changed paths:
    M accel/kvm/kvm-all.c
    M block/throttle-groups.c
    M bootdevice.c
    M hw/core/qdev-properties.c
    M hw/ide/qdev.c
    M hw/mem/nvdimm.c
    M hw/net/ne2000-isa.c
    M hw/usb/dev-storage.c
    M net/net.c

  Log Message:
  -----------
  qapi: Use returned bool to check for failure, manual part

The previous commit used Coccinelle to convert from checking the Error
object to checking the return value.  Convert a few more manually.
Also tweak control flow in places to conform to the conventional "if
error bail out" pattern.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20200707160613.848843-20-armbru@redhat.com>


  Commit: 5af3a05631daffc61a12dd2c25d15876f048fdd1
      
https://github.com/qemu/qemu/commit/5af3a05631daffc61a12dd2c25d15876f048fdd1
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

  Changed paths:
    M hw/s390x/s390-pci-bus.c

  Log Message:
  -----------
  s390x/pci: Fix harmless mistake in zpci's property fid's setter

s390_pci_set_fid() sets zpci->fid_defined to true even when
visit_type_uint32() failed.  Reproducer: "-device zpci,fid=junk".
Harmless in practice, because qdev_device_add() then fails, throwing
away @zpci.  Fix it anyway.

Cc: Matthew Rosato <mjrosato@linux.ibm.com>
Cc: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Message-Id: <20200707160613.848843-21-armbru@redhat.com>


  Commit: fdb0df8798dfe6f140f4febf7a1756a44ee2080e
      
https://github.com/qemu/qemu/commit/fdb0df8798dfe6f140f4febf7a1756a44ee2080e
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

  Changed paths:
    M include/qom/object.h

  Log Message:
  -----------
  qom: Use error_reportf_err() instead of g_printerr() in examples

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20200707160613.848843-22-armbru@redhat.com>


  Commit: 90c69fb9fdd71f5e615145fd1dc43cdef61737b3
      
https://github.com/qemu/qemu/commit/90c69fb9fdd71f5e615145fd1dc43cdef61737b3
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

  Changed paths:
    M qom/object.c

  Log Message:
  -----------
  qom: Rename qdev_get_type() to object_get_type()

Commit 2f262e06f0 lifted qdev_get_type() from qdev to object without
renaming it accordingly.  Do that now.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20200707160613.848843-23-armbru@redhat.com>


  Commit: 552d7f49eebdb1c84ab6dc7d93bd152fd885af31
      
https://github.com/qemu/qemu/commit/552d7f49eebdb1c84ab6dc7d93bd152fd885af31
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

  Changed paths:
    M hw/core/platform-bus.c
    M hw/ppc/spapr_drc.c
    M hw/ppc/spapr_hcall.c
    M hw/ppc/spapr_pci_nvlink2.c
    M ui/vnc.c

  Log Message:
  -----------
  qom: Crash more nicely on object_property_get_link() failure

Pass &error_abort instead of NULL where the returned value is
dereferenced or asserted to be non-null.  Drop a now redundant
assertion.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20200707160613.848843-24-armbru@redhat.com>


  Commit: 4d21fcd52404ff4bac1f94d8054dfb745f1b2ad6
      
https://github.com/qemu/qemu/commit/4d21fcd52404ff4bac1f94d8054dfb745f1b2ad6
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

  Changed paths:
    M hw/arm/bcm2835_peripherals.c
    M hw/arm/bcm2836.c
    M hw/display/bcm2835_fb.c
    M hw/dma/bcm2835_dma.c
    M hw/gpio/bcm2835_gpio.c
    M hw/intc/nios2_iic.c
    M hw/misc/bcm2835_mbox.c
    M hw/misc/bcm2835_property.c
    M hw/usb/hcd-dwc2.c

  Log Message:
  -----------
  qom: Don't handle impossible object_property_get_link() failure

Don't handle object_property_get_link() failure that can't happen
unless the programmer screwed up, pass &error_abort.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200707160613.848843-25-armbru@redhat.com>


  Commit: 1c94a351644fb2555f34e63c8ddc29f70bd4803a
      
https://github.com/qemu/qemu/commit/1c94a351644fb2555f34e63c8ddc29f70bd4803a
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

  Changed paths:
    M qom/object.c

  Log Message:
  -----------
  qom: Use return values to check for error where that's simpler

When using the Error object to check for error, we need to receive it
into a local variable, then propagate() it to @errp.

Using the return value permits allows receiving it straight to @errp.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20200707160613.848843-26-armbru@redhat.com>


  Commit: 5325cc34a2ca985283134c7e264be7851b112d4e
      
https://github.com/qemu/qemu/commit/5325cc34a2ca985283134c7e264be7851b112d4e
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

  Changed paths:
    M backends/cryptodev.c
    M backends/rng.c
    M bootdevice.c
    M crypto/secret.c
    M crypto/secret_keyring.c
    M crypto/tlscredsanon.c
    M crypto/tlscredspsk.c
    M crypto/tlscredsx509.c
    M hw/acpi/cpu_hotplug.c
    M hw/acpi/ich9.c
    M hw/acpi/piix4.c
    M hw/arm/allwinner-a10.c
    M hw/arm/armsse.c
    M hw/arm/armv7m.c
    M hw/arm/aspeed.c
    M hw/arm/aspeed_ast2600.c
    M hw/arm/aspeed_soc.c
    M hw/arm/bcm2835_peripherals.c
    M hw/arm/bcm2836.c
    M hw/arm/cubieboard.c
    M hw/arm/digic.c
    M hw/arm/exynos4210.c
    M hw/arm/fsl-imx25.c
    M hw/arm/fsl-imx31.c
    M hw/arm/fsl-imx6.c
    M hw/arm/fsl-imx6ul.c
    M hw/arm/fsl-imx7.c
    M hw/arm/highbank.c
    M hw/arm/integratorcp.c
    M hw/arm/mcimx6ul-evk.c
    M hw/arm/microbit.c
    M hw/arm/mps2-tz.c
    M hw/arm/mps2.c
    M hw/arm/msf2-soc.c
    M hw/arm/musca.c
    M hw/arm/musicpal.c
    M hw/arm/nrf51_soc.c
    M hw/arm/orangepi.c
    M hw/arm/raspi.c
    M hw/arm/realview.c
    M hw/arm/sbsa-ref.c
    M hw/arm/stellaris.c
    M hw/arm/stm32f205_soc.c
    M hw/arm/stm32f405_soc.c
    M hw/arm/versatilepb.c
    M hw/arm/vexpress.c
    M hw/arm/virt.c
    M hw/arm/xilinx_zynq.c
    M hw/arm/xlnx-versal-virt.c
    M hw/arm/xlnx-versal.c
    M hw/arm/xlnx-zcu102.c
    M hw/arm/xlnx-zynqmp.c
    M hw/block/xen-block.c
    M hw/core/bus.c
    M hw/core/numa.c
    M hw/core/qdev-properties-system.c
    M hw/core/qdev-properties.c
    M hw/core/qdev.c
    M hw/display/virtio-gpu-pci.c
    M hw/display/virtio-vga.c
    M hw/dma/sparc32_dma.c
    M hw/dma/xilinx_axidma.c
    M hw/i386/pc.c
    M hw/i386/pc_piix.c
    M hw/i386/pc_q35.c
    M hw/i386/x86.c
    M hw/ide/qdev.c
    M hw/intc/pnv_xive.c
    M hw/intc/spapr_xive.c
    M hw/intc/xics.c
    M hw/intc/xive.c
    M hw/m68k/q800.c
    M hw/mem/pc-dimm.c
    M hw/microblaze/petalogix_ml605_mmu.c
    M hw/microblaze/petalogix_s3adsp1800_mmu.c
    M hw/microblaze/xlnx-zynqmp-pmu.c
    M hw/mips/boston.c
    M hw/mips/cps.c
    M hw/mips/jazz.c
    M hw/mips/malta.c
    M hw/misc/iotkit-sysctl.c
    M hw/misc/macio/macio.c
    M hw/net/ne2000-isa.c
    M hw/net/xilinx_axienet.c
    M hw/pci-host/pnv_phb3.c
    M hw/pci-host/pnv_phb4.c
    M hw/pci-host/pnv_phb4_pec.c
    M hw/pci-host/prep.c
    M hw/ppc/mac_newworld.c
    M hw/ppc/mac_oldworld.c
    M hw/ppc/pnv.c
    M hw/ppc/pnv_psi.c
    M hw/ppc/spapr.c
    M hw/ppc/spapr_irq.c
    M hw/ppc/spapr_pci.c
    M hw/riscv/opentitan.c
    M hw/riscv/sifive_e.c
    M hw/riscv/sifive_u.c
    M hw/riscv/spike.c
    M hw/riscv/virt.c
    M hw/rx/rx-gdbsim.c
    M hw/s390x/ipl.c
    M hw/s390x/s390-pci-bus.c
    M hw/s390x/s390-skeys.c
    M hw/s390x/s390-stattrib.c
    M hw/s390x/s390-virtio-ccw.c
    M hw/s390x/virtio-ccw-crypto.c
    M hw/s390x/virtio-ccw-rng.c
    M hw/scsi/scsi-bus.c
    M hw/sd/aspeed_sdhci.c
    M hw/sd/ssi-sd.c
    M hw/sparc/sun4m.c
    M hw/sparc64/sun4u.c
    M hw/usb/dev-storage.c
    M hw/virtio/virtio-crypto-pci.c
    M hw/virtio/virtio-iommu-pci.c
    M hw/virtio/virtio-mem-pci.c
    M hw/virtio/virtio-pmem-pci.c
    M hw/virtio/virtio-rng-pci.c
    M hw/virtio/virtio-rng.c
    M include/hw/audio/pcspk.h
    M include/qom/object.h
    M include/qom/qom-qobject.h
    M linux-user/syscall.c
    M net/filter.c
    M net/net.c
    M qdev-monitor.c
    M qom/object.c
    M qom/object_interfaces.c
    M qom/qom-hmp-cmds.c
    M qom/qom-qmp-cmds.c
    M qom/qom-qobject.c
    M softmmu/vl.c
    M target/arm/monitor.c
    M target/i386/cpu.c
    M target/ppc/translate_init.inc.c
    M target/s390x/cpu_models.c
    M ui/console.c

  Log Message:
  -----------
  qom: Put name parameter before value / visitor parameter

The object_property_set_FOO() setters take property name and value in
an unusual order:

    void object_property_set_FOO(Object *obj, FOO_TYPE value,
                                 const char *name, Error **errp)

Having to pass value before name feels grating.  Swap them.

Same for object_property_set(), object_property_get(), and
object_property_parse().

Convert callers with this Coccinelle script:

    @@
    identifier fun = {
        object_property_get, object_property_parse, object_property_set_str,
        object_property_set_link, object_property_set_bool,
        object_property_set_int, object_property_set_uint, object_property_set,
        object_property_set_qobject
    };
    expression obj, v, name, errp;
    @@
    -    fun(obj, v, name, errp)
    +    fun(obj, name, v, errp)

Chokes on hw/arm/musicpal.c's lcd_refresh() with the unhelpful error
message "no position information".  Convert that one manually.

Fails to convert hw/arm/armsse.c, because Coccinelle gets confused by
ARMSSE being used both as typedef and function-like macro there.
Convert manually.

Fails to convert hw/rx/rx-gdbsim.c, because Coccinelle gets confused
by RXCPU being used both as typedef and function-like macro there.
Convert manually.  The other files using RXCPU that way don't need
conversion.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20200707160613.848843-27-armbru@redhat.com>
[Straightforwad conflict with commit 2336172d9b "audio: set default
value for pcspk.iobase property" resolved]


  Commit: 6fd5bef10b8f0bf64df4e800bfda1da5fe17ca82
      
https://github.com/qemu/qemu/commit/6fd5bef10b8f0bf64df4e800bfda1da5fe17ca82
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

  Changed paths:
    M include/qom/object.h
    M include/qom/object_interfaces.h
    M include/qom/qom-qobject.h
    M qom/object.c
    M qom/object_interfaces.c
    M qom/qom-qobject.c

  Log Message:
  -----------
  qom: Make functions taking Error ** return bool, not void

See recent commit "error: Document Error API usage rules" for
rationale.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20200707160613.848843-28-armbru@redhat.com>


  Commit: 778a2dc59213d789f5bf8409547b529af4eb9ead
      
https://github.com/qemu/qemu/commit/778a2dc59213d789f5bf8409547b529af4eb9ead
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

  Changed paths:
    M hw/arm/armsse.c
    M hw/arm/armv7m.c
    M hw/arm/aspeed_ast2600.c
    M hw/arm/aspeed_soc.c
    M hw/arm/bcm2835_peripherals.c
    M hw/arm/bcm2836.c
    M hw/arm/cubieboard.c
    M hw/arm/digic.c
    M hw/arm/nrf51_soc.c
    M hw/arm/stm32f405_soc.c
    M hw/arm/xlnx-zynqmp.c
    M hw/block/xen-block.c
    M hw/core/qdev.c
    M hw/i386/x86.c
    M hw/ppc/pnv_psi.c
    M hw/s390x/s390-pci-bus.c
    M hw/s390x/s390-virtio-ccw.c
    M hw/scsi/scsi-bus.c
    M hw/sd/aspeed_sdhci.c
    M hw/sd/ssi-sd.c
    M hw/virtio/virtio-rng.c
    M qdev-monitor.c
    M qom/object.c
    M qom/object_interfaces.c
    M softmmu/vl.c
    M target/arm/monitor.c
    M target/i386/cpu.c
    M target/s390x/cpu_models.c

  Log Message:
  -----------
  qom: Use returned bool to check for failure, Coccinelle part

The previous commit enables conversion of

    foo(..., &err);
    if (err) {
        ...
    }

to

    if (!foo(..., errp)) {
        ...
    }

for QOM functions that now return true / false on success / error.
Coccinelle script:

    @@
    identifier fun = {
        object_apply_global_props, object_initialize_child_with_props,
        object_initialize_child_with_propsv, object_property_get,
        object_property_get_bool, object_property_parse, object_property_set,
        object_property_set_bool, object_property_set_int,
        object_property_set_link, object_property_set_qobject,
        object_property_set_str, object_property_set_uint, object_set_props,
        object_set_propv, user_creatable_add_dict,
        user_creatable_complete, user_creatable_del
    };
    expression list args, args2;
    typedef Error;
    Error *err;
    @@
    -    fun(args, &err, args2);
    -    if (err)
    +    if (!fun(args, &err, args2))
         {
             ...
         }

Fails to convert hw/arm/armsse.c, because Coccinelle gets confused by
ARMSSE being used both as typedef and function-like macro there.
Convert manually.

Line breaks tidied up manually.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20200707160613.848843-29-armbru@redhat.com>


  Commit: f07ad48d46fdbc739dd72ac4ad1677dbbfe7ed44
      
https://github.com/qemu/qemu/commit/f07ad48d46fdbc739dd72ac4ad1677dbbfe7ed44
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

  Changed paths:
    M hw/core/bus.c
    M hw/core/qdev.c
    M hw/s390x/s390-virtio-ccw.c

  Log Message:
  -----------
  qom: Use returned bool to check for failure, manual part

The previous commit used Coccinelle to convert from checking the Error
object to checking the return value.  Convert a few more manually.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20200707160613.848843-30-armbru@redhat.com>


  Commit: b783f54d60f8472aa61b44b682ca7af7929082e1
      
https://github.com/qemu/qemu/commit/b783f54d60f8472aa61b44b682ca7af7929082e1
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

  Changed paths:
    M include/qom/object.h
    M qom/object.c

  Log Message:
  -----------
  qom: Make functions taking Error ** return bool, not 0/-1

Just for consistency.  Also fix the example in object_set_props()'s
documentation.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20200707160613.848843-31-armbru@redhat.com>


  Commit: 73ac1aac398576a30d3468abccbd9568adc1de76
      
https://github.com/qemu/qemu/commit/73ac1aac398576a30d3468abccbd9568adc1de76
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

  Changed paths:
    M hw/core/qdev-properties-system.c
    M include/hw/qdev-properties.h

  Log Message:
  -----------
  qdev: Make functions taking Error ** return bool, not void

See recent commit "error: Document Error API usage rules" for
rationale.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20200707160613.848843-32-armbru@redhat.com>


  Commit: 0c0e618d233e3249f6b60678a1b013a2c8d83339
      
https://github.com/qemu/qemu/commit/0c0e618d233e3249f6b60678a1b013a2c8d83339
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

  Changed paths:
    M hw/scsi/scsi-bus.c
    M hw/sd/sd.c
    M hw/sd/ssi-sd.c

  Log Message:
  -----------
  qdev: Use returned bool to check for failure, Coccinelle part

The previous commit enables conversion of

    qdev_prop_set_drive_err(..., &err);
    if (err) {
    ...
    }

to

    if (!qdev_prop_set_drive_err(..., errp)) {
    ...
    }

Coccinelle script:

    @@
    identifier fun = qdev_prop_set_drive_err;
    expression list args;
    typedef Error;
    Error *err;
    @@
    -    fun(args, &err);
    -    if (err)
    +    if (!fun(args, &err))
         {
             ...
         }

One line break tidied up manually.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20200707160613.848843-33-armbru@redhat.com>


  Commit: dcfe480544eef72d666cb1695624449e2c22da2d
      
https://github.com/qemu/qemu/commit/dcfe480544eef72d666cb1695624449e2c22da2d
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

  Changed paths:
    M backends/cryptodev.c
    M backends/hostmem-file.c
    M backends/hostmem-memfd.c
    M backends/hostmem.c
    M block/quorum.c
    M block/replication.c
    M block/throttle-groups.c
    M block/vxhs.c
    M hw/acpi/core.c
    M hw/hyperv/vmbus.c
    M hw/i386/pc.c
    M hw/mem/nvdimm.c
    M hw/mem/pc-dimm.c
    M hw/misc/aspeed_sdmc.c
    M hw/ppc/rs6000_mc.c
    M hw/ppc/spapr.c
    M hw/ppc/spapr_pci.c
    M hw/s390x/ipl.c
    M hw/xen/xen_pt_config_init.c
    M iothread.c
    M net/colo-compare.c
    M net/dump.c
    M net/filter-buffer.c
    M qga/commands-win32.c

  Log Message:
  -----------
  error: Avoid unnecessary error_propagate() after error_setg()

Replace

    error_setg(&err, ...);
    error_propagate(errp, err);

by

    error_setg(errp, ...);

Related pattern:

    if (...) {
        error_setg(&err, ...);
        goto out;
    }
    ...
 out:
    error_propagate(errp, err);
    return;

When all paths to label out are that way, replace by

    if (...) {
        error_setg(errp, ...);
        return;
    }

and delete the label along with the error_propagate().

When we have at most one other path that actually needs to propagate,
and maybe one at the end that where propagation is unnecessary, e.g.

    foo(..., &err);
    if (err) {
        goto out;
    }
    ...
    bar(..., &err);
 out:
    error_propagate(errp, err);
    return;

move the error_propagate() to where it's needed, like

    if (...) {
        foo(..., &err);
        error_propagate(errp, err);
        return;
    }
    ...
    bar(..., errp);
    return;

and transform the error_setg() as above.

In some places, the transformation results in obviously unnecessary
error_propagate().  The next few commits will eliminate them.

Bonus: the elimination of gotos will make later patches in this series
easier to review.

Candidates for conversion tracked down with this Coccinelle script:

    @@
    identifier err, errp;
    expression list args;
    @@
    -    error_setg(&err, args);
    +    error_setg(errp, args);
         ... when != err
         error_propagate(errp, err);

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20200707160613.848843-34-armbru@redhat.com>


  Commit: 668f62ec621e4e2919fb7d4caa5d805764c5852d
      
https://github.com/qemu/qemu/commit/668f62ec621e4e2919fb7d4caa5d805764c5852d
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

  Changed paths:
    M accel/kvm/kvm-all.c
    M accel/tcg/tcg-all.c
    M backends/cryptodev-vhost-user.c
    M backends/cryptodev.c
    M backends/hostmem-file.c
    M backends/hostmem-memfd.c
    M backends/hostmem.c
    M backends/tpm/tpm_util.c
    M block.c
    M block/curl.c
    M block/file-posix.c
    M block/parallels.c
    M block/qcow.c
    M block/qed.c
    M block/throttle-groups.c
    M block/vhdx.c
    M block/vmdk.c
    M block/vpc.c
    M blockdev.c
    M hw/arm/allwinner-a10.c
    M hw/arm/armsse.c
    M hw/arm/armv7m.c
    M hw/arm/aspeed_ast2600.c
    M hw/arm/aspeed_soc.c
    M hw/arm/bcm2835_peripherals.c
    M hw/arm/bcm2836.c
    M hw/arm/digic.c
    M hw/arm/fsl-imx25.c
    M hw/arm/fsl-imx31.c
    M hw/arm/fsl-imx6.c
    M hw/arm/msf2-soc.c
    M hw/arm/nrf51_soc.c
    M hw/arm/stm32f205_soc.c
    M hw/arm/stm32f405_soc.c
    M hw/arm/xlnx-zynqmp.c
    M hw/block/fdc.c
    M hw/block/xen-block.c
    M hw/char/serial-pci-multi.c
    M hw/char/serial-pci.c
    M hw/char/serial.c
    M hw/core/machine.c
    M hw/core/qdev-properties-system.c
    M hw/core/qdev-properties.c
    M hw/cpu/a15mpcore.c
    M hw/cpu/a9mpcore.c
    M hw/cpu/arm11mpcore.c
    M hw/cpu/core.c
    M hw/cpu/realview_mpcore.c
    M hw/display/virtio-gpu-pci.c
    M hw/display/virtio-vga.c
    M hw/gpio/aspeed_gpio.c
    M hw/i386/pc.c
    M hw/intc/apic_common.c
    M hw/intc/armv7m_nvic.c
    M hw/intc/pnv_xive.c
    M hw/intc/realview_gic.c
    M hw/intc/spapr_xive.c
    M hw/intc/xics_kvm.c
    M hw/isa/piix4.c
    M hw/mem/nvdimm.c
    M hw/microblaze/xlnx-zynqmp-pmu.c
    M hw/mips/cps.c
    M hw/misc/aspeed_sdmc.c
    M hw/misc/macio/cuda.c
    M hw/misc/macio/macio.c
    M hw/misc/macio/pmu.c
    M hw/misc/pca9552.c
    M hw/misc/tmp105.c
    M hw/misc/tmp421.c
    M hw/pci-host/pnv_phb3.c
    M hw/pci-host/pnv_phb4.c
    M hw/pci-host/pnv_phb4_pec.c
    M hw/ppc/e500.c
    M hw/ppc/pnv.c
    M hw/ppc/pnv_core.c
    M hw/ppc/pnv_psi.c
    M hw/ppc/spapr_caps.c
    M hw/ppc/spapr_drc.c
    M hw/ppc/spapr_irq.c
    M hw/riscv/opentitan.c
    M hw/riscv/sifive_e.c
    M hw/riscv/sifive_u.c
    M hw/s390x/css.c
    M hw/s390x/event-facility.c
    M hw/s390x/virtio-ccw-crypto.c
    M hw/s390x/virtio-ccw-rng.c
    M hw/scsi/scsi-bus.c
    M hw/sd/aspeed_sdhci.c
    M hw/smbios/smbios.c
    M hw/vfio/pci-quirks.c
    M hw/vfio/pci.c
    M hw/virtio/virtio-balloon.c
    M hw/virtio/virtio-rng-pci.c
    M hw/virtio/virtio-rng.c
    M iothread.c
    M net/colo-compare.c
    M net/dump.c
    M net/filter-buffer.c
    M net/tap.c
    M qapi/string-input-visitor.c
    M qdev-monitor.c
    M qga/commands-win32.c
    M qom/object.c
    M softmmu/vl.c
    M target/arm/cpu64.c
    M target/arm/monitor.c
    M target/i386/cpu.c
    M target/ppc/compat.c
    M target/s390x/cpu_models.c
    M target/sparc/cpu.c
    M tpm.c
    M util/main-loop.c
    M util/qemu-config.c
    M util/qemu-option.c

  Log Message:
  -----------
  error: Eliminate error_propagate() with Coccinelle, part 1

When all we do with an Error we receive into a local variable is
propagating to somewhere else, we can just as well receive it there
right away.  Convert

    if (!foo(..., &err)) {
        ...
        error_propagate(errp, err);
        ...
        return ...
    }

to

    if (!foo(..., errp)) {
        ...
        ...
        return ...
    }

where nothing else needs @err.  Coccinelle script:

    @rule1 forall@
    identifier fun, err, errp, lbl;
    expression list args, args2;
    binary operator op;
    constant c1, c2;
    symbol false;
    @@
         if (
    (
    -        fun(args, &err, args2)
    +        fun(args, errp, args2)
    |
    -        !fun(args, &err, args2)
    +        !fun(args, errp, args2)
    |
    -        fun(args, &err, args2) op c1
    +        fun(args, errp, args2) op c1
    )
            )
         {
             ... when != err
                 when != lbl:
                 when strict
    -        error_propagate(errp, err);
             ... when != err
    (
             return;
    |
             return c2;
    |
             return false;
    )
         }

    @rule2 forall@
    identifier fun, err, errp, lbl;
    expression list args, args2;
    expression var;
    binary operator op;
    constant c1, c2;
    symbol false;
    @@
    -    var = fun(args, &err, args2);
    +    var = fun(args, errp, args2);
         ... when != err
         if (
    (
             var
    |
             !var
    |
             var op c1
    )
            )
         {
             ... when != err
                 when != lbl:
                 when strict
    -        error_propagate(errp, err);
             ... when != err
    (
             return;
    |
             return c2;
    |
             return false;
    |
             return var;
    )
         }

    @depends on rule1 || rule2@
    identifier err;
    @@
    -    Error *err = NULL;
         ... when != err

Not exactly elegant, I'm afraid.

The "when != lbl:" is necessary to avoid transforming

         if (fun(args, &err)) {
             goto out
         }
         ...
     out:
         error_propagate(errp, err);

even though other paths to label out still need the error_propagate().
For an actual example, see sclp_realize().

Without the "when strict", Coccinelle transforms vfio_msix_setup(),
incorrectly.  I don't know what exactly "when strict" does, only that
it helps here.

The match of return is narrower than what I want, but I can't figure
out how to express "return where the operand doesn't use @err".  For
an example where it's too narrow, see vfio_intx_enable().

Silently fails to convert hw/arm/armsse.c, because Coccinelle gets
confused by ARMSSE being used both as typedef and function-like macro
there.  Converted manually.

Line breaks tidied up manually.  One nested declaration of @local_err
deleted manually.  Preexisting unwanted blank line dropped in
hw/riscv/sifive_e.c.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20200707160613.848843-35-armbru@redhat.com>


  Commit: af175e85f92c870386ad74f466e29537b79611d3
      
https://github.com/qemu/qemu/commit/af175e85f92c870386ad74f466e29537b79611d3
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

  Changed paths:
    M block.c
    M block/blkdebug.c
    M block/blklogwrites.c
    M block/blkverify.c
    M block/crypto.c
    M block/file-posix.c
    M block/file-win32.c
    M block/gluster.c
    M block/iscsi.c
    M block/nbd.c
    M block/qcow2.c
    M block/raw-format.c
    M block/sheepdog.c
    M block/ssh.c
    M block/throttle.c
    M block/vmdk.c
    M block/vpc.c
    M block/vvfat.c
    M blockdev.c
    M hw/intc/xics.c
    M hw/vfio/pci.c
    M net/tap.c
    M qom/object.c

  Log Message:
  -----------
  error: Eliminate error_propagate() with Coccinelle, part 2

When all we do with an Error we receive into a local variable is
propagating to somewhere else, we can just as well receive it there
right away.  The previous commit did that with a Coccinelle script I
consider fairly trustworthy.  This commit uses the same script with
the matching of return taken out, i.e. we convert

    if (!foo(..., &err)) {
        ...
        error_propagate(errp, err);
        ...
    }

to

    if (!foo(..., errp)) {
        ...
        ...
    }

This is unsound: @err could still be read between afterwards.  I don't
know how to express "no read of @err without an intervening write" in
Coccinelle.  Instead, I manually double-checked for uses of @err.

Suboptimal line breaks tweaked manually.  qdev_realize() simplified
further to placate scripts/checkpatch.pl.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20200707160613.848843-36-armbru@redhat.com>


  Commit: 992861fb1e4cf410f30ec8f05bd2dc2a14a5a027
      
https://github.com/qemu/qemu/commit/992861fb1e4cf410f30ec8f05bd2dc2a14a5a027
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

  Changed paths:
    M block/replication.c
    M blockdev.c
    M bootdevice.c
    M dump/dump.c
    M hw/block/fdc.c
    M hw/core/numa.c
    M hw/i386/x86.c
    M hw/intc/xive.c
    M hw/ppc/spapr_cpu_core.c
    M hw/s390x/s390-pci-bus.c
    M hw/s390x/s390-virtio-ccw.c
    M hw/s390x/sclp.c
    M hw/usb/bus.c
    M qdev-monitor.c
    M qga/commands-posix.c
    M qom/object.c
    M qom/qom-qobject.c
    M target/i386/cpu.c

  Log Message:
  -----------
  error: Eliminate error_propagate() manually

When all we do with an Error we receive into a local variable is
propagating to somewhere else, we can just as well receive it there
right away.  The previous two commits did that for sufficiently simple
cases with Coccinelle.  Do it for several more manually.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20200707160613.848843-37-armbru@redhat.com>


  Commit: a5f9b9df252d0dfb407178ef4c3769f78a64b2ff
      
https://github.com/qemu/qemu/commit/a5f9b9df252d0dfb407178ef4c3769f78a64b2ff
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

  Changed paths:
    M block.c
    M block/gluster.c
    M block/parallels.c
    M block/quorum.c
    M block/replication.c
    M block/vxhs.c
    M hw/core/qdev.c
    M hw/net/virtio-net.c

  Log Message:
  -----------
  error: Reduce unnecessary error propagation

When all we do with an Error we receive into a local variable is
propagating to somewhere else, we can just as well receive it there
right away, even when we need to keep error_propagate() for other
error paths.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20200707160613.848843-38-armbru@redhat.com>


  Commit: 4bc6d7ee0e95b879b7f4823b6e765cf9bf5845e7
      
https://github.com/qemu/qemu/commit/4bc6d7ee0e95b879b7f4823b6e765cf9bf5845e7
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

  Changed paths:
    M block/parallels.c

  Log Message:
  -----------
  block/parallels: Simplify parallels_open() after previous commit

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20200707160613.848843-39-armbru@redhat.com>


  Commit: b11a093c6025635b4504d79d30daa334a01279a5
      
https://github.com/qemu/qemu/commit/b11a093c6025635b4504d79d30daa334a01279a5
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

  Changed paths:
    M block/nfs.c
    M block/parallels.c
    M block/qcow.c
    M block/qcow2.c
    M block/qed.c
    M block/rbd.c
    M block/sheepdog.c
    M block/ssh.c
    M block/vdi.c
    M block/vhdx.c
    M block/vpc.c
    M hw/acpi/core.c
    M hw/block/xen-block.c
    M hw/core/numa.c
    M monitor/monitor.c

  Log Message:
  -----------
  qapi: Smooth another visitor error checking pattern

Convert

    visit_type_FOO(v, ..., &ptr, &err);
    ...
    if (err) {
        ...
    }

to

    visit_type_FOO(v, ..., &ptr, errp);
    ...
    if (!ptr) {
        ...
    }

for functions that set @ptr to non-null / null on success / error.

Eliminate error_propagate() that are now unnecessary.  Delete @err
that are now unused.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20200707160613.848843-40-armbru@redhat.com>


  Commit: cdd2b228b973d2a29edf7696ef6e8b08ec329019
      
https://github.com/qemu/qemu/commit/cdd2b228b973d2a29edf7696ef6e8b08ec329019
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

  Changed paths:
    M docs/devel/qapi-code-gen.txt
    M scripts/qapi/commands.py
    M scripts/qapi/visit.py

  Log Message:
  -----------
  qapi: Smooth visitor error checking in generated code

Use visitor functions' return values to check for failure.  Eliminate
error_propagate() that are now unnecessary.  Delete @err that are now
unused.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20200707160613.848843-41-armbru@redhat.com>


  Commit: 7b3cb8037c369cbc3072548ef0bd2cfa850bfae5
      
https://github.com/qemu/qemu/commit/7b3cb8037c369cbc3072548ef0bd2cfa850bfae5
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

  Changed paths:
    M qapi/qapi-visit-core.c

  Log Message:
  -----------
  qapi: Purge error_propagate() from QAPI core

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20200707160613.848843-42-armbru@redhat.com>


  Commit: 386f6c07d28cf1b51e5d0f398faf67d396ff62a1
      
https://github.com/qemu/qemu/commit/386f6c07d28cf1b51e5d0f398faf67d396ff62a1
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

  Changed paths:
    M block/parallels.c
    M block/qcow.c
    M block/vdi.c
    M block/vhdx.c
    M block/vmdk.c
    M block/vpc.c
    M block/vvfat.c
    M hw/display/virtio-gpu-base.c
    M hw/intc/arm_gic_kvm.c
    M hw/intc/arm_gicv3_its_kvm.c
    M hw/intc/arm_gicv3_kvm.c
    M hw/misc/ivshmem.c
    M hw/scsi/vhost-scsi.c

  Log Message:
  -----------
  error: Avoid error_propagate() after migrate_add_blocker()

When migrate_add_blocker(blocker, &errp) is followed by
error_propagate(errp, err), we can often just as well do
migrate_add_blocker(..., errp).

Do that with this Coccinelle script:

    @@
    expression blocker, err, errp;
    expression ret;
    @@
    -    ret = migrate_add_blocker(blocker, &err);
    -    if (err) {
    +    ret = migrate_add_blocker(blocker, errp);
    +    if (ret < 0) {
             ... when != err;
    -        error_propagate(errp, err);
             ...
         }

    @@
    expression blocker, err, errp;
    @@
    -    migrate_add_blocker(blocker, &err);
    -    if (err) {
    +    if (migrate_add_blocker(blocker, errp) < 0) {
             ... when != err;
    -        error_propagate(errp, err);
             ...
         }

Double-check @err is not used afterwards.  Dereferencing it would be
use after free, but checking whether it's null would be legitimate.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20200707160613.848843-43-armbru@redhat.com>


  Commit: 9e194e063f813b95bc01e69a5357c1c341ee93c5
      
https://github.com/qemu/qemu/commit/9e194e063f813b95bc01e69a5357c1c341ee93c5
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

  Changed paths:
    M qemu-img.c

  Log Message:
  -----------
  qemu-img: Ignore Error objects where the return value suffices

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20200707160613.848843-44-armbru@redhat.com>
[One more in img_amend() due to commit 0bc2a50e17 "qemu-option: Use
returned bool to check for failure"]


  Commit: 2d226cf6d18c853a3dca3fae1442be399caa2e6f
      
https://github.com/qemu/qemu/commit/2d226cf6d18c853a3dca3fae1442be399caa2e6f
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

  Changed paths:
    M hw/core/qdev-properties.c

  Log Message:
  -----------
  qdev: Ignore Error objects where the return value suffices

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20200707160613.848843-45-armbru@redhat.com>


  Commit: a43770df5dbbe90bbe8ccb25e7c570169d10710b
      
https://github.com/qemu/qemu/commit/a43770df5dbbe90bbe8ccb25e7c570169d10710b
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

  Changed paths:
    M qdev-monitor.c

  Log Message:
  -----------
  hmp: Ignore Error objects where the return value suffices

qdev_print_props() receives and throws away Error objects just to
check for object_property_get_str() and object_property_print()
failure.  Unnecessary, both return suitable values, so use those
instead.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20200707160613.848843-46-armbru@redhat.com>


  Commit: ae7c80a7bd73685437bf6ba9d7c26098351f4166
      
https://github.com/qemu/qemu/commit/ae7c80a7bd73685437bf6ba9d7c26098351f4166
  Author: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

  Changed paths:
    M include/qapi/error.h

  Log Message:
  -----------
  error: New macro ERRP_GUARD()

Introduce a new ERRP_GUARD() macro, to be used at start of functions
with an errp OUT parameter.

It has three goals:

1. Fix issue with error_fatal and error_prepend/error_append_hint: the
user can't see this additional information, because exit() happens in
error_setg earlier than information is added. [Reported by Greg Kurz]

2. Fix issue with error_abort and error_propagate: when we wrap
error_abort by local_err+error_propagate, the resulting coredump will
refer to error_propagate and not to the place where error happened.
(the macro itself doesn't fix the issue, but it allows us to [3.] drop
the local_err+error_propagate pattern, which will definitely fix the
issue) [Reported by Kevin Wolf]

3. Drop local_err+error_propagate pattern, which is used to workaround
void functions with errp parameter, when caller wants to know resulting
status. (Note: actually these functions could be merely updated to
return int error code).

To achieve these goals, later patches will add invocations
of this macro at the start of functions with either use
error_prepend/error_append_hint (solving 1) or which use
local_err+error_propagate to check errors, switching those
functions to use *errp instead (solving 2 and 3).

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Paul Durrant <paul@xen.org>
Reviewed-by: Greg Kurz <groug@kaod.org>
Reviewed-by: Eric Blake <eblake@redhat.com>
[Merge comments properly with recent commit "error: Document Error API
usage rules", and edit for clarity.  Put ERRP_AUTO_PROPAGATE() before
its helpers, and touch up style.  Tweak commit message.]
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20200707165037.1026246-2-armbru@redhat.com>
[Rename ERRP_AUTO_PROPAGATE() to ERRP_GUARD(), tweak commit message
again]


  Commit: 8220f3ac74a4698b0734aa882e74c5d9337e3d99
      
https://github.com/qemu/qemu/commit/8220f3ac74a4698b0734aa882e74c5d9337e3d99
  Author: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

  Changed paths:
    M MAINTAINERS
    M include/qapi/error.h
    A scripts/coccinelle/errp-guard.cocci

  Log Message:
  -----------
  scripts: Coccinelle script to use ERRP_GUARD()

Script adds ERRP_GUARD() macro invocations where appropriate and
does corresponding changes in code (look for details in
include/qapi/error.h)

Usage example:
spatch --sp-file scripts/coccinelle/errp-guard.cocci \
 --macro-file scripts/cocci-macro-file.h --in-place --no-show-diff \
 --max-width 80 FILES...

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20200707165037.1026246-3-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
[ERRP_AUTO_PROPAGATE() renamed to ERRP_GUARD(), and
auto-propagated-errp.cocci to errp-guard.cocci]


  Commit: de1b3800b7ec929f95371e6ab0345bf8b583043d
      
https://github.com/qemu/qemu/commit/de1b3800b7ec929f95371e6ab0345bf8b583043d
  Author: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

  Changed paths:
    M hw/sd/sdhci-pci.c
    M hw/sd/sdhci.c
    M hw/sd/ssi-sd.c

  Log Message:
  -----------
  sd: Use ERRP_GUARD()

If we want to check error after errp-function call, we need to
introduce local_err and then propagate it to errp. Instead, use
the ERRP_GUARD() macro, benefits are:
1. No need of explicit error_propagate call
2. No need of explicit local_err variable: use errp directly
3. ERRP_GUARD() leaves errp as is if it's not NULL or
   &error_fatal, this means that we don't break error_abort
   (we'll abort on error_set, not on error_propagate)

If we want to add some info to errp (by error_prepend() or
error_append_hint()), we must use the ERRP_GUARD() macro.
Otherwise, this info will not be added when errp == &error_fatal
(the program will exit prior to the error_append_hint() or
error_prepend() call).  No such cases are being fixed here.

This commit is generated by command

    sed -n '/^SD (Secure Card)$/,/^$/{s/^F: //p}' \
        MAINTAINERS | \
    xargs git ls-files | grep '\.[hc]$' | \
    xargs spatch \
        --sp-file scripts/coccinelle/errp-guard.cocci \
        --macro-file scripts/cocci-macro-file.h \
        --in-place --no-show-diff --max-width 80

Reported-by: Kevin Wolf <kwolf@redhat.com>
Reported-by: Greg Kurz <groug@kaod.org>
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
[Commit message tweaked]
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20200707165037.1026246-4-armbru@redhat.com>
[ERRP_AUTO_PROPAGATE() renamed to ERRP_GUARD(), and
auto-propagated-errp.cocci to errp-guard.cocci.  Commit message
tweaked again.]


  Commit: 76612456aad55c7a2a57aa533a6f935aedb55475
      
https://github.com/qemu/qemu/commit/76612456aad55c7a2a57aa533a6f935aedb55475
  Author: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

  Changed paths:
    M hw/block/pflash_cfi01.c
    M hw/block/pflash_cfi02.c

  Log Message:
  -----------
  pflash: Use ERRP_GUARD()

If we want to check error after errp-function call, we need to
introduce local_err and then propagate it to errp. Instead, use
the ERRP_GUARD() macro, benefits are:
1. No need of explicit error_propagate call
2. No need of explicit local_err variable: use errp directly
3. ERRP_GUARD() leaves errp as is if it's not NULL or
   &error_fatal, this means that we don't break error_abort
   (we'll abort on error_set, not on error_propagate)

If we want to add some info to errp (by error_prepend() or
error_append_hint()), we must use the ERRP_GUARD() macro.
Otherwise, this info will not be added when errp == &error_fatal
(the program will exit prior to the error_append_hint() or
error_prepend() call).  No such cases are being fixed here.

This commit is generated by command

    sed -n '/^Parallel NOR Flash devices$/,/^$/{s/^F: //p}' \
        MAINTAINERS | \
    xargs git ls-files | grep '\.[hc]$' | \
    xargs spatch \
        --sp-file scripts/coccinelle/errp-guard.cocci \
        --macro-file scripts/cocci-macro-file.h \
        --in-place --no-show-diff --max-width 80

Reported-by: Kevin Wolf <kwolf@redhat.com>
Reported-by: Greg Kurz <groug@kaod.org>
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
[Commit message tweaked]
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20200707165037.1026246-5-armbru@redhat.com>
[ERRP_AUTO_PROPAGATE() renamed to ERRP_GUARD(), and
auto-propagated-errp.cocci to errp-guard.cocci.  Commit message
tweaked again.]


  Commit: 8b4b52759a7c472ee3427d6c82f60091b6f69196
      
https://github.com/qemu/qemu/commit/8b4b52759a7c472ee3427d6c82f60091b6f69196
  Author: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

  Changed paths:
    M hw/nvram/fw_cfg.c

  Log Message:
  -----------
  fw_cfg: Use ERRP_GUARD()

If we want to check error after errp-function call, we need to
introduce local_err and then propagate it to errp. Instead, use
the ERRP_GUARD() macro, benefits are:
1. No need of explicit error_propagate call
2. No need of explicit local_err variable: use errp directly
3. ERRP_GUARD() leaves errp as is if it's not NULL or
   &error_fatal, this means that we don't break error_abort
   (we'll abort on error_set, not on error_propagate)

If we want to add some info to errp (by error_prepend() or
error_append_hint()), we must use the ERRP_GUARD() macro.
Otherwise, this info will not be added when errp == &error_fatal
(the program will exit prior to the error_append_hint() or
error_prepend() call).  No such cases are being fixed here.

This commit is generated by command

    sed -n '/^Firmware configuration (fw_cfg)$/,/^$/{s/^F: //p}' \
        MAINTAINERS | \
    xargs git ls-files | grep '\.[hc]$' | \
    xargs spatch \
        --sp-file scripts/coccinelle/errp-guard.cocci \
        --macro-file scripts/cocci-macro-file.h \
        --in-place --no-show-diff --max-width 80

Reported-by: Kevin Wolf <kwolf@redhat.com>
Reported-by: Greg Kurz <groug@kaod.org>
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
[Commit message tweaked]
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20200707165037.1026246-6-armbru@redhat.com>
[ERRP_AUTO_PROPAGATE() renamed to ERRP_GUARD(), and
auto-propagated-errp.cocci to errp-guard.cocci.  Commit message
tweaked again.  Coccinelle script rerun for commit 3203148917
"hw/nvram/fw_cfg: Add the FW_CFG_DATA_GENERATOR interface"]


  Commit: 92c451222c541ce2bdcd0483550f472ec5fcfb5f
      
https://github.com/qemu/qemu/commit/92c451222c541ce2bdcd0483550f472ec5fcfb5f
  Author: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

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

  Log Message:
  -----------
  virtio-9p: Use ERRP_GUARD()

If we want to check error after errp-function call, we need to
introduce local_err and then propagate it to errp. Instead, use
the ERRP_GUARD() macro, benefits are:
1. No need of explicit error_propagate call
2. No need of explicit local_err variable: use errp directly
3. ERRP_GUARD() leaves errp as is if it's not NULL or
   &error_fatal, this means that we don't break error_abort
   (we'll abort on error_set, not on error_propagate)

If we want to add some info to errp (by error_prepend() or
error_append_hint()), we must use the ERRP_GUARD() macro.
Otherwise, this info will not be added when errp == &error_fatal
(the program will exit prior to the error_append_hint() or
error_prepend() call).  Fix such a case in
v9fs_device_realize_common().

This commit is generated by command

    sed -n '/^virtio-9p$/,/^$/{s/^F: //p}' MAINTAINERS | \
    xargs git ls-files | grep '\.[hc]$' | \
    xargs spatch \
        --sp-file scripts/coccinelle/errp-guard.cocci \
        --macro-file scripts/cocci-macro-file.h \
        --in-place --no-show-diff --max-width 80

Reported-by: Kevin Wolf <kwolf@redhat.com>
Reported-by: Greg Kurz <groug@kaod.org>
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Acked-by: Greg Kurz <groug@kaod.org>
Reviewed-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
[Commit message tweaked]
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20200707165037.1026246-7-armbru@redhat.com>
[ERRP_AUTO_PROPAGATE() renamed to ERRP_GUARD(), and
auto-propagated-errp.cocci to errp-guard.cocci.  Commit message
tweaked again.]


  Commit: 795d946d0797e7ba28ed97c86e2592e346b02b0e
      
https://github.com/qemu/qemu/commit/795d946d0797e7ba28ed97c86e2592e346b02b0e
  Author: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

  Changed paths:
    M block/nbd.c
    M include/block/nbd.h
    M nbd/client.c
    M nbd/server.c

  Log Message:
  -----------
  nbd: Use ERRP_GUARD()

If we want to check error after errp-function call, we need to
introduce local_err and then propagate it to errp. Instead, use
the ERRP_GUARD() macro, benefits are:
1. No need of explicit error_propagate call
2. No need of explicit local_err variable: use errp directly
3. ERRP_GUARD() leaves errp as is if it's not NULL or
   &error_fatal, this means that we don't break error_abort
   (we'll abort on error_set, not on error_propagate)

If we want to add some info to errp (by error_prepend() or
error_append_hint()), we must use the ERRP_GUARD() macro.
Otherwise, this info will not be added when errp == &error_fatal
(the program will exit prior to the error_append_hint() or
error_prepend() call).  Fix several such cases, e.g. in nbd_read().

This commit is generated by command

    sed -n '/^Network Block Device (NBD)$/,/^$/{s/^F: //p}' \
        MAINTAINERS | \
    xargs git ls-files | grep '\.[hc]$' | \
    xargs spatch \
        --sp-file scripts/coccinelle/errp-guard.cocci \
        --macro-file scripts/cocci-macro-file.h \
        --in-place --no-show-diff --max-width 80

Reported-by: Kevin Wolf <kwolf@redhat.com>
Reported-by: Greg Kurz <groug@kaod.org>
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
[Commit message tweaked]
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20200707165037.1026246-8-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
[ERRP_AUTO_PROPAGATE() renamed to ERRP_GUARD(), and
auto-propagated-errp.cocci to errp-guard.cocci.  Commit message
tweaked again.]


  Commit: 1de7096d8378a57e2d75d9cacc9a119e7e41640d
      
https://github.com/qemu/qemu/commit/1de7096d8378a57e2d75d9cacc9a119e7e41640d
  Author: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

  Changed paths:
    M hw/block/dataplane/xen-block.c
    M hw/block/xen-block.c
    M hw/pci-host/xen_igd_pt.c
    M hw/xen/xen-backend.c
    M hw/xen/xen-bus.c
    M hw/xen/xen-host-pci-device.c
    M hw/xen/xen_pt.c
    M hw/xen/xen_pt_config_init.c

  Log Message:
  -----------
  xen: Use ERRP_GUARD()

If we want to check error after errp-function call, we need to
introduce local_err and then propagate it to errp. Instead, use
the ERRP_GUARD() macro, benefits are:
1. No need of explicit error_propagate call
2. No need of explicit local_err variable: use errp directly
3. ERRP_GUARD() leaves errp as is if it's not NULL or
   &error_fatal, this means that we don't break error_abort
   (we'll abort on error_set, not on error_propagate)

If we want to add some info to errp (by error_prepend() or
error_append_hint()), we must use the ERRP_GUARD() macro.
Otherwise, this info will not be added when errp == &error_fatal
(the program will exit prior to the error_append_hint() or
error_prepend() call).  No such cases are being fixed here.

This commit is generated by command

    sed -n '/^X86 Xen CPUs$/,/^$/{s/^F: //p}' MAINTAINERS | \
    xargs git ls-files | grep '\.[hc]$' | \
    xargs spatch \
        --sp-file scripts/coccinelle/errp-guard.cocci \
        --macro-file scripts/cocci-macro-file.h \
        --in-place --no-show-diff --max-width 80

Reported-by: Kevin Wolf <kwolf@redhat.com>
Reported-by: Greg Kurz <groug@kaod.org>
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
[Commit message tweaked]
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20200707165037.1026246-9-armbru@redhat.com>
[ERRP_AUTO_PROPAGATE() renamed to ERRP_GUARD(), and
auto-propagated-errp.cocci to errp-guard.cocci.  Commit message
tweaked again.]


  Commit: f2a1cf9180f63e88bb38ff21c169da97c3f2bad5
      
https://github.com/qemu/qemu/commit/f2a1cf9180f63e88bb38ff21c169da97c3f2bad5
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

  Changed paths:
    M MAINTAINERS
    M accel/kvm/kvm-all.c
    M accel/tcg/tcg-all.c
    M audio/audio_legacy.c
    M backends/cryptodev-vhost-user.c
    M backends/cryptodev.c
    M backends/hostmem-file.c
    M backends/hostmem-memfd.c
    M backends/hostmem.c
    M backends/rng.c
    M backends/tpm/tpm_util.c
    M block.c
    M block/blkdebug.c
    M block/blklogwrites.c
    M block/blkverify.c
    M block/crypto.c
    M block/curl.c
    M block/file-posix.c
    M block/file-win32.c
    M block/gluster.c
    M block/iscsi.c
    M block/nbd.c
    M block/nfs.c
    M block/parallels.c
    M block/qcow.c
    M block/qcow2.c
    M block/qed.c
    M block/quorum.c
    M block/raw-format.c
    M block/rbd.c
    M block/replication.c
    M block/sheepdog.c
    M block/ssh.c
    M block/throttle-groups.c
    M block/throttle.c
    M block/vdi.c
    M block/vhdx.c
    M block/vmdk.c
    M block/vpc.c
    M block/vvfat.c
    M block/vxhs.c
    M blockdev.c
    M bootdevice.c
    M chardev/char.c
    M contrib/ivshmem-server/main.c
    M crypto/secret.c
    M crypto/secret_keyring.c
    M crypto/tlscredsanon.c
    M crypto/tlscredspsk.c
    M crypto/tlscredsx509.c
    M docs/devel/qapi-code-gen.txt
    M dump/dump.c
    M hw/9pfs/9p-local.c
    M hw/9pfs/9p.c
    M hw/acpi/core.c
    M hw/acpi/cpu_hotplug.c
    M hw/acpi/ich9.c
    M hw/acpi/piix4.c
    M hw/arm/allwinner-a10.c
    M hw/arm/armsse.c
    M hw/arm/armv7m.c
    M hw/arm/aspeed.c
    M hw/arm/aspeed_ast2600.c
    M hw/arm/aspeed_soc.c
    M hw/arm/bcm2835_peripherals.c
    M hw/arm/bcm2836.c
    M hw/arm/cubieboard.c
    M hw/arm/digic.c
    M hw/arm/digic_boards.c
    M hw/arm/exynos4210.c
    M hw/arm/fsl-imx25.c
    M hw/arm/fsl-imx31.c
    M hw/arm/fsl-imx6.c
    M hw/arm/fsl-imx6ul.c
    M hw/arm/fsl-imx7.c
    M hw/arm/highbank.c
    M hw/arm/integratorcp.c
    M hw/arm/mcimx6ul-evk.c
    M hw/arm/microbit.c
    M hw/arm/mps2-tz.c
    M hw/arm/mps2.c
    M hw/arm/msf2-soc.c
    M hw/arm/musca.c
    M hw/arm/musicpal.c
    M hw/arm/nrf51_soc.c
    M hw/arm/orangepi.c
    M hw/arm/raspi.c
    M hw/arm/realview.c
    M hw/arm/sbsa-ref.c
    M hw/arm/stellaris.c
    M hw/arm/stm32f205_soc.c
    M hw/arm/stm32f405_soc.c
    M hw/arm/versatilepb.c
    M hw/arm/vexpress.c
    M hw/arm/virt.c
    M hw/arm/xilinx_zynq.c
    M hw/arm/xlnx-versal-virt.c
    M hw/arm/xlnx-versal.c
    M hw/arm/xlnx-zcu102.c
    M hw/arm/xlnx-zynqmp.c
    M hw/block/dataplane/xen-block.c
    M hw/block/fdc.c
    M hw/block/pflash_cfi01.c
    M hw/block/pflash_cfi02.c
    M hw/block/xen-block.c
    M hw/char/serial-pci-multi.c
    M hw/char/serial-pci.c
    M hw/char/serial.c
    M hw/core/bus.c
    M hw/core/cpu.c
    M hw/core/machine.c
    M hw/core/numa.c
    M hw/core/platform-bus.c
    M hw/core/qdev-properties-system.c
    M hw/core/qdev-properties.c
    M hw/core/qdev.c
    M hw/cpu/a15mpcore.c
    M hw/cpu/a9mpcore.c
    M hw/cpu/arm11mpcore.c
    M hw/cpu/core.c
    M hw/cpu/realview_mpcore.c
    M hw/display/bcm2835_fb.c
    M hw/display/virtio-gpu-base.c
    M hw/display/virtio-gpu-pci.c
    M hw/display/virtio-vga.c
    M hw/dma/bcm2835_dma.c
    M hw/dma/sparc32_dma.c
    M hw/dma/xilinx_axidma.c
    M hw/gpio/aspeed_gpio.c
    M hw/gpio/bcm2835_gpio.c
    M hw/hyperv/vmbus.c
    M hw/i386/pc.c
    M hw/i386/pc_piix.c
    M hw/i386/pc_q35.c
    M hw/i386/x86.c
    M hw/ide/qdev.c
    M hw/intc/apic_common.c
    M hw/intc/arm_gic_kvm.c
    M hw/intc/arm_gicv3_its_kvm.c
    M hw/intc/arm_gicv3_kvm.c
    M hw/intc/armv7m_nvic.c
    M hw/intc/nios2_iic.c
    M hw/intc/pnv_xive.c
    M hw/intc/realview_gic.c
    M hw/intc/spapr_xive.c
    M hw/intc/xics.c
    M hw/intc/xics_kvm.c
    M hw/intc/xive.c
    M hw/isa/piix4.c
    M hw/m68k/q800.c
    M hw/mem/nvdimm.c
    M hw/mem/pc-dimm.c
    M hw/microblaze/petalogix_ml605_mmu.c
    M hw/microblaze/petalogix_s3adsp1800_mmu.c
    M hw/microblaze/xlnx-zynqmp-pmu.c
    M hw/mips/boston.c
    M hw/mips/cps.c
    M hw/mips/jazz.c
    M hw/mips/malta.c
    M hw/misc/aspeed_sdmc.c
    M hw/misc/bcm2835_mbox.c
    M hw/misc/bcm2835_property.c
    M hw/misc/iotkit-sysctl.c
    M hw/misc/ivshmem.c
    M hw/misc/macio/cuda.c
    M hw/misc/macio/macio.c
    M hw/misc/macio/pmu.c
    M hw/misc/pca9552.c
    M hw/misc/tmp105.c
    M hw/misc/tmp421.c
    M hw/net/ne2000-isa.c
    M hw/net/virtio-net.c
    M hw/net/xilinx_axienet.c
    M hw/nvram/fw_cfg.c
    M hw/pci-host/pnv_phb3.c
    M hw/pci-host/pnv_phb4.c
    M hw/pci-host/pnv_phb4_pec.c
    M hw/pci-host/prep.c
    M hw/pci-host/xen_igd_pt.c
    M hw/ppc/e500.c
    M hw/ppc/mac_newworld.c
    M hw/ppc/mac_oldworld.c
    M hw/ppc/pnv.c
    M hw/ppc/pnv_core.c
    M hw/ppc/pnv_psi.c
    M hw/ppc/rs6000_mc.c
    M hw/ppc/spapr.c
    M hw/ppc/spapr_caps.c
    M hw/ppc/spapr_cpu_core.c
    M hw/ppc/spapr_drc.c
    M hw/ppc/spapr_hcall.c
    M hw/ppc/spapr_irq.c
    M hw/ppc/spapr_pci.c
    M hw/ppc/spapr_pci_nvlink2.c
    M hw/riscv/opentitan.c
    M hw/riscv/sifive_e.c
    M hw/riscv/sifive_u.c
    M hw/riscv/spike.c
    M hw/riscv/virt.c
    M hw/rx/rx-gdbsim.c
    M hw/s390x/css.c
    M hw/s390x/event-facility.c
    M hw/s390x/ipl.c
    M hw/s390x/s390-pci-bus.c
    M hw/s390x/s390-skeys.c
    M hw/s390x/s390-stattrib.c
    M hw/s390x/s390-virtio-ccw.c
    M hw/s390x/sclp.c
    M hw/s390x/virtio-ccw-crypto.c
    M hw/s390x/virtio-ccw-rng.c
    M hw/scsi/scsi-bus.c
    M hw/scsi/vhost-scsi.c
    M hw/sd/aspeed_sdhci.c
    M hw/sd/sd.c
    M hw/sd/sdhci-pci.c
    M hw/sd/sdhci.c
    M hw/sd/ssi-sd.c
    M hw/smbios/smbios.c
    M hw/sparc/sun4m.c
    M hw/sparc64/sun4u.c
    M hw/usb/bus.c
    M hw/usb/dev-storage.c
    M hw/usb/hcd-dwc2.c
    M hw/vfio/pci-quirks.c
    M hw/vfio/pci.c
    M hw/virtio/virtio-balloon.c
    M hw/virtio/virtio-crypto-pci.c
    M hw/virtio/virtio-iommu-pci.c
    M hw/virtio/virtio-mem-pci.c
    M hw/virtio/virtio-pmem-pci.c
    M hw/virtio/virtio-rng-pci.c
    M hw/virtio/virtio-rng.c
    M hw/xen/xen-backend.c
    M hw/xen/xen-bus.c
    M hw/xen/xen-host-pci-device.c
    M hw/xen/xen_pt.c
    M hw/xen/xen_pt_config_init.c
    M include/block/nbd.h
    M include/hw/audio/pcspk.h
    M include/hw/qdev-properties.h
    M include/qapi/clone-visitor.h
    M include/qapi/error.h
    M include/qapi/visitor-impl.h
    M include/qapi/visitor.h
    M include/qemu/option.h
    M include/qom/object.h
    M include/qom/object_interfaces.h
    M include/qom/qom-qobject.h
    M iothread.c
    M linux-user/syscall.c
    M monitor/hmp-cmds.c
    M monitor/monitor.c
    M nbd/client.c
    M nbd/server.c
    M net/colo-compare.c
    M net/dump.c
    M net/filter-buffer.c
    M net/filter.c
    M net/net.c
    M net/tap.c
    M qapi/opts-visitor.c
    M qapi/qapi-clone-visitor.c
    M qapi/qapi-dealloc-visitor.c
    M qapi/qapi-visit-core.c
    M qapi/qobject-input-visitor.c
    M qapi/qobject-output-visitor.c
    M qapi/string-input-visitor.c
    M qapi/string-output-visitor.c
    M qdev-monitor.c
    M qemu-img.c
    M qga/commands-posix.c
    M qga/commands-win32.c
    M qom/object.c
    M qom/object_interfaces.c
    M qom/qom-hmp-cmds.c
    M qom/qom-qmp-cmds.c
    M qom/qom-qobject.c
    A scripts/coccinelle/errp-guard.cocci
    M scripts/qapi/commands.py
    M scripts/qapi/visit.py
    M softmmu/vl.c
    M target/arm/cpu64.c
    M target/arm/monitor.c
    M target/i386/cpu.c
    M target/ppc/compat.c
    M target/ppc/translate_init.inc.c
    M target/s390x/cpu_models.c
    M target/sparc/cpu.c
    M tpm.c
    M ui/console.c
    M ui/vnc.c
    M util/main-loop.c
    M util/qemu-config.c
    M util/qemu-option.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/armbru/tags/pull-error-2020-07-07-v2' 
into staging

Error reporting patches patches for 2020-07-07

# gpg: Signature made Fri 10 Jul 2020 14:24:42 BST
# gpg:                using RSA key 354BC8B3D7EB2A6B68674E5F3870B400EB918653
# gpg:                issuer "armbru@redhat.com"
# gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" [full]
# gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>" [full]
# Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867  4E5F 3870 B400 EB91 8653

* remotes/armbru/tags/pull-error-2020-07-07-v2: (53 commits)
  xen: Use ERRP_GUARD()
  nbd: Use ERRP_GUARD()
  virtio-9p: Use ERRP_GUARD()
  fw_cfg: Use ERRP_GUARD()
  pflash: Use ERRP_GUARD()
  sd: Use ERRP_GUARD()
  scripts: Coccinelle script to use ERRP_GUARD()
  error: New macro ERRP_GUARD()
  hmp: Ignore Error objects where the return value suffices
  qdev: Ignore Error objects where the return value suffices
  qemu-img: Ignore Error objects where the return value suffices
  error: Avoid error_propagate() after migrate_add_blocker()
  qapi: Purge error_propagate() from QAPI core
  qapi: Smooth visitor error checking in generated code
  qapi: Smooth another visitor error checking pattern
  block/parallels: Simplify parallels_open() after previous commit
  error: Reduce unnecessary error propagation
  error: Eliminate error_propagate() manually
  error: Eliminate error_propagate() with Coccinelle, part 2
  error: Eliminate error_propagate() with Coccinelle, part 1
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>


Compare: https://github.com/qemu/qemu/compare/b6d7e9b66f59...f2a1cf9180f6



reply via email to

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