[RFC 00/15] Error API: Flag errors in *errp even if errors are being ignored

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
41 messages Options
123
Reply | Threaded
Open this post in threaded view
|

[RFC 00/15] Error API: Flag errors in *errp even if errors are being ignored

Eduardo Habkost-2
Rationale
---------

I'm often bothered by the fact that we can't write the following:

    foo(arg, errp);
    if (*errp) {
        handle the error...
        error_propagate(errp, err);
    }

because errp can be NULL.

I understand the reason we need to support errp==NULL, as it
makes life simpler for callers that don't want any extra error
information.  However, this has the cost of making the functions
that report errors more complex and error-prone.

(Evidence of that: the 34 ERR_IS_* cases handled by the "use
ERR_IS_* macros" patches in the series.  Where existing code will
crash or behave differently if errp is NULL.)

I considered suggesting forbidding NULL errp, and just changing
all callers that use NULL to have an err variable and call
error_free(), but this would mean changing 690 function callers
that pass NULL errp as argument.

Here I'm proposing a mechanism to have the best of both worlds:
allow callers to ignore errors easily while allowing functions to
propagate errors without an intermediate local_err variable.

The Proposal
------------

I'm proposing replacing NULL errp with a special macro:
IGNORE_ERRORS.  The macro will trigger special behavior in the
error API that will make it not save any error information in the
error pointer, but still keep track of boolean error state in
*errp.

This will allow us to simplify the documented method to propagate errors
from:

    Error *err = NULL;
    foo(arg, &err);
    if (err) {
        handle the error...
        error_propagate(errp, err);
    }

to:

    foo(arg, errp);
    if (ERR_IS_SET(errp)) {
        handle the error...
    }

This will allow us to stop using local_err variables and
error_propagate() on hundreds of cases.

Implementation
--------------

This replaces NULL errp arguments on function calls with a
IGNORE_ERRORS macro.  Checks for (!errp) are replaced by
ERR_IS_IGNORED(errp).  Checks for (*errp) are replaced by
ERR_IS_SET(errp).  No extra changes are required on function
callers.

Then IGNORE_ERRORS is implemend as:

  (& { &ignored_error_unset })

When error_set() is called and IGNORE_ERRORS was used, we set
error state using:

  *errp = &ignored_error_set;

This way, we can make ERR_IS_SET work even if errp was
IGNORE_ERRORS.  The ERR_IS_* macros are reimplemented as:

  #define ERR_IS_SET(e) (*(e) && *(e) != &ignored_error_unset)
  #define ERR_IS_IGNORED(e) (!(e) || *(e) == &ignored_error_unset || *(e) == &ignored_error_set)

Ensuring errp is never NULL
---------------------------

The last patch on this series changes the (Error **errp)
parameters in functions to (Error *errp[static 1]), just to help
validate the existing code, as clang warns about NULL arguments
on that case.  I don't think we should apply that patch, though,
because the "[static 1]" syntax confuses Coccinelle.

I have a branch where I experimented with the idea of replacing
(Error **errp) parameters with an opaque type (void*, or a struct
type).  I gave up when I noticed it would require touching all
callers to replace &err with a wrapper macro to convert to the
right type.  Suggestions to make NULL errp easier to detect at
build time are welcome.

(Probably the easiest solution for that is to add assert(errp)
lines to the ERR_IS_*() macros.)

Desirable side-effects
----------------------

Some of additional benefits from parts of this series:

* Making code that ignore error information more visible and
  greppable (using IGNORE_ERRORS).  I believe many of those cases
  are actually bugs and should use &error_abort or &error_fatal
  instead.

* Making code that depends on errp more visible and
  greppable (using ERR_IS_* macros).  Some of those cases are
  also likely to be bugs, and need to be investigated.

TODO
----

* Simplify more cases of local_error/error_propagate() to use
  errp directly.
* Update API documentation and code examples.
* Add a mechanism to ensure errp is never NULL.

Git branch
----------

This series depend on a few extra cleanups that I didn't submit
to qemu-devel yet.  A git branch including this series is
available at:

  git://github.com/ehabkost/qemu-hacks.git work/err-api-rework-ignore-ptr-v1

Eduardo Habkost (15):
  tests: Test cases for error API
  error: New IGNORE_ERRORS macro
  Add qapi/error.h includes on files that will need it
  [coccinelle] Use IGNORE_ERRORS instead of NULL as errp argument
  qapi: Use IGNORE_ERRORS instead of NULL on generated code
  test-qapi-util: Use IGNORE_ERRORS instead of NULL
  Manual changes to use IGNORE_ERRORS instead of NULL
  error: New ERR_IS_* macros for checking Error** values
  [coccinelle] Use ERR_IS_* macros
  test-qapi-util: Use ERR_IS_* macros
  Manual changes to use ERR_IS_* macros
  error: Make IGNORED_ERRORS not a NULL pointer
  rdma: Simplify var declaration to avoid confusing Coccinelle
  [coccinelle] Eliminate unnecessary local_err/error_propagate() usage
  [test only] Use 'Error *err[static 1]' instead of 'Error **errp' to
    catch NULL errp arguments

 include/qapi/visitor.h                  |  47 ++++---
 scripts/qapi-commands.py                |   6 +-
 scripts/qapi-types.py                   |   3 +-
 block/nbd-client.h                      |   2 +-
 block/qcow2.h                           |   8 +-
 block/vhdx.h                            |   2 +-
 crypto/blockpriv.h                      |   4 +-
 crypto/hmac.h                           |  10 +-
 crypto/tlscredspriv.h                   |   4 +-
 hw/9pfs/9p.h                            |   4 +-
 hw/block/dataplane/virtio-blk.h         |   2 +-
 hw/s390x/s390-virtio.h                  |   2 +-
 hw/timer/m48t59-internal.h              |   2 +-
 hw/usb/hcd-ehci.h                       |   4 +-
 hw/vfio/pci.h                           |   4 +-
 hw/xen/xen-host-pci-device.h            |   2 +-
 hw/xen/xen_pt.h                         |   4 +-
 include/block/aio.h                     |   4 +-
 include/block/block.h                   |  69 ++++++----
 include/block/block_backup.h            |   2 +-
 include/block/block_int.h               |  19 +--
 include/block/blockjob.h                |  11 +-
 include/block/blockjob_int.h            |   3 +-
 include/block/dirty-bitmap.h            |   8 +-
 include/block/nbd.h                     |  13 +-
 include/block/qapi.h                    |   7 +-
 include/block/snapshot.h                |  12 +-
 include/chardev/char-fd.h               |   2 +-
 include/chardev/char-fe.h               |   4 +-
 include/chardev/char-win.h              |   3 +-
 include/chardev/char.h                  |   9 +-
 include/crypto/afsplit.h                |   4 +-
 include/crypto/block.h                  |  10 +-
 include/crypto/cipher.h                 |   8 +-
 include/crypto/hash.h                   |  12 +-
 include/crypto/init.h                   |   2 +-
 include/crypto/ivgen.h                  |   2 +-
 include/crypto/pbkdf.h                  |   4 +-
 include/crypto/random.h                 |   4 +-
 include/crypto/secret.h                 |   6 +-
 include/crypto/tlssession.h             |   6 +-
 include/exec/memory.h                   |  12 +-
 include/exec/ram_addr.h                 |  12 +-
 include/hw/acpi/acpi.h                  |   4 +-
 include/hw/acpi/cpu.h                   |   7 +-
 include/hw/acpi/cpu_hotplug.h           |   3 +-
 include/hw/acpi/ich9.h                  |   9 +-
 include/hw/acpi/memory_hotplug.h        |   6 +-
 include/hw/acpi/pcihp.h                 |   4 +-
 include/hw/audio/pcspk.h                |   3 +-
 include/hw/block/block.h                |   4 +-
 include/hw/boards.h                     |   2 +-
 include/hw/char/serial.h                |   2 +-
 include/hw/hotplug.h                    |   8 +-
 include/hw/i386/pc.h                    |   2 +-
 include/hw/isa/isa.h                    |   6 +-
 include/hw/loader.h                     |   3 +-
 include/hw/mem/pc-dimm.h                |  10 +-
 include/hw/nmi.h                        |   2 +-
 include/hw/pci/msi.h                    |   2 +-
 include/hw/pci/msix.h                   |   4 +-
 include/hw/pci/pci.h                    |   2 +-
 include/hw/pci/pcie.h                   |   5 +-
 include/hw/pci/pcie_aer.h               |   2 +-
 include/hw/pci/shpc.h                   |   5 +-
 include/hw/ppc/pnv_xscom.h              |   2 +-
 include/hw/ppc/xics.h                   |   7 +-
 include/hw/qdev-core.h                  |   8 +-
 include/hw/qdev-properties.h            |  10 +-
 include/hw/s390x/css.h                  |   4 +-
 include/hw/scsi/scsi.h                  |   3 +-
 include/hw/smbios/smbios.h              |   2 +-
 include/hw/usb.h                        |   8 +-
 include/hw/vfio/vfio-common.h           |   5 +-
 include/hw/virtio/vhost-scsi-common.h   |   2 +-
 include/hw/virtio/virtio-bus.h          |   2 +-
 include/hw/virtio/virtio-scsi.h         |   6 +-
 include/hw/xen/xen.h                    |   2 +-
 include/io/channel-command.h            |   2 +-
 include/io/channel-file.h               |   2 +-
 include/io/channel-socket.h             |  14 +-
 include/io/channel-tls.h                |   4 +-
 include/io/channel-util.h               |   2 +-
 include/io/channel.h                    |  20 +--
 include/io/dns-resolver.h               |   2 +-
 include/io/task.h                       |   2 +-
 include/migration/blocker.h             |   2 +-
 include/migration/failover.h            |   2 +-
 include/migration/migration.h           |   4 +-
 include/migration/snapshot.h            |   4 +-
 include/migration/vmstate.h             |   5 +-
 include/monitor/monitor.h               |   6 +-
 include/monitor/qdev.h                  |   4 +-
 include/net/net.h                       |   6 +-
 include/qapi/error.h                    |  23 +++-
 include/qapi/qmp/json-parser.h          |   3 +-
 include/qapi/qmp/qdict.h                |   2 +-
 include/qapi/qmp/qjson.h                |   5 +-
 include/qapi/qobject-input-visitor.h    |   2 +-
 include/qapi/util.h                     |   2 +-
 include/qemu/base64.h                   |   2 +-
 include/qemu/config-file.h              |   4 +-
 include/qemu/log.h                      |   4 +-
 include/qemu/main-loop.h                |   2 +-
 include/qemu/option.h                   |  30 ++--
 include/qemu/sockets.h                  |  33 +++--
 include/qemu/throttle.h                 |   2 +-
 include/qom/cpu.h                       |   4 +-
 include/qom/object.h                    |  89 ++++++------
 include/qom/object_interfaces.h         |  12 +-
 include/qom/qom-qobject.h               |   4 +-
 include/sysemu/arch_init.h              |   8 +-
 include/sysemu/block-backend.h          |  19 +--
 include/sysemu/cpus.h                   |   4 +-
 include/sysemu/cryptodev.h              |   8 +-
 include/sysemu/device_tree.h            |   6 +-
 include/sysemu/hostmem.h                |   2 +-
 include/sysemu/memory_mapping.h         |   2 +-
 include/sysemu/numa.h                   |   5 +-
 include/sysemu/qtest.h                  |   3 +-
 include/sysemu/sysemu.h                 |  10 +-
 include/sysemu/tpm_backend.h            |   2 +-
 include/ui/console.h                    |  14 +-
 include/ui/input.h                      |   2 +-
 include/ui/qemu-spice.h                 |   2 +-
 migration/block.h                       |   2 +-
 migration/exec.h                        |   5 +-
 migration/fd.h                          |   4 +-
 migration/rdma.h                        |   5 +-
 migration/savevm.h                      |   2 +-
 migration/socket.h                      |   9 +-
 migration/tls.h                         |   4 +-
 nbd/nbd-internal.h                      |   6 +-
 net/clients.h                           |  20 +--
 net/tap_int.h                           |   5 +-
 qga/guest-agent-core.h                  |   4 +-
 qga/vss-win32.h                         |   2 +-
 replication.h                           |   8 +-
 target/i386/cpu.h                       |   2 +-
 target/ppc/cpu.h                        |   5 +-
 target/s390x/cpu.h                      |  10 +-
 target/s390x/cpu_models.h               |   9 +-
 qapi/qapi-visit-core.c                  |  64 +++++----
 arch_init.c                             |   2 +-
 backends/cryptodev-builtin.c            |  15 +-
 backends/cryptodev.c                    |  24 ++--
 backends/hostmem-file.c                 |  11 +-
 backends/hostmem-ram.c                  |   2 +-
 backends/hostmem.c                      |  45 +++---
 backends/rng-egd.c                      |   9 +-
 backends/rng-random.c                   |   8 +-
 backends/rng.c                          |  15 +-
 backends/tpm.c                          |  15 +-
 balloon.c                               |   6 +-
 block.c                                 | 150 ++++++++++----------
 block/backup.c                          |  13 +-
 block/blkdebug.c                        |  33 +++--
 block/blkreplay.c                       |   2 +-
 block/blkverify.c                       |   4 +-
 block/block-backend.c                   |  31 +++--
 block/bochs.c                           |   4 +-
 block/cloop.c                           |   4 +-
 block/commit.c                          |  35 +++--
 block/crypto.c                          |  32 ++---
 block/curl.c                            |  10 +-
 block/dirty-bitmap.c                    |   9 +-
 block/dmg.c                             |   6 +-
 block/file-posix.c                      |  52 +++----
 block/file-win32.c                      |  18 +--
 block/gluster.c                         |  23 ++--
 block/io.c                              |  13 +-
 block/iscsi.c                           |  58 ++++----
 block/mirror.c                          |  30 ++--
 block/nbd-client.c                      |  12 +-
 block/nbd.c                             |  36 +++--
 block/nfs.c                             |  37 ++---
 block/null.c                            |   4 +-
 block/parallels.c                       |  12 +-
 block/qapi.c                            |  19 ++-
 block/qcow.c                            |  15 +-
 block/qcow2-cluster.c                   |   2 +-
 block/qcow2-refcount.c                  |   8 +-
 block/qcow2-snapshot.c                  |   4 +-
 block/qcow2.c                           |  44 +++---
 block/qed.c                             |  21 +--
 block/quorum.c                          |  11 +-
 block/raw-format.c                      |  20 +--
 block/rbd.c                             |  29 ++--
 block/replication.c                     |  46 +++----
 block/sheepdog.c                        |  65 ++++-----
 block/snapshot.c                        |  14 +-
 block/ssh.c                             |  43 +++---
 block/stream.c                          |  10 +-
 block/vdi.c                             |   7 +-
 block/vhdx-log.c                        |   4 +-
 block/vhdx.c                            |  13 +-
 block/vmdk.c                            |  33 +++--
 block/vpc.c                             |  11 +-
 block/vvfat.c                           |  12 +-
 block/vxhs.c                            |   6 +-
 block/write-threshold.c                 |   2 +-
 blockdev-nbd.c                          |  13 +-
 blockdev.c                              | 184 ++++++++++++-------------
 blockjob.c                              |  35 +++--
 bootdevice.c                            |  27 ++--
 bsd-user/elfload.c                      |   4 +-
 chardev/baum.c                          |   2 +-
 chardev/char-console.c                  |   2 +-
 chardev/char-fd.c                       |   4 +-
 chardev/char-fe.c                       |   4 +-
 chardev/char-file.c                     |   4 +-
 chardev/char-io.c                       |   3 +-
 chardev/char-mux.c                      |   4 +-
 chardev/char-null.c                     |   2 +-
 chardev/char-parallel.c                 |   8 +-
 chardev/char-pipe.c                     |   8 +-
 chardev/char-pty.c                      |   4 +-
 chardev/char-ringbuf.c                  |   8 +-
 chardev/char-serial.c                   |   6 +-
 chardev/char-socket.c                   |  30 ++--
 chardev/char-stdio.c                    |   4 +-
 chardev/char-udp.c                      |   8 +-
 chardev/char-win-stdio.c                |   2 +-
 chardev/char-win.c                      |   3 +-
 chardev/char.c                          |  25 ++--
 chardev/msmouse.c                       |   2 +-
 chardev/spice.c                         |   8 +-
 chardev/wctablet.c                      |   2 +-
 cpus.c                                  |  12 +-
 crypto/afsplit.c                        |   6 +-
 crypto/block-luks.c                     |  22 +--
 crypto/block-qcow.c                     |  10 +-
 crypto/block.c                          |  14 +-
 crypto/cipher-builtin.c                 |  24 ++--
 crypto/cipher-gcrypt.c                  |   8 +-
 crypto/cipher-nettle.c                  |   8 +-
 crypto/cipher.c                         |   2 +-
 crypto/hash-gcrypt.c                    |   2 +-
 crypto/hash-glib.c                      |   2 +-
 crypto/hash-nettle.c                    |   2 +-
 crypto/hash.c                           |  10 +-
 crypto/hmac-gcrypt.c                    |   4 +-
 crypto/hmac-glib.c                      |   8 +-
 crypto/hmac-nettle.c                    |   4 +-
 crypto/hmac.c                           |   6 +-
 crypto/init.c                           |   2 +-
 crypto/ivgen-essiv.c                    |   4 +-
 crypto/ivgen-plain.c                    |   4 +-
 crypto/ivgen-plain64.c                  |   4 +-
 crypto/ivgen.c                          |   4 +-
 crypto/pbkdf-gcrypt.c                   |   2 +-
 crypto/pbkdf-nettle.c                   |   2 +-
 crypto/pbkdf-stub.c                     |   2 +-
 crypto/pbkdf.c                          |   4 +-
 crypto/random-gcrypt.c                  |   4 +-
 crypto/random-gnutls.c                  |   4 +-
 crypto/random-platform.c                |   4 +-
 crypto/secret.c                         |  50 +++----
 crypto/tlscreds.c                       |  28 ++--
 crypto/tlscredsanon.c                   |  14 +-
 crypto/tlscredsx509.c                   |  44 +++---
 crypto/tlssession.c                     |  18 +--
 device_tree.c                           |   8 +-
 dump.c                                  | 207 ++++++++++------------------
 exec.c                                  |  40 +++---
 fsdev/qemu-fsdev-throttle.c             |   3 +-
 gdbstub.c                               |   2 +-
 hmp.c                                   |  68 ++++-----
 hw/9pfs/9p.c                            |   4 +-
 hw/9pfs/virtio-9p-device.c              |   7 +-
 hw/9pfs/xen-9p-backend.c                |  12 +-
 hw/acpi/acpi-stub.c                     |   2 +-
 hw/acpi/core.c                          |   6 +-
 hw/acpi/cpu.c                           |   9 +-
 hw/acpi/cpu_hotplug.c                   |   7 +-
 hw/acpi/ich9.c                          |  51 +++----
 hw/acpi/memory_hotplug.c                |  19 +--
 hw/acpi/nvdimm.c                        |  17 +--
 hw/acpi/pcihp.c                         |   4 +-
 hw/acpi/piix4.c                         |  28 ++--
 hw/acpi/vmgenid.c                       |  12 +-
 hw/arm/allwinner-a10.c                  |  30 ++--
 hw/arm/armv7m.c                         |  30 ++--
 hw/arm/aspeed.c                         |   4 +-
 hw/arm/aspeed_soc.c                     |  25 ++--
 hw/arm/bcm2835_peripherals.c            |  33 +++--
 hw/arm/bcm2836.c                        |   5 +-
 hw/arm/digic.c                          |  30 ++--
 hw/arm/exynos4210.c                     |   2 +-
 hw/arm/fsl-imx25.c                      |  63 ++++-----
 hw/arm/fsl-imx31.c                      |  58 ++++----
 hw/arm/fsl-imx6.c                       | 110 +++++++--------
 hw/arm/highbank.c                       |   2 +-
 hw/arm/integratorcp.c                   |   4 +-
 hw/arm/musicpal.c                       |   4 +-
 hw/arm/pxa2xx.c                         |   2 +-
 hw/arm/pxa2xx_gpio.c                    |   2 +-
 hw/arm/realview.c                       |   2 +-
 hw/arm/spitz.c                          |   4 +-
 hw/arm/stm32f205_soc.c                  |   2 +-
 hw/arm/strongarm.c                      |   2 +-
 hw/arm/tosa.c                           |   2 +-
 hw/arm/versatilepb.c                    |   2 +-
 hw/arm/vexpress.c                       |  13 +-
 hw/arm/virt.c                           |  62 +++++----
 hw/arm/xilinx_zynq.c                    |   2 +-
 hw/arm/xlnx-zynqmp.c                    |  14 +-
 hw/arm/z2.c                             |   2 +-
 hw/audio/ac97.c                         |   2 +-
 hw/audio/adlib.c                        |   2 +-
 hw/audio/cs4231a.c                      |   2 +-
 hw/audio/es1370.c                       |   2 +-
 hw/audio/gus.c                          |   2 +-
 hw/audio/intel-hda.c                    |   6 +-
 hw/audio/marvell_88w8618.c              |   2 +-
 hw/audio/milkymist-ac97.c               |   2 +-
 hw/audio/pcspk.c                        |   2 +-
 hw/audio/pl041.c                        |   2 +-
 hw/audio/sb16.c                         |   2 +-
 hw/block/block.c                        |   4 +-
 hw/block/dataplane/virtio-blk.c         |   2 +-
 hw/block/fdc.c                          |  37 ++---
 hw/block/m25p80.c                       |   2 +-
 hw/block/nand.c                         |   2 +-
 hw/block/nvme.c                         |   2 +-
 hw/block/pflash_cfi01.c                 |   8 +-
 hw/block/pflash_cfi02.c                 |   8 +-
 hw/block/virtio-blk.c                   |  27 ++--
 hw/bt/hci-csr.c                         |   2 +-
 hw/char/bcm2835_aux.c                   |   2 +-
 hw/char/cadence_uart.c                  |   2 +-
 hw/char/debugcon.c                      |  10 +-
 hw/char/digic-uart.c                    |   2 +-
 hw/char/escc.c                          |   2 +-
 hw/char/etraxfs_ser.c                   |   2 +-
 hw/char/exynos4210_uart.c               |   2 +-
 hw/char/imx_serial.c                    |   2 +-
 hw/char/ipoctal232.c                    |   2 +-
 hw/char/lm32_juart.c                    |   2 +-
 hw/char/lm32_uart.c                     |   2 +-
 hw/char/mcf_uart.c                      |   2 +-
 hw/char/milkymist-uart.c                |   2 +-
 hw/char/parallel.c                      |   2 +-
 hw/char/pl011.c                         |   2 +-
 hw/char/serial-isa.c                    |   2 +-
 hw/char/serial-pci.c                    |  16 +--
 hw/char/serial.c                        |   2 +-
 hw/char/spapr_vty.c                     |   2 +-
 hw/char/stm32f2xx_usart.c               |   2 +-
 hw/char/terminal3270.c                  |   2 +-
 hw/char/virtio-console.c                |   4 +-
 hw/char/virtio-serial-bus.c             |  22 +--
 hw/char/xilinx_uartlite.c               |   2 +-
 hw/core/bus.c                           |  19 +--
 hw/core/generic-loader.c                |   4 +-
 hw/core/hotplug.c                       |   8 +-
 hw/core/loader.c                        |   3 +-
 hw/core/machine.c                       |  99 +++++++------
 hw/core/nmi.c                           |   2 +-
 hw/core/or-irq.c                        |   2 +-
 hw/core/platform-bus.c                  |   8 +-
 hw/core/qdev-properties-system.c        |  52 +++----
 hw/core/qdev-properties.c               | 112 +++++++--------
 hw/core/qdev.c                          |  61 ++++----
 hw/core/sysbus.c                        |   6 +-
 hw/cpu/a15mpcore.c                      |  10 +-
 hw/cpu/a9mpcore.c                       |  30 ++--
 hw/cpu/arm11mpcore.c                    |  23 ++--
 hw/cpu/core.c                           |  24 ++--
 hw/cpu/realview_mpcore.c                |  13 +-
 hw/display/ads7846.c                    |   2 +-
 hw/display/bcm2835_fb.c                 |   2 +-
 hw/display/cg3.c                        |   2 +-
 hw/display/cirrus_vga.c                 |   4 +-
 hw/display/exynos4210_fimd.c            |   2 +-
 hw/display/jazz_led.c                   |   2 +-
 hw/display/milkymist-tmu2.c             |   2 +-
 hw/display/milkymist-vgafb.c            |   2 +-
 hw/display/pl110.c                      |   2 +-
 hw/display/qxl.c                        |  12 +-
 hw/display/sm501.c                      |   4 +-
 hw/display/ssd0323.c                    |   2 +-
 hw/display/tcx.c                        |   2 +-
 hw/display/vga-isa.c                    |   2 +-
 hw/display/vga-pci.c                    |  16 ++-
 hw/display/virtio-gpu-pci.c             |   3 +-
 hw/display/virtio-gpu.c                 |  14 +-
 hw/display/virtio-vga.c                 |   9 +-
 hw/display/vmware_vga.c                 |   2 +-
 hw/display/xlnx_dp.c                    |   4 +-
 hw/dma/bcm2835_dma.c                    |   2 +-
 hw/dma/i82374.c                         |   2 +-
 hw/dma/i8257.c                          |   2 +-
 hw/dma/pl330.c                          |   2 +-
 hw/dma/pxa2xx_dma.c                     |   2 +-
 hw/dma/rc4030.c                         |   4 +-
 hw/dma/sparc32_dma.c                    |   2 +-
 hw/dma/xilinx_axidma.c                  |   2 +-
 hw/gpio/bcm2835_gpio.c                  |   2 +-
 hw/gpio/gpio_key.c                      |   2 +-
 hw/gpio/imx_gpio.c                      |   2 +-
 hw/gpio/omap_gpio.c                     |   4 +-
 hw/i2c/aspeed_i2c.c                     |   2 +-
 hw/i2c/imx_i2c.c                        |   2 +-
 hw/i2c/omap_i2c.c                       |   2 +-
 hw/i2c/smbus_ich9.c                     |   2 +-
 hw/i386/acpi-build.c                    |  51 ++++---
 hw/i386/amd_iommu.c                     |   2 +-
 hw/i386/intel_iommu.c                   |   4 +-
 hw/i386/kvm/apic.c                      |   4 +-
 hw/i386/kvm/clock.c                     |   2 +-
 hw/i386/kvm/i8254.c                     |   2 +-
 hw/i386/kvm/i8259.c                     |   2 +-
 hw/i386/kvm/ioapic.c                    |   2 +-
 hw/i386/kvm/pci-assign.c                |  29 ++--
 hw/i386/kvmvapic.c                      |   2 +-
 hw/i386/pc.c                            |  84 ++++++-----
 hw/i386/pc_q35.c                        |  16 ++-
 hw/i386/x86-iommu.c                     |   2 +-
 hw/i386/xen/xen-hvm.c                   |   4 +-
 hw/i386/xen/xen_apic.c                  |   2 +-
 hw/i386/xen/xen_platform.c              |   2 +-
 hw/i386/xen/xen_pvdevice.c              |   2 +-
 hw/ide/ahci.c                           |   2 +-
 hw/ide/cmd646.c                         |   2 +-
 hw/ide/core.c                           |   2 +-
 hw/ide/ich.c                            |   5 +-
 hw/ide/isa.c                            |   2 +-
 hw/ide/macio.c                          |   2 +-
 hw/ide/microdrive.c                     |   2 +-
 hw/ide/mmio.c                           |   2 +-
 hw/ide/piix.c                           |   2 +-
 hw/ide/qdev.c                           |  12 +-
 hw/ide/via.c                            |   2 +-
 hw/input/adb.c                          |   6 +-
 hw/input/pckbd.c                        |   2 +-
 hw/input/virtio-input-hid.c             |   9 +-
 hw/input/virtio-input-host.c            |   5 +-
 hw/input/virtio-input.c                 |  20 ++-
 hw/input/vmmouse.c                      |   2 +-
 hw/intc/apic.c                          |   4 +-
 hw/intc/apic_common.c                   |  18 ++-
 hw/intc/arm_gic.c                       |   8 +-
 hw/intc/arm_gic_common.c                |   2 +-
 hw/intc/arm_gic_kvm.c                   |  13 +-
 hw/intc/arm_gicv2m.c                    |   2 +-
 hw/intc/arm_gicv3.c                     |   8 +-
 hw/intc/arm_gicv3_common.c              |   5 +-
 hw/intc/arm_gicv3_its_kvm.c             |   8 +-
 hw/intc/arm_gicv3_kvm.c                 |  13 +-
 hw/intc/armv7m_nvic.c                   |   8 +-
 hw/intc/aspeed_vic.c                    |   2 +-
 hw/intc/exynos4210_gic.c                |   3 +-
 hw/intc/grlib_irqmp.c                   |   2 +-
 hw/intc/i8259.c                         |   2 +-
 hw/intc/i8259_common.c                  |   2 +-
 hw/intc/ioapic.c                        |   2 +-
 hw/intc/ioapic_common.c                 |   2 +-
 hw/intc/mips_gic.c                      |   2 +-
 hw/intc/nios2_iic.c                     |   2 +-
 hw/intc/omap_intc.c                     |   4 +-
 hw/intc/openpic.c                       |   2 +-
 hw/intc/openpic_kvm.c                   |   2 +-
 hw/intc/realview_gic.c                  |   8 +-
 hw/intc/s390_flic.c                     |   4 +-
 hw/intc/s390_flic_kvm.c                 |   5 +-
 hw/intc/xics.c                          |   8 +-
 hw/intc/xics_kvm.c                      |   8 +-
 hw/intc/xics_pnv.c                      |   2 +-
 hw/intc/xics_spapr.c                    |   5 +-
 hw/ipack/ipack.c                        |   8 +-
 hw/ipack/tpci200.c                      |   2 +-
 hw/ipmi/ipmi.c                          |   5 +-
 hw/ipmi/ipmi_bmc_extern.c               |   2 +-
 hw/ipmi/ipmi_bmc_sim.c                  |   2 +-
 hw/ipmi/isa_ipmi_bt.c                   |   6 +-
 hw/ipmi/isa_ipmi_kcs.c                  |   4 +-
 hw/isa/i82378.c                         |   2 +-
 hw/isa/isa-bus.c                        |   2 +-
 hw/isa/lpc_ich9.c                       |  13 +-
 hw/isa/pc87312.c                        |   2 +-
 hw/isa/piix4.c                          |   2 +-
 hw/isa/vt82c686.c                       |   8 +-
 hw/mem/nvdimm.c                         |   8 +-
 hw/mem/pc-dimm.c                        |  24 ++--
 hw/microblaze/petalogix_ml605_mmu.c     |  14 +-
 hw/mips/boston.c                        |   2 +-
 hw/mips/cps.c                           |   2 +-
 hw/mips/gt64xxx_pci.c                   |   2 +-
 hw/mips/mips_malta.c                    |   3 +-
 hw/misc/applesmc.c                      |   2 +-
 hw/misc/arm11scu.c                      |   2 +-
 hw/misc/arm_sysctl.c                    |   2 +-
 hw/misc/aspeed_scu.c                    |   2 +-
 hw/misc/aspeed_sdmc.c                   |   2 +-
 hw/misc/auxbus.c                        |   3 +-
 hw/misc/bcm2835_mbox.c                  |   2 +-
 hw/misc/bcm2835_property.c              |   2 +-
 hw/misc/debugexit.c                     |   2 +-
 hw/misc/eccmemctl.c                     |   2 +-
 hw/misc/edu.c                           |   7 +-
 hw/misc/hyperv_testdev.c                |   2 +-
 hw/misc/imx6_src.c                      |   2 +-
 hw/misc/ivshmem.c                       |  49 ++++---
 hw/misc/macio/cuda.c                    |   2 +-
 hw/misc/macio/macio.c                   |  45 +++---
 hw/misc/max111x.c                       |   4 +-
 hw/misc/mips_cmgcr.c                    |   2 +-
 hw/misc/mips_cpc.c                      |   2 +-
 hw/misc/mips_itu.c                      |   2 +-
 hw/misc/pc-testdev.c                    |   2 +-
 hw/misc/pci-testdev.c                   |   2 +-
 hw/misc/pvpanic.c                       |   5 +-
 hw/misc/sga.c                           |   2 +-
 hw/misc/tmp105.c                        |  12 +-
 hw/misc/unimp.c                         |   2 +-
 hw/misc/vmport.c                        |   2 +-
 hw/net/allwinner_emac.c                 |   2 +-
 hw/net/cadence_gem.c                    |   2 +-
 hw/net/dp8393x.c                        |   8 +-
 hw/net/e1000.c                          |   5 +-
 hw/net/e1000e.c                         |  11 +-
 hw/net/eepro100.c                       |   5 +-
 hw/net/fsl_etsec/etsec.c                |   2 +-
 hw/net/ftgmac100.c                      |   2 +-
 hw/net/imx_fec.c                        |   2 +-
 hw/net/lance.c                          |   3 +-
 hw/net/mcf_fec.c                        |   2 +-
 hw/net/ne2000-isa.c                     |  10 +-
 hw/net/ne2000.c                         |   5 +-
 hw/net/pcnet-pci.c                      |   5 +-
 hw/net/rocker/qmp-norocker.c            |   9 +-
 hw/net/rocker/rocker.c                  |   5 +-
 hw/net/rocker/rocker_of_dpa.c           |   2 +-
 hw/net/rtl8139.c                        |   5 +-
 hw/net/spapr_llan.c                     |   5 +-
 hw/net/virtio-net.c                     |  10 +-
 hw/net/vmxnet3.c                        |  11 +-
 hw/net/xilinx_axienet.c                 |   2 +-
 hw/net/xilinx_ethlite.c                 |   2 +-
 hw/nvram/fw_cfg.c                       |  21 ++-
 hw/nvram/mac_nvram.c                    |   4 +-
 hw/nvram/spapr_nvram.c                  |   2 +-
 hw/pci-bridge/dec.c                     |   4 +-
 hw/pci-bridge/gen_pcie_root_port.c      |   2 +-
 hw/pci-bridge/ioh3420.c                 |   2 +-
 hw/pci-bridge/pci_bridge_dev.c          |   4 +-
 hw/pci-bridge/pci_expander_bridge.c     |  16 +--
 hw/pci-bridge/pcie_root_port.c          |   2 +-
 hw/pci-host/apb.c                       |   4 +-
 hw/pci-host/bonito.c                    |   2 +-
 hw/pci-host/gpex.c                      |   5 +-
 hw/pci-host/grackle.c                   |   2 +-
 hw/pci-host/piix.c                      |  28 ++--
 hw/pci-host/ppce500.c                   |   2 +-
 hw/pci-host/prep.c                      |   6 +-
 hw/pci-host/q35.c                       |  39 +++---
 hw/pci-host/uninorth.c                  |   9 +-
 hw/pci-host/versatile.c                 |   4 +-
 hw/pci-host/xilinx-pcie.c               |   7 +-
 hw/pci/msi.c                            |   2 +-
 hw/pci/msix.c                           |   4 +-
 hw/pci/pci-stub.c                       |   2 +-
 hw/pci/pci.c                            |  44 +++---
 hw/pci/pcie.c                           |  10 +-
 hw/pci/pcie_aer.c                       |   2 +-
 hw/pci/shpc.c                           |  22 ++-
 hw/pcmcia/pxa2xx.c                      |   3 +-
 hw/ppc/e500.c                           |  11 +-
 hw/ppc/mac_newworld.c                   |   2 +-
 hw/ppc/mac_oldworld.c                   |   2 +-
 hw/ppc/pnv.c                            |  52 +++----
 hw/ppc/pnv_core.c                       |  25 ++--
 hw/ppc/pnv_lpc.c                        |   2 +-
 hw/ppc/pnv_occ.c                        |   2 +-
 hw/ppc/pnv_psi.c                        |   5 +-
 hw/ppc/pnv_xscom.c                      |   2 +-
 hw/ppc/prep.c                           |   9 +-
 hw/ppc/prep_systemio.c                  |   2 +-
 hw/ppc/rs6000_mc.c                      |   2 +-
 hw/ppc/spapr.c                          |  89 ++++++------
 hw/ppc/spapr_cpu_core.c                 |   9 +-
 hw/ppc/spapr_drc.c                      |  66 +++++----
 hw/ppc/spapr_hcall.c                    |   2 +-
 hw/ppc/spapr_iommu.c                    |   7 +-
 hw/ppc/spapr_pci.c                      |  30 ++--
 hw/ppc/spapr_rng.c                      |   6 +-
 hw/ppc/spapr_rtc.c                      |   9 +-
 hw/ppc/spapr_vio.c                      |   2 +-
 hw/s390x/3270-ccw.c                     |   2 +-
 hw/s390x/ccw-device.c                   |   2 +-
 hw/s390x/css-bridge.c                   |   8 +-
 hw/s390x/css.c                          |  18 ++-
 hw/s390x/event-facility.c               |  12 +-
 hw/s390x/ipl.c                          |   7 +-
 hw/s390x/s390-ccw.c                     |   7 +-
 hw/s390x/s390-pci-bus.c                 |  20 +--
 hw/s390x/s390-skeys.c                   |  16 ++-
 hw/s390x/s390-virtio-ccw.c              |  49 +++----
 hw/s390x/s390-virtio.c                  |   4 +-
 hw/s390x/sclp.c                         |   9 +-
 hw/s390x/virtio-ccw.c                   |  61 ++++----
 hw/scsi/esp-pci.c                       |  10 +-
 hw/scsi/esp.c                           |   2 +-
 hw/scsi/lsi53c895a.c                    |   4 +-
 hw/scsi/megasas.c                       |   4 +-
 hw/scsi/mptsas.c                        |   2 +-
 hw/scsi/scsi-bus.c                      |  34 ++---
 hw/scsi/scsi-disk.c                     |  24 ++--
 hw/scsi/scsi-generic.c                  |   2 +-
 hw/scsi/spapr_vscsi.c                   |   2 +-
 hw/scsi/vhost-scsi-common.c             |   2 +-
 hw/scsi/vhost-scsi.c                    |  17 +--
 hw/scsi/virtio-scsi-dataplane.c         |   2 +-
 hw/scsi/virtio-scsi.c                   |  22 +--
 hw/scsi/vmw_pvscsi.c                    |  10 +-
 hw/sd/pl181.c                           |   2 +-
 hw/sd/sd.c                              |   4 +-
 hw/sd/sdhci.c                           |   4 +-
 hw/sd/ssi-sd.c                          |   2 +-
 hw/sh4/sh_pci.c                         |   2 +-
 hw/smbios/smbios-stub.c                 |   2 +-
 hw/smbios/smbios.c                      |   2 +-
 hw/sparc/sun4m.c                        |   4 +-
 hw/sparc64/sun4u.c                      |   6 +-
 hw/ssi/aspeed_smc.c                     |   2 +-
 hw/ssi/imx_spi.c                        |   2 +-
 hw/ssi/ssi.c                            |   2 +-
 hw/ssi/xilinx_spips.c                   |   4 +-
 hw/timer/a9gtimer.c                     |   2 +-
 hw/timer/altera_timer.c                 |   2 +-
 hw/timer/arm_mptimer.c                  |   2 +-
 hw/timer/arm_timer.c                    |   2 +-
 hw/timer/aspeed_timer.c                 |   2 +-
 hw/timer/hpet.c                         |   2 +-
 hw/timer/i8254.c                        |   2 +-
 hw/timer/i8254_common.c                 |   2 +-
 hw/timer/imx_epit.c                     |   2 +-
 hw/timer/imx_gpt.c                      |   2 +-
 hw/timer/lm32_timer.c                   |   2 +-
 hw/timer/m48t59-isa.c                   |   2 +-
 hw/timer/m48t59.c                       |   4 +-
 hw/timer/mc146818rtc.c                  |  14 +-
 hw/timer/milkymist-sysctl.c             |   2 +-
 hw/timer/pxa2xx_timer.c                 |   2 +-
 hw/timer/xilinx_timer.c                 |   2 +-
 hw/tpm/tpm_tis.c                        |   2 +-
 hw/usb/bus.c                            |  64 ++++-----
 hw/usb/dev-audio.c                      |   4 +-
 hw/usb/dev-bluetooth.c                  |   4 +-
 hw/usb/dev-hid.c                        |  13 +-
 hw/usb/dev-hub.c                        |   4 +-
 hw/usb/dev-mtp.c                        |   2 +-
 hw/usb/dev-network.c                    |   6 +-
 hw/usb/dev-serial.c                     |   8 +-
 hw/usb/dev-smartcard-reader.c           |   4 +-
 hw/usb/dev-storage.c                    |  18 +--
 hw/usb/dev-uas.c                        |   4 +-
 hw/usb/dev-wacom.c                      |   4 +-
 hw/usb/hcd-ehci-pci.c                   |   7 +-
 hw/usb/hcd-ehci-sysbus.c                |   2 +-
 hw/usb/hcd-ehci.c                       |   6 +-
 hw/usb/hcd-ohci.c                       |  18 +--
 hw/usb/hcd-uhci.c                       |  10 +-
 hw/usb/hcd-xhci.c                       |   4 +-
 hw/usb/host-libusb.c                    |   6 +-
 hw/usb/redirect.c                       |   6 +-
 hw/vfio/amd-xgbe.c                      |   2 +-
 hw/vfio/calxeda-xgmac.c                 |   2 +-
 hw/vfio/ccw.c                           |  14 +-
 hw/vfio/common.c                        |   7 +-
 hw/vfio/pci-quirks.c                    |   6 +-
 hw/vfio/pci.c                           |  35 +++--
 hw/vfio/platform.c                      |   9 +-
 hw/virtio/vhost-vsock.c                 |   8 +-
 hw/virtio/virtio-balloon.c              |  25 ++--
 hw/virtio/virtio-bus.c                  |   2 +-
 hw/virtio/virtio-crypto-pci.c           |   5 +-
 hw/virtio/virtio-crypto.c               |  12 +-
 hw/virtio/virtio-mmio.c                 |   2 +-
 hw/virtio/virtio-pci.c                  |  48 ++++---
 hw/virtio/virtio-rng.c                  |  20 +--
 hw/virtio/virtio.c                      |  24 ++--
 hw/watchdog/watchdog.c                  |   3 +-
 hw/watchdog/wdt_aspeed.c                |   2 +-
 hw/watchdog/wdt_diag288.c               |   4 +-
 hw/watchdog/wdt_i6300esb.c              |   2 +-
 hw/watchdog/wdt_ib700.c                 |   2 +-
 hw/xen/xen-host-pci-device.c            |  12 +-
 hw/xen/xen_backend.c                    |   4 +-
 hw/xen/xen_pt.c                         |   2 +-
 hw/xen/xen_pt_config_init.c             |   4 +-
 hw/xen/xen_pt_graphics.c                |   2 +-
 hw/xen/xen_pvdev.c                      |   3 +-
 io/channel-buffer.c                     |  10 +-
 io/channel-command.c                    |  16 +--
 io/channel-file.c                       |  12 +-
 io/channel-socket.c                     |  30 ++--
 io/channel-tls.c                        |  18 +--
 io/channel-util.c                       |   2 +-
 io/channel-websock.c                    |  26 ++--
 io/channel.c                            |  20 +--
 io/dns-resolver.c                       |   6 +-
 io/task.c                               |   2 +-
 iothread.c                              |   8 +-
 linux-user/elfload.c                    |   4 +-
 linux-user/uname.c                      |   3 +-
 memory.c                                |  21 +--
 memory_mapping.c                        |   2 +-
 migration/block.c                       |   3 +-
 migration/colo-failover.c               |   4 +-
 migration/colo.c                        |  38 +++--
 migration/exec.c                        |   5 +-
 migration/fd.c                          |   5 +-
 migration/migration.c                   |  43 +++---
 migration/qemu-file-channel.c           |  11 +-
 migration/ram.c                         |   4 +-
 migration/rdma.c                        |  40 +++---
 migration/savevm.c                      |  14 +-
 migration/socket.c                      |  18 +--
 migration/tls.c                         |   6 +-
 monitor.c                               |  57 ++++----
 nbd/client.c                            |  29 ++--
 nbd/common.c                            |   2 +-
 nbd/server.c                            |  22 +--
 net/colo-compare.c                      |  25 ++--
 net/dump.c                              |  19 +--
 net/filter-buffer.c                     |  11 +-
 net/filter-mirror.c                     |  22 +--
 net/filter-rewriter.c                   |   2 +-
 net/filter.c                            |  30 ++--
 net/hub.c                               |   2 +-
 net/l2tpv3.c                            |   2 +-
 net/net.c                               |  31 +++--
 net/netmap.c                            |   5 +-
 net/slirp.c                             |   2 +-
 net/socket.c                            |   2 +-
 net/tap-bsd.c                           |  10 +-
 net/tap-linux.c                         |   5 +-
 net/tap-solaris.c                       |   7 +-
 net/tap-stub.c                          |   5 +-
 net/tap-win32.c                         |   2 +-
 net/tap.c                               |  21 ++-
 net/vde.c                               |   2 +-
 net/vhost-user.c                        |   7 +-
 numa.c                                  |  21 +--
 qapi/opts-visitor.c                     |  28 ++--
 qapi/qapi-clone-visitor.c               |  20 +--
 qapi/qapi-dealloc-visitor.c             |  22 +--
 qapi/qapi-util.c                        |   2 +-
 qapi/qmp-dispatch.c                     |   5 +-
 qapi/qobject-input-visitor.c            |  50 ++++---
 qapi/qobject-output-visitor.c           |  20 +--
 qapi/string-input-visitor.c             |  25 ++--
 qapi/string-output-visitor.c            |  14 +-
 qdev-monitor.c                          |  35 +++--
 qemu-img.c                              |  28 ++--
 qemu-io.c                               |   2 +-
 qemu-nbd.c                              |   7 +-
 qga/commands-posix.c                    | 222 ++++++++++++++----------------
 qga/commands-win32.c                    | 101 +++++++-------
 qga/commands.c                          |  16 +--
 qga/main.c                              |   4 +-
 qga/vss-win32.c                         |   2 +-
 qmp.c                                   |  87 ++++++------
 qobject/json-parser.c                   |   5 +-
 qobject/qdict.c                         |   4 +-
 qobject/qjson.c                         |   5 +-
 qom/container.c                         |   3 +-
 qom/cpu.c                               |  10 +-
 qom/object.c                            | 237 +++++++++++++++-----------------
 qom/object_interfaces.c                 |  15 +-
 qom/qom-qobject.c                       |   4 +-
 qtest.c                                 |   3 +-
 replication.c                           |  32 ++---
 stubs/arch-query-cpu-def.c              |   2 +-
 stubs/arch-query-cpu-model-baseline.c   |   2 +-
 stubs/arch-query-cpu-model-comparison.c |   2 +-
 stubs/arch-query-cpu-model-expansion.c  |   2 +-
 stubs/migr-blocker.c                    |   2 +-
 stubs/monitor.c                         |   2 +-
 stubs/uuid.c                            |   2 +-
 stubs/vmgenid.c                         |   2 +-
 stubs/vmstate.c                         |   2 +-
 stubs/xen-hvm.c                         |   4 +-
 target/alpha/cpu.c                      |  10 +-
 target/arm/cpu.c                        |   8 +-
 target/arm/cpu64.c                      |   9 +-
 target/arm/helper.c                     |   2 +-
 target/arm/monitor.c                    |   2 +-
 target/cris/cpu.c                       |   8 +-
 target/hppa/cpu.c                       |  10 +-
 target/i386/arch_memory_mapping.c       |   2 +-
 target/i386/cpu.c                       | 133 +++++++++---------
 target/lm32/cpu.c                       |   8 +-
 target/m68k/cpu.c                       |   8 +-
 target/m68k/helper.c                    |   3 +-
 target/microblaze/cpu.c                 |   8 +-
 target/microblaze/translate.c           |   3 +-
 target/mips/cpu.c                       |   8 +-
 target/mips/translate.c                 |   3 +-
 target/moxie/cpu.c                      |   8 +-
 target/nios2/cpu.c                      |  10 +-
 target/openrisc/cpu.c                   |   8 +-
 target/ppc/compat.c                     |   5 +-
 target/ppc/kvm.c                        |   4 +-
 target/ppc/translate_init.c             |  35 ++---
 target/s390x/cpu.c                      |  14 +-
 target/s390x/cpu_models.c               |  79 ++++++-----
 target/s390x/helper.c                   |   7 +-
 target/s390x/kvm.c                      |  10 +-
 target/sh4/cpu.c                        |   8 +-
 target/sparc/cpu.c                      |  14 +-
 target/tilegx/cpu.c                     |  10 +-
 target/tricore/cpu.c                    |   8 +-
 target/unicore32/cpu.c                  |   8 +-
 target/xtensa/cpu.c                     |   8 +-
 target/xtensa/helper.c                  |   3 +-
 tests/check-qom-proplist.c              |  29 ++--
 tests/io-channel-helpers.c              |   4 +-
 tests/test-char.c                       |   2 +-
 tests/test-crypto-block.c               |   6 +-
 tests/test-crypto-hash.c                |   3 +-
 tests/test-crypto-tlscredsx509.c        |   4 +-
 tests/test-crypto-tlssession.c          |   2 +-
 tests/test-io-channel-socket.c          |   2 +-
 tests/test-io-channel-tls.c             |  13 +-
 tests/test-logging.c                    |   3 +-
 tests/test-qapi-util.c                  | 101 +++++++++++++-
 tests/test-qdev-global-props.c          |   9 +-
 tests/test-qemu-opts.c                  |   6 +-
 tests/test-qmp-commands.c               |  17 +--
 tests/test-qmp-event.c                  |   3 +-
 tests/test-string-input-visitor.c       |  12 +-
 tests/test-visitor-serialization.c      |  25 ++--
 tpm.c                                   |  10 +-
 trace/qmp.c                             |   8 +-
 ui/console.c                            |  12 +-
 ui/gtk.c                                |  15 +-
 ui/input-legacy.c                       |   2 +-
 ui/input-linux.c                        |  20 +--
 ui/input.c                              |   6 +-
 ui/spice-core.c                         |   7 +-
 ui/vnc-auth-sasl.c                      |   6 +-
 ui/vnc.c                                |  38 ++---
 util/aio-posix.c                        |   3 +-
 util/aio-win32.c                        |   3 +-
 util/async.c                            |   2 +-
 util/base64.c                           |   2 +-
 util/error.c                            |  29 ++--
 util/keyval.c                           |   9 +-
 util/log.c                              |   4 +-
 util/main-loop.c                        |   2 +-
 util/qemu-config.c                      |  28 ++--
 util/qemu-option.c                      |  68 +++++----
 util/qemu-sockets.c                     |  79 ++++++-----
 util/throttle.c                         |   2 +-
 vl.c                                    |  99 +++++++------
 tests/Makefile.include                  |   2 +-
 859 files changed, 5107 insertions(+), 4988 deletions(-)

--
2.11.0.259.g40922b1


Reply | Threaded
Open this post in threaded view
|

[RFC 01/15] tests: Test cases for error API

Eduardo Habkost-2
Signed-off-by: Eduardo Habkost <[hidden email]>
---
 tests/test-qapi-util.c | 99 ++++++++++++++++++++++++++++++++++++++++++++++++++
 tests/Makefile.include |  2 +-
 2 files changed, 100 insertions(+), 1 deletion(-)

diff --git a/tests/test-qapi-util.c b/tests/test-qapi-util.c
index e8697577a5..3695034c32 100644
--- a/tests/test-qapi-util.c
+++ b/tests/test-qapi-util.c
@@ -75,11 +75,110 @@ static void test_parse_qapi_name(void)
     g_assert(ret == -1);
 }
 
+static void successfn(Error **errp)
+{
+    g_assert(!errp || !*errp);
+}
+
+static void fail1(Error **errp)
+{
+    g_assert(!errp || !*errp);
+
+    error_setg(errp, "error1");
+
+    g_assert(!errp || *errp);
+}
+
+static void fail2(Error **errp)
+{
+    g_assert(!errp || !*errp);
+
+    error_setg(errp, "error2");
+
+    g_assert(!errp || *errp);
+}
+
+static void multifn(Error **errp)
+{
+    Error *err1 = NULL, *err2 = NULL;
+    successfn(&err1);
+    g_assert(!err1);
+
+    fail1(&err1);
+    g_assert(err1);
+    g_assert_cmpstr(error_get_pretty(err1), ==, "error1");
+
+    fail2(&err2);
+    g_assert(err2);
+    g_assert_cmpstr(error_get_pretty(err2), ==, "error2");
+
+    error_propagate(&err1, err2);
+    g_assert(err1);
+    g_assert_cmpstr(error_get_pretty(err1), ==, "error1");
+
+    error_propagate(errp, err1);
+}
+
+static void test_propagate(void (*fn)(Error **), Error **errp)
+{
+    bool failed;
+    Error *local_err = NULL;
+
+    g_assert(!errp || !*errp);
+
+    fn(&local_err);
+    failed = !!local_err;
+    error_propagate(errp, local_err);
+
+    g_assert(!errp || (failed == !!*errp));
+}
+
+static void test_error_api(void)
+{
+    Error *err = NULL;
+
+    successfn(NULL);
+    test_propagate(successfn, NULL);
+
+    fail1(NULL);
+    test_propagate(fail1, NULL);
+
+    multifn(NULL);
+    test_propagate(multifn, NULL);
+
+    successfn(&err);
+    g_assert(!err);
+
+    test_propagate(successfn, &err);
+    g_assert(!err);
+
+    fail1(&err);
+    g_assert(err);
+    g_assert_cmpstr(error_get_pretty(err), ==, "error1");
+    error_free_or_abort(&err);
+
+    test_propagate(fail1, &err);
+    g_assert(err);
+    g_assert_cmpstr(error_get_pretty(err), ==, "error1");
+    error_free_or_abort(&err);
+
+    multifn(&err);
+    g_assert(err);
+    g_assert_cmpstr(error_get_pretty(err), ==, "error1");
+    error_free_or_abort(&err);
+
+    test_propagate(multifn, &err);
+    g_assert(err);
+    g_assert_cmpstr(error_get_pretty(err), ==, "error1");
+    error_free_or_abort(&err);
+}
+
 int main(int argc, char *argv[])
 {
     g_test_init(&argc, &argv, NULL);
     g_test_add_func("/qapi/util/qapi_enum_parse", test_qapi_enum_parse);
     g_test_add_func("/qapi/util/parse_qapi_name", test_parse_qapi_name);
+    g_test_add_func("/qapi/util/error", test_error_api);
     g_test_run();
     return 0;
 }
diff --git a/tests/Makefile.include b/tests/Makefile.include
index f42f3dfa72..e38abfabeb 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -129,7 +129,7 @@ check-unit-y += tests/test-uuid$(EXESUF)
 check-unit-y += tests/ptimer-test$(EXESUF)
 gcov-files-ptimer-test-y = hw/core/ptimer.c
 check-unit-y += tests/test-qapi-util$(EXESUF)
-gcov-files-test-qapi-util-y = qapi/qapi-util.c
+gcov-files-test-qapi-util-y = qapi/qapi-util.c qapi/error.c
 
 check-block-$(CONFIG_POSIX) += tests/qemu-iotests-quick.sh
 
--
2.11.0.259.g40922b1


Reply | Threaded
Open this post in threaded view
|

[RFC 02/15] error: New IGNORE_ERRORS macro

Eduardo Habkost-2
In reply to this post by Eduardo Habkost-2
Define new IGNORE_ERRORS macro that should be used when errors will be
ignored.

NULL will still work by now, but will break once we implement
IGNORE_ERRORS in a different way later.  Other patches will convert
existing code to use IGNORE_ERRORS.

Signed-off-by: Eduardo Habkost <[hidden email]>
---
 include/qapi/error.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/include/qapi/error.h b/include/qapi/error.h
index 7e532d00e9..38f7afba2e 100644
--- a/include/qapi/error.h
+++ b/include/qapi/error.h
@@ -66,7 +66,7 @@
  *     }
  *
  * Call a function ignoring errors:
- *     foo(arg, NULL);
+ *     foo(arg, IGNORE_ERRORS);
  *
  * Call a function aborting on errors:
  *     foo(arg, &error_abort);
@@ -117,6 +117,8 @@
 
 #include "qapi-types.h"
 
+#define IGNORE_ERRORS (NULL)
+
 /*
  * Overall category of an error.
  * Based on the qapi type QapiErrorClass, but reproduced here for nicer
--
2.11.0.259.g40922b1


Reply | Threaded
Open this post in threaded view
|

[RFC 03/15] Add qapi/error.h includes on files that will need it

Eduardo Habkost-2
In reply to this post by Eduardo Habkost-2
Some files will be changed by scripts to use macros defined in
qapi/error.h.  This patch adds the #include lines manually because it
would be harder to do it in the Coccinelle scripts.

Signed-off-by: Eduardo Habkost <[hidden email]>
---
 scripts/qapi-types.py          | 1 +
 include/hw/audio/pcspk.h       | 1 +
 include/hw/isa/isa.h           | 1 +
 include/migration/vmstate.h    | 1 +
 target/s390x/cpu.h             | 1 +
 block/block-backend.c          | 1 +
 block/iscsi.c                  | 1 +
 bsd-user/elfload.c             | 1 +
 chardev/char-io.c              | 1 +
 hw/9pfs/xen-9p-backend.c       | 1 +
 hw/acpi/memory_hotplug.c       | 1 +
 hw/acpi/nvdimm.c               | 1 +
 hw/acpi/vmgenid.c              | 1 +
 hw/core/platform-bus.c         | 1 +
 hw/core/sysbus.c               | 1 +
 hw/display/vga-pci.c           | 1 +
 hw/i386/pc.c                   | 1 +
 hw/i386/pc_q35.c               | 1 +
 hw/ide/ich.c                   | 1 +
 hw/input/virtio-input-hid.c    | 1 +
 hw/intc/s390_flic_kvm.c        | 1 +
 hw/ipmi/ipmi.c                 | 1 +
 hw/isa/lpc_ich9.c              | 1 +
 hw/mips/mips_malta.c           | 1 +
 hw/misc/auxbus.c               | 1 +
 hw/misc/edu.c                  | 1 +
 hw/misc/pvpanic.c              | 1 +
 hw/net/e1000.c                 | 1 +
 hw/net/e1000e.c                | 1 +
 hw/net/eepro100.c              | 1 +
 hw/net/lance.c                 | 1 +
 hw/net/ne2000.c                | 1 +
 hw/net/pcnet-pci.c             | 1 +
 hw/net/rtl8139.c               | 1 +
 hw/net/spapr_llan.c            | 1 +
 hw/net/virtio-net.c            | 1 +
 hw/net/vmxnet3.c               | 1 +
 hw/pci-host/gpex.c             | 1 +
 hw/pci-host/xilinx-pcie.c      | 1 +
 hw/pci/pci.c                   | 1 +
 hw/pcmcia/pxa2xx.c             | 1 +
 hw/ppc/prep.c                  | 1 +
 hw/ppc/spapr_iommu.c           | 1 +
 hw/ppc/spapr_rtc.c             | 1 +
 hw/s390x/s390-skeys.c          | 1 +
 hw/timer/mc146818rtc.c         | 1 +
 hw/usb/hcd-ehci-pci.c          | 1 +
 hw/virtio/virtio-balloon.c     | 1 +
 hw/watchdog/watchdog.c         | 1 +
 hw/xen/xen_pvdev.c             | 1 +
 linux-user/elfload.c           | 1 +
 linux-user/uname.c             | 1 +
 migration/qemu-file-channel.c  | 1 +
 migration/ram.c                | 1 +
 numa.c                         | 1 +
 qom/container.c                | 1 +
 target/m68k/helper.c           | 1 +
 target/microblaze/translate.c  | 1 +
 target/mips/translate.c        | 1 +
 target/ppc/kvm.c               | 1 +
 target/s390x/kvm.c             | 1 +
 target/xtensa/helper.c         | 1 +
 tests/test-crypto-hash.c       | 1 +
 tests/test-io-channel-tls.c    | 1 +
 tests/test-qdev-global-props.c | 1 +
 ui/gtk.c                       | 1 +
 ui/spice-core.c                | 1 +
 util/qemu-config.c             | 1 +
 68 files changed, 68 insertions(+)

diff --git a/scripts/qapi-types.py b/scripts/qapi-types.py
index b45e7b5634..814ac672be 100644
--- a/scripts/qapi-types.py
+++ b/scripts/qapi-types.py
@@ -287,6 +287,7 @@ h_comment = '''
 fdef.write(mcgen('''
 #include "qemu/osdep.h"
 #include "qapi/dealloc-visitor.h"
+#include "qapi/error.h"
 #include "%(prefix)sqapi-types.h"
 #include "%(prefix)sqapi-visit.h"
 ''',
diff --git a/include/hw/audio/pcspk.h b/include/hw/audio/pcspk.h
index 172afbf146..1a626d718d 100644
--- a/include/hw/audio/pcspk.h
+++ b/include/hw/audio/pcspk.h
@@ -25,6 +25,7 @@
 #ifndef HW_PCSPK_H
 #define HW_PCSPK_H
 
+#include "qapi/error.h"
 #include "hw/hw.h"
 #include "hw/isa/isa.h"
 
diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h
index c2fdd70cdc..f0574a04e2 100644
--- a/include/hw/isa/isa.h
+++ b/include/hw/isa/isa.h
@@ -3,6 +3,7 @@
 
 /* ISA bus */
 
+#include "qapi/error.h"
 #include "exec/memory.h"
 #include "exec/ioport.h"
 #include "hw/qdev.h"
diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h
index 8a3e9e6088..26ab616c8a 100644
--- a/include/migration/vmstate.h
+++ b/include/migration/vmstate.h
@@ -27,6 +27,7 @@
 #ifndef QEMU_VMSTATE_H
 #define QEMU_VMSTATE_H
 
+#include "qapi/error.h"
 #include "migration/qjson.h"
 
 typedef void SaveStateHandler(QEMUFile *f, void *opaque);
diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h
index a4d31df2b5..c1aa087e8d 100644
--- a/target/s390x/cpu.h
+++ b/target/s390x/cpu.h
@@ -24,6 +24,7 @@
 #define S390X_CPU_H
 
 #include "qemu-common.h"
+#include "qapi/error.h"
 #include "cpu-qom.h"
 
 #define TARGET_LONG_BITS 64
diff --git a/block/block-backend.c b/block/block-backend.c
index 7d7f3697d1..7a885031e2 100644
--- a/block/block-backend.c
+++ b/block/block-backend.c
@@ -11,6 +11,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "sysemu/block-backend.h"
 #include "block/block_int.h"
 #include "block/blockjob.h"
diff --git a/block/iscsi.c b/block/iscsi.c
index 5daa201181..9f1d94f7f1 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -24,6 +24,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 
 #include <poll.h>
 #include <math.h>
diff --git a/bsd-user/elfload.c b/bsd-user/elfload.c
index 41a1309296..0d626a418a 100644
--- a/bsd-user/elfload.c
+++ b/bsd-user/elfload.c
@@ -1,6 +1,7 @@
 /* This is the Linux kernel elf-loading code, ported into user space */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 
 #include "qemu.h"
 #include "disas/disas.h"
diff --git a/chardev/char-io.c b/chardev/char-io.c
index f81052481a..a017af784d 100644
--- a/chardev/char-io.c
+++ b/chardev/char-io.c
@@ -22,6 +22,7 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "chardev/char-io.h"
 
 typedef struct IOWatchPoll {
diff --git a/hw/9pfs/xen-9p-backend.c b/hw/9pfs/xen-9p-backend.c
index 922cc967be..6ab999d2ce 100644
--- a/hw/9pfs/xen-9p-backend.c
+++ b/hw/9pfs/xen-9p-backend.c
@@ -9,6 +9,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 
 #include "hw/hw.h"
 #include "hw/9pfs/9p.h"
diff --git a/hw/acpi/memory_hotplug.c b/hw/acpi/memory_hotplug.c
index 210073d283..f28c6766e5 100644
--- a/hw/acpi/memory_hotplug.c
+++ b/hw/acpi/memory_hotplug.c
@@ -1,4 +1,5 @@
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/acpi/memory_hotplug.h"
 #include "hw/acpi/pc-hotplug.h"
 #include "hw/mem/pc-dimm.h"
diff --git a/hw/acpi/nvdimm.c b/hw/acpi/nvdimm.c
index 8e7d6ec034..c691a1de5b 100644
--- a/hw/acpi/nvdimm.c
+++ b/hw/acpi/nvdimm.c
@@ -27,6 +27,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/acpi/acpi.h"
 #include "hw/acpi/aml-build.h"
 #include "hw/acpi/bios-linker-loader.h"
diff --git a/hw/acpi/vmgenid.c b/hw/acpi/vmgenid.c
index a32b847fe0..780637028e 100644
--- a/hw/acpi/vmgenid.c
+++ b/hw/acpi/vmgenid.c
@@ -11,6 +11,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qmp-commands.h"
 #include "hw/acpi/acpi.h"
 #include "hw/acpi/aml-build.h"
diff --git a/hw/core/platform-bus.c b/hw/core/platform-bus.c
index 329ac670c0..e3d69b61f3 100644
--- a/hw/core/platform-bus.c
+++ b/hw/core/platform-bus.c
@@ -20,6 +20,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/platform-bus.h"
 #include "exec/address-spaces.h"
 #include "qemu/error-report.h"
diff --git a/hw/core/sysbus.c b/hw/core/sysbus.c
index 5d0887f499..c6dfd9ae0c 100644
--- a/hw/core/sysbus.c
+++ b/hw/core/sysbus.c
@@ -18,6 +18,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/sysbus.h"
 #include "monitor/monitor.h"
 #include "exec/address-spaces.h"
diff --git a/hw/display/vga-pci.c b/hw/display/vga-pci.c
index ac9a76499e..0f6a836b77 100644
--- a/hw/display/vga-pci.c
+++ b/hw/display/vga-pci.c
@@ -24,6 +24,7 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/hw.h"
 #include "ui/console.h"
 #include "hw/pci/pci.h"
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 5b8c6fbbea..742b5507e3 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -22,6 +22,7 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/hw.h"
 #include "hw/i386/pc.h"
 #include "hw/char/serial.h"
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index 1523ef39e1..9179fb31de 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -28,6 +28,7 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/hw.h"
 #include "hw/loader.h"
 #include "sysemu/arch_init.h"
diff --git a/hw/ide/ich.c b/hw/ide/ich.c
index 459916977e..092f16c2d7 100644
--- a/hw/ide/ich.c
+++ b/hw/ide/ich.c
@@ -61,6 +61,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/hw.h"
 #include "hw/pci/msi.h"
 #include "hw/i386/pc.h"
diff --git a/hw/input/virtio-input-hid.c b/hw/input/virtio-input-hid.c
index 46c038110c..8666234554 100644
--- a/hw/input/virtio-input-hid.c
+++ b/hw/input/virtio-input-hid.c
@@ -5,6 +5,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu/iov.h"
 
 #include "hw/qdev.h"
diff --git a/hw/intc/s390_flic_kvm.c b/hw/intc/s390_flic_kvm.c
index b4c61d8300..7ee9b77399 100644
--- a/hw/intc/s390_flic_kvm.c
+++ b/hw/intc/s390_flic_kvm.c
@@ -11,6 +11,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "cpu.h"
 #include <sys/ioctl.h>
diff --git a/hw/ipmi/ipmi.c b/hw/ipmi/ipmi.c
index afafe1400f..a51cbca6f7 100644
--- a/hw/ipmi/ipmi.c
+++ b/hw/ipmi/ipmi.c
@@ -23,6 +23,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/hw.h"
 #include "hw/ipmi/ipmi.h"
 #include "sysemu/sysemu.h"
diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c
index ac8416d42b..28c0fedb5d 100644
--- a/hw/isa/lpc_ich9.c
+++ b/hw/isa/lpc_ich9.c
@@ -28,6 +28,7 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "cpu.h"
 #include "hw/hw.h"
diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c
index 95cdabb2dd..4b6ccb575e 100644
--- a/hw/mips/mips_malta.c
+++ b/hw/mips/mips_malta.c
@@ -23,6 +23,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "cpu.h"
 #include "hw/hw.h"
diff --git a/hw/misc/auxbus.c b/hw/misc/auxbus.c
index e4a7ba41de..3342b65f15 100644
--- a/hw/misc/auxbus.c
+++ b/hw/misc/auxbus.c
@@ -27,6 +27,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu/log.h"
 #include "hw/misc/auxbus.h"
 #include "hw/i2c/i2c.h"
diff --git a/hw/misc/edu.c b/hw/misc/edu.c
index 01acacf142..eb814df82d 100644
--- a/hw/misc/edu.c
+++ b/hw/misc/edu.c
@@ -23,6 +23,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/pci/pci.h"
 #include "hw/pci/msi.h"
 #include "qemu/timer.h"
diff --git a/hw/misc/pvpanic.c b/hw/misc/pvpanic.c
index 57da7f2199..5cd5a92614 100644
--- a/hw/misc/pvpanic.c
+++ b/hw/misc/pvpanic.c
@@ -13,6 +13,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qapi/qmp/qobject.h"
 #include "qapi/qmp/qjson.h"
 #include "sysemu/sysemu.h"
diff --git a/hw/net/e1000.c b/hw/net/e1000.c
index f2e5072d27..4353f91cff 100644
--- a/hw/net/e1000.c
+++ b/hw/net/e1000.c
@@ -26,6 +26,7 @@
 
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/hw.h"
 #include "hw/pci/pci.h"
 #include "net/net.h"
diff --git a/hw/net/e1000e.c b/hw/net/e1000e.c
index 6e234938db..664554f33c 100644
--- a/hw/net/e1000e.c
+++ b/hw/net/e1000e.c
@@ -34,6 +34,7 @@
 */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "net/net.h"
 #include "net/tap.h"
 #include "qemu/range.h"
diff --git a/hw/net/eepro100.c b/hw/net/eepro100.c
index 4bf71f2d85..5e03c9fb24 100644
--- a/hw/net/eepro100.c
+++ b/hw/net/eepro100.c
@@ -41,6 +41,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/hw.h"
 #include "hw/pci/pci.h"
 #include "net/net.h"
diff --git a/hw/net/lance.c b/hw/net/lance.c
index 92b0c68274..7ac795d4b2 100644
--- a/hw/net/lance.c
+++ b/hw/net/lance.c
@@ -36,6 +36,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/sysbus.h"
 #include "net/net.h"
 #include "qemu/timer.h"
diff --git a/hw/net/ne2000.c b/hw/net/ne2000.c
index 798d681e25..f8e86f5184 100644
--- a/hw/net/ne2000.c
+++ b/hw/net/ne2000.c
@@ -22,6 +22,7 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/hw.h"
 #include "hw/pci/pci.h"
 #include "net/net.h"
diff --git a/hw/net/pcnet-pci.c b/hw/net/pcnet-pci.c
index 0acf8a4879..e08aee92b1 100644
--- a/hw/net/pcnet-pci.c
+++ b/hw/net/pcnet-pci.c
@@ -28,6 +28,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/pci/pci.h"
 #include "net/net.h"
 #include "hw/loader.h"
diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c
index 671c7e48c6..36cd99e3fc 100644
--- a/hw/net/rtl8139.c
+++ b/hw/net/rtl8139.c
@@ -50,6 +50,7 @@
 
 /* For crc32 */
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include <zlib.h>
 
 #include "hw/hw.h"
diff --git a/hw/net/spapr_llan.c b/hw/net/spapr_llan.c
index d239e4bd7d..54ac4f4f44 100644
--- a/hw/net/spapr_llan.c
+++ b/hw/net/spapr_llan.c
@@ -25,6 +25,7 @@
  *
  */
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "cpu.h"
 #include "hw/hw.h"
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 9a3d769aa2..3aa2af14e5 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -12,6 +12,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu/iov.h"
 #include "hw/virtio/virtio.h"
 #include "net/net.h"
diff --git a/hw/net/vmxnet3.c b/hw/net/vmxnet3.c
index 4df31101ec..7ebb32e664 100644
--- a/hw/net/vmxnet3.c
+++ b/hw/net/vmxnet3.c
@@ -16,6 +16,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/hw.h"
 #include "hw/pci/pci.h"
 #include "net/net.h"
diff --git a/hw/pci-host/gpex.c b/hw/pci-host/gpex.c
index e2629ce70d..77f64b4ae7 100644
--- a/hw/pci-host/gpex.c
+++ b/hw/pci-host/gpex.c
@@ -29,6 +29,7 @@
  * http://www.firmware.org/1275/practice/imap/imap0_9d.pdf
  */
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/hw.h"
 #include "hw/pci-host/gpex.h"
 
diff --git a/hw/pci-host/xilinx-pcie.c b/hw/pci-host/xilinx-pcie.c
index a968cea2af..c7ff5fb277 100644
--- a/hw/pci-host/xilinx-pcie.c
+++ b/hw/pci-host/xilinx-pcie.c
@@ -18,6 +18,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/pci/pci_bridge.h"
 #include "hw/pci-host/xilinx-pcie.h"
 
diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index 98ccc27533..84d63728e1 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -22,6 +22,7 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/hw.h"
 #include "hw/pci/pci.h"
 #include "hw/pci/pci_bridge.h"
diff --git a/hw/pcmcia/pxa2xx.c b/hw/pcmcia/pxa2xx.c
index 20c9c753d2..5833358f87 100644
--- a/hw/pcmcia/pxa2xx.c
+++ b/hw/pcmcia/pxa2xx.c
@@ -11,6 +11,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/hw.h"
 #include "hw/sysbus.h"
 #include "hw/pcmcia.h"
diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c
index d16646c95d..a917be6ca3 100644
--- a/hw/ppc/prep.c
+++ b/hw/ppc/prep.c
@@ -23,6 +23,7 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "cpu.h"
 #include "hw/hw.h"
 #include "hw/timer/m48t59.h"
diff --git a/hw/ppc/spapr_iommu.c b/hw/ppc/spapr_iommu.c
index 0341bc069d..d587772b9c 100644
--- a/hw/ppc/spapr_iommu.c
+++ b/hw/ppc/spapr_iommu.c
@@ -17,6 +17,7 @@
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu/error-report.h"
 #include "hw/hw.h"
 #include "qemu/log.h"
diff --git a/hw/ppc/spapr_rtc.c b/hw/ppc/spapr_rtc.c
index 00a4e4c717..7e250dcbaf 100644
--- a/hw/ppc/spapr_rtc.c
+++ b/hw/ppc/spapr_rtc.c
@@ -26,6 +26,7 @@
  *
  */
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "cpu.h"
 #include "qemu/timer.h"
 #include "sysemu/sysemu.h"
diff --git a/hw/s390x/s390-skeys.c b/hw/s390x/s390-skeys.c
index 35e7f6316f..2db2f9c8a8 100644
--- a/hw/s390x/s390-skeys.c
+++ b/hw/s390x/s390-skeys.c
@@ -10,6 +10,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/boards.h"
 #include "qmp-commands.h"
 #include "hw/s390x/storage-keys.h"
diff --git a/hw/timer/mc146818rtc.c b/hw/timer/mc146818rtc.c
index 1b8d3d7d4c..4c1986b97f 100644
--- a/hw/timer/mc146818rtc.c
+++ b/hw/timer/mc146818rtc.c
@@ -22,6 +22,7 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu/cutils.h"
 #include "qemu/bcd.h"
 #include "hw/hw.h"
diff --git a/hw/usb/hcd-ehci-pci.c b/hw/usb/hcd-ehci-pci.c
index 6dedcb8989..63491111e5 100644
--- a/hw/usb/hcd-ehci-pci.c
+++ b/hw/usb/hcd-ehci-pci.c
@@ -16,6 +16,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/usb/hcd-ehci.h"
 #include "qemu/range.h"
 
diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c
index a705e0ec55..f9939baa45 100644
--- a/hw/virtio/virtio-balloon.c
+++ b/hw/virtio/virtio-balloon.c
@@ -14,6 +14,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu/iov.h"
 #include "qemu/timer.h"
 #include "qemu-common.h"
diff --git a/hw/watchdog/watchdog.c b/hw/watchdog/watchdog.c
index 0c5c9cde1c..2c3b2bb418 100644
--- a/hw/watchdog/watchdog.c
+++ b/hw/watchdog/watchdog.c
@@ -20,6 +20,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu/option.h"
 #include "qemu/config-file.h"
 #include "qemu/queue.h"
diff --git a/hw/xen/xen_pvdev.c b/hw/xen/xen_pvdev.c
index aed783e844..5048430177 100644
--- a/hw/xen/xen_pvdev.c
+++ b/hw/xen/xen_pvdev.c
@@ -18,6 +18,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu/log.h"
 #include "hw/qdev-core.h"
 #include "hw/xen/xen_backend.h"
diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index ce77317e09..b54bdffd8c 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -1,5 +1,6 @@
 /* This is the Linux kernel elf-loading code, ported into user space */
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include <sys/param.h>
 
 #include <sys/resource.h>
diff --git a/linux-user/uname.c b/linux-user/uname.c
index 313b79dbad..5199380d85 100644
--- a/linux-user/uname.c
+++ b/linux-user/uname.c
@@ -18,6 +18,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 
 #include "qemu.h"
 //#include "qemu-common.h"
diff --git a/migration/qemu-file-channel.c b/migration/qemu-file-channel.c
index e202d73834..a597c5f948 100644
--- a/migration/qemu-file-channel.c
+++ b/migration/qemu-file-channel.c
@@ -23,6 +23,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu-file-channel.h"
 #include "exec/cpu-common.h"
 #include "qemu-file.h"
diff --git a/migration/ram.c b/migration/ram.c
index 9ffd0a5479..b2ca242a3a 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -26,6 +26,7 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "cpu.h"
 #include <zlib.h>
diff --git a/numa.c b/numa.c
index 65701cb6c8..2b5cb7b5c7 100644
--- a/numa.c
+++ b/numa.c
@@ -23,6 +23,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "sysemu/numa.h"
 #include "exec/cpu-common.h"
 #include "exec/ramlist.h"
diff --git a/qom/container.c b/qom/container.c
index f6ccaf7ea7..2dbabd15ab 100644
--- a/qom/container.c
+++ b/qom/container.c
@@ -11,6 +11,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qom/object.h"
 #include "qemu/module.h"
 
diff --git a/target/m68k/helper.c b/target/m68k/helper.c
index f750d3dbaa..ea1872cae5 100644
--- a/target/m68k/helper.c
+++ b/target/m68k/helper.c
@@ -19,6 +19,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "cpu.h"
 #include "exec/exec-all.h"
 #include "exec/gdbstub.h"
diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c
index 0bb609513c..83f6d96a71 100644
--- a/target/microblaze/translate.c
+++ b/target/microblaze/translate.c
@@ -19,6 +19,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "cpu.h"
 #include "disas/disas.h"
 #include "exec/exec-all.h"
diff --git a/target/mips/translate.c b/target/mips/translate.c
index 559f8fed89..7dedfd6632 100644
--- a/target/mips/translate.c
+++ b/target/mips/translate.c
@@ -22,6 +22,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "cpu.h"
 #include "disas/disas.h"
 #include "exec/exec-all.h"
diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c
index 51249ce79e..670edde79e 100644
--- a/target/ppc/kvm.c
+++ b/target/ppc/kvm.c
@@ -15,6 +15,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include <dirent.h>
 #include <sys/ioctl.h>
 #include <sys/vfs.h>
diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c
index ba1e60f8a6..3383c49039 100644
--- a/target/s390x/kvm.c
+++ b/target/s390x/kvm.c
@@ -22,6 +22,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include <sys/ioctl.h>
 
 #include <linux/kvm.h>
diff --git a/target/xtensa/helper.c b/target/xtensa/helper.c
index bcd0b7738d..263990d621 100644
--- a/target/xtensa/helper.c
+++ b/target/xtensa/helper.c
@@ -26,6 +26,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "cpu.h"
 #include "exec/exec-all.h"
 #include "exec/gdbstub.h"
diff --git a/tests/test-crypto-hash.c b/tests/test-crypto-hash.c
index 214a9f72c3..f58eeb4409 100644
--- a/tests/test-crypto-hash.c
+++ b/tests/test-crypto-hash.c
@@ -19,6 +19,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 
 #include "crypto/init.h"
 #include "crypto/hash.h"
diff --git a/tests/test-io-channel-tls.c b/tests/test-io-channel-tls.c
index 8eaa208e1b..b55f5c81ff 100644
--- a/tests/test-io-channel-tls.c
+++ b/tests/test-io-channel-tls.c
@@ -22,6 +22,7 @@
 
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 
 #include "crypto-tls-x509-helpers.h"
 #include "io/channel-tls.h"
diff --git a/tests/test-qdev-global-props.c b/tests/test-qdev-global-props.c
index 48e5b7315f..d5bfcac37d 100644
--- a/tests/test-qdev-global-props.c
+++ b/tests/test-qdev-global-props.c
@@ -23,6 +23,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 
 #include "hw/qdev.h"
 #include "qom/object.h"
diff --git a/ui/gtk.c b/ui/gtk.c
index 5bd87c265a..18c325f8d4 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -35,6 +35,7 @@
 #define LOCALEDIR "po"
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "qemu/cutils.h"
 
diff --git a/ui/spice-core.c b/ui/spice-core.c
index 804abc5c0f..801e5c864a 100644
--- a/ui/spice-core.c
+++ b/ui/spice-core.c
@@ -16,6 +16,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include <spice.h>
 
 #include <netdb.h>
diff --git a/util/qemu-config.c b/util/qemu-config.c
index 405dd1a1d7..c74f15c42d 100644
--- a/util/qemu-config.c
+++ b/util/qemu-config.c
@@ -1,4 +1,5 @@
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "qemu/error-report.h"
 #include "qemu/option.h"
--
2.11.0.259.g40922b1


Reply | Threaded
Open this post in threaded view
|

[RFC 04/15] [coccinelle] Use IGNORE_ERRORS instead of NULL as errp argument

Eduardo Habkost-2
In reply to this post by Eduardo Habkost-2
This was generated by the following Coccinelle script with hardcoded
function names.  Probably there's a better way to catch calls to
functions that accept an Error** argument, but I didn't find a reliable
way to do that.

(Script can't be copied verbatim.  The huge regexp below was split in
multiple lines to make Git happy.)

  @@
  identifier F =~ "object(|_class)_property_(add|get|set|del|find).*|\
                   device_add_bootindex_property|memory_region_init_.*|\
                   object_property_find|qemu_chr_fe_init|numa_get_node|\
                   qbus_set_hotplug_handler|qdev_unplug|\
                   vmstate_register_with_alias_id|bdrv_refresh_limits|\
                   bdrv_create_dirty_bitmap|bdrv_reclaim_dirty_bitmap|\
                   blk_dev_change_media_cb|bdrv_lookup_bs|reopen_backing_file|\
                   bdrv_find_protocol|sd_truncate|qio_channel_socket_accept|\
                   block_job_finish_sync|qio_channel_(read|write)(|v)(|_full)|\
                   qio_channel_close|qio_channel_io_seek|qio_channel_command_abort|\
                   qio_channel_websock_(read|write)_wire|qio_task_propagate_error|\
                   qio_channel_socket_listen_sync|qio_channel_socket_new_fd|\
                   bdrv_reopen|blk_truncate|bdrv_truncate|bdrv_op_is_blocked|\
                   qcrypto_block_decrypt|qcrypto_block_get_info|raw_handle_perm_lock|\
                   qapi_enum_parse|qmp_(qom_list|query_.*|quit|stop|cont|system_.*|\
                   migrate_.*|change_vnc_password|nbd_server_stop|inject_nmi|\
                   guest_fsfreeze_thaw|marshal_.*)|qio_channel_shutdown|\
                   qio_channel_set_blocking|cryptodev_backend_cleanup|\
                   bdrv_dirty_bitmap_abdicate|qcrypto_block_decrypt|\
                   qcrypto_block_encrypt|iscsi_open|qcow2_read_extensions|\
                   qcrypto_hash_bytesv|replication_stop|visit_type_.*|\
                   qemu_opt(|s)_(set|create|foreach)$|v9fs_device_realize_common|\
                   msix_init_exclusive_bar|msi_init|qemu_input_handler_bind|\
                   pcie_aer_init|pci_qdev_unrealize|msix_init|usb_qdev_unrealize|\
                   usb_try_create_simple|usb_ehci_realize|.*_(|un)realize(|_common)|\
                   qdev_unplug|qapi_event_send_migration_pass|nbd_send_option_request|\
                   blk_invalidate_cache|socket_local_address|json_parser_parse_err|\
                   object_set_propv|vnc_socket_ip_addr_string|inet_connect_addr|\
                   opts_parse|migrate_add_blocker|nbd_wr_syncv|(read|write)_sync";
  @@
   F(...,
  -           NULL
  +           IGNORE_ERRORS
             )

  @@
  expression T, P, ID, ERR;
  @@
   object_new_with_props(T, P, ID,
  -           NULL
  +           IGNORE_ERRORS
             )

  @@
  expression O, ERR;
  @@
   object_set_propv(O,
  -           NULL
  +           IGNORE_ERRORS
             )

Signed-off-by: Eduardo Habkost <[hidden email]>
---
 include/hw/audio/pcspk.h            |  2 +-
 include/hw/isa/isa.h                |  3 +-
 include/migration/vmstate.h         |  2 +-
 target/s390x/cpu.h                  |  2 +-
 backends/cryptodev.c                |  6 ++--
 backends/rng-egd.c                  |  2 +-
 backends/rng-random.c               |  2 +-
 backends/rng.c                      |  2 +-
 backends/tpm.c                      |  2 +-
 block.c                             |  4 +--
 block/backup.c                      |  6 ++--
 block/block-backend.c               |  2 +-
 block/commit.c                      | 14 ++++----
 block/crypto.c                      |  2 +-
 block/file-posix.c                  |  4 +--
 block/gluster.c                     |  2 +-
 block/iscsi.c                       |  4 +--
 block/mirror.c                      |  6 ++--
 block/nbd-client.c                  | 10 +++---
 block/parallels.c                   |  7 ++--
 block/qcow.c                        |  6 ++--
 block/qcow2.c                       |  2 +-
 block/quorum.c                      |  2 +-
 block/replication.c                 | 10 +++---
 block/sheepdog.c                    |  4 +--
 block/stream.c                      |  4 +--
 block/vhdx-log.c                    |  2 +-
 block/vhdx.c                        |  2 +-
 blockdev-nbd.c                      |  2 +-
 blockdev.c                          | 10 +++---
 blockjob.c                          |  4 +--
 bootdevice.c                        |  2 +-
 bsd-user/elfload.c                  |  3 +-
 chardev/char-fd.c                   |  2 +-
 chardev/char-io.c                   |  2 +-
 chardev/char-pty.c                  |  2 +-
 chardev/char-socket.c               | 20 ++++++-----
 chardev/char-udp.c                  |  4 +--
 crypto/secret.c                     | 12 +++----
 crypto/tlscreds.c                   |  8 ++---
 crypto/tlscredsanon.c               |  2 +-
 crypto/tlscredsx509.c               |  6 ++--
 dump.c                              |  2 +-
 exec.c                              |  2 +-
 hmp.c                               | 68 ++++++++++++++++++-------------------
 hw/9pfs/xen-9p-backend.c            | 11 +++---
 hw/acpi/ich9.c                      | 14 ++++----
 hw/acpi/memory_hotplug.c            | 10 +++---
 hw/acpi/nvdimm.c                    | 16 ++++-----
 hw/acpi/piix4.c                     | 14 ++++----
 hw/acpi/vmgenid.c                   |  4 +--
 hw/arm/allwinner-a10.c              |  2 +-
 hw/arm/aspeed_soc.c                 | 23 +++++++------
 hw/arm/bcm2835_peripherals.c        | 30 +++++++++-------
 hw/arm/bcm2836.c                    |  3 +-
 hw/arm/digic.c                      |  7 ++--
 hw/arm/exynos4210.c                 |  2 +-
 hw/arm/fsl-imx6.c                   | 32 ++++++++++-------
 hw/arm/highbank.c                   |  2 +-
 hw/arm/integratorcp.c               |  2 +-
 hw/arm/realview.c                   |  2 +-
 hw/arm/versatilepb.c                |  2 +-
 hw/arm/vexpress.c                   |  8 ++---
 hw/arm/virt.c                       | 41 +++++++++++-----------
 hw/arm/xilinx_zynq.c                |  2 +-
 hw/arm/xlnx-zynqmp.c                |  4 +--
 hw/block/fdc.c                      |  4 +--
 hw/block/nvme.c                     |  2 +-
 hw/block/virtio-blk.c               |  4 +--
 hw/core/bus.c                       |  8 +++--
 hw/core/platform-bus.c              |  5 +--
 hw/core/qdev-properties-system.c    |  4 +--
 hw/core/qdev.c                      | 24 +++++++------
 hw/core/sysbus.c                    |  5 +--
 hw/cpu/a15mpcore.c                  |  2 +-
 hw/cpu/a9mpcore.c                   |  2 +-
 hw/cpu/core.c                       |  4 +--
 hw/display/vga-pci.c                |  6 ++--
 hw/i386/acpi-build.c                | 51 ++++++++++++++++------------
 hw/i386/kvm/pci-assign.c            |  2 +-
 hw/i386/pc.c                        |  4 +--
 hw/i386/pc_q35.c                    | 15 ++++----
 hw/ide/ich.c                        |  2 +-
 hw/ide/qdev.c                       |  4 +--
 hw/input/virtio-input-hid.c         |  3 +-
 hw/intc/apic_common.c               |  4 +--
 hw/intc/arm_gicv3_common.c          |  3 +-
 hw/intc/s390_flic.c                 |  2 +-
 hw/intc/s390_flic_kvm.c             |  2 +-
 hw/ipmi/ipmi.c                      |  2 +-
 hw/isa/lpc_ich9.c                   |  6 ++--
 hw/mem/nvdimm.c                     |  2 +-
 hw/mem/pc-dimm.c                    |  2 +-
 hw/microblaze/petalogix_ml605_mmu.c | 14 ++++----
 hw/mips/boston.c                    |  2 +-
 hw/mips/mips_malta.c                |  2 +-
 hw/misc/auxbus.c                    |  2 +-
 hw/misc/edu.c                       |  2 +-
 hw/misc/macio/macio.c               |  4 +--
 hw/misc/pvpanic.c                   |  2 +-
 hw/misc/tmp105.c                    |  2 +-
 hw/net/e1000.c                      |  2 +-
 hw/net/e1000e.c                     |  8 ++---
 hw/net/eepro100.c                   |  2 +-
 hw/net/lance.c                      |  2 +-
 hw/net/ne2000-isa.c                 |  4 +--
 hw/net/ne2000.c                     |  2 +-
 hw/net/pcnet-pci.c                  |  2 +-
 hw/net/rtl8139.c                    |  2 +-
 hw/net/spapr_llan.c                 |  2 +-
 hw/net/virtio-net.c                 |  2 +-
 hw/net/vmxnet3.c                    |  6 ++--
 hw/nvram/fw_cfg.c                   |  3 +-
 hw/pci-host/gpex.c                  |  2 +-
 hw/pci-host/piix.c                  | 13 +++----
 hw/pci-host/prep.c                  |  2 +-
 hw/pci-host/q35.c                   | 25 ++++++++------
 hw/pci-host/xilinx-pcie.c           |  4 +--
 hw/pci/pci.c                        |  2 +-
 hw/pci/pcie.c                       |  2 +-
 hw/pci/shpc.c                       |  2 +-
 hw/pcmcia/pxa2xx.c                  |  2 +-
 hw/ppc/e500.c                       |  2 +-
 hw/ppc/pnv.c                        | 10 +++---
 hw/ppc/pnv_core.c                   |  2 +-
 hw/ppc/pnv_psi.c                    |  3 +-
 hw/ppc/prep.c                       |  6 ++--
 hw/ppc/spapr.c                      | 14 ++++----
 hw/ppc/spapr_drc.c                  | 19 ++++++-----
 hw/ppc/spapr_iommu.c                |  4 +--
 hw/ppc/spapr_pci.c                  |  4 +--
 hw/ppc/spapr_rng.c                  |  4 +--
 hw/ppc/spapr_rtc.c                  |  3 +-
 hw/s390x/event-facility.c           |  4 +--
 hw/s390x/ipl.c                      |  3 +-
 hw/s390x/s390-pci-bus.c             |  8 ++---
 hw/s390x/s390-skeys.c               |  6 ++--
 hw/s390x/s390-virtio-ccw.c          | 24 ++++++-------
 hw/s390x/s390-virtio.c              |  2 +-
 hw/s390x/sclp.c                     |  7 ++--
 hw/s390x/virtio-ccw.c               |  4 +--
 hw/scsi/megasas.c                   |  2 +-
 hw/scsi/scsi-bus.c                  |  8 ++---
 hw/scsi/vhost-scsi.c                |  2 +-
 hw/scsi/vmw_pvscsi.c                |  2 +-
 hw/timer/mc146818rtc.c              |  6 ++--
 hw/usb/bus.c                        |  8 ++---
 hw/usb/dev-hid.c                    |  3 +-
 hw/usb/dev-network.c                |  2 +-
 hw/usb/dev-storage.c                |  6 ++--
 hw/usb/hcd-ehci-pci.c               |  4 +--
 hw/usb/hcd-xhci.c                   |  2 +-
 hw/usb/host-libusb.c                |  2 +-
 hw/usb/redirect.c                   |  2 +-
 hw/vfio/pci.c                       |  2 +-
 hw/virtio/virtio-balloon.c          |  4 +--
 hw/virtio/virtio-crypto-pci.c       |  2 +-
 hw/virtio/virtio-crypto.c           |  2 +-
 hw/virtio/virtio-pci.c              |  4 +--
 hw/virtio/virtio-rng.c              |  6 ++--
 hw/virtio/virtio.c                  |  3 +-
 hw/xen/xen_pvdev.c                  |  2 +-
 io/channel-command.c                |  2 +-
 io/channel-tls.c                    |  4 +--
 linux-user/elfload.c                |  3 +-
 linux-user/uname.c                  |  2 +-
 migration/block.c                   |  3 +-
 migration/colo.c                    |  4 +--
 migration/qemu-file-channel.c       | 10 +++---
 migration/ram.c                     |  3 +-
 migration/socket.c                  |  2 +-
 monitor.c                           | 10 +++---
 nbd/client.c                        |  4 +--
 nbd/server.c                        | 18 +++++-----
 net/colo-compare.c                  |  6 ++--
 net/dump.c                          |  4 +--
 net/filter-buffer.c                 |  2 +-
 net/filter-mirror.c                 |  6 ++--
 net/filter.c                        |  6 ++--
 net/net.c                           |  6 ++--
 numa.c                              |  7 ++--
 qdev-monitor.c                      |  6 ++--
 qemu-img.c                          | 24 ++++++-------
 qemu-io.c                           |  2 +-
 qemu-nbd.c                          |  4 +--
 qga/commands-posix.c                |  2 +-
 qga/main.c                          |  2 +-
 qobject/json-parser.c               |  2 +-
 qom/container.c                     |  2 +-
 qom/object.c                        | 18 +++++-----
 qom/object_interfaces.c             |  2 +-
 target/alpha/cpu.c                  |  2 +-
 target/arm/cpu64.c                  |  4 +--
 target/hppa/cpu.c                   |  2 +-
 target/i386/cpu.c                   | 25 ++++++++------
 target/m68k/helper.c                |  2 +-
 target/microblaze/translate.c       |  2 +-
 target/mips/translate.c             |  2 +-
 target/nios2/cpu.c                  |  2 +-
 target/ppc/kvm.c                    |  3 +-
 target/s390x/cpu.c                  |  2 +-
 target/s390x/cpu_models.c           | 17 ++++++----
 target/s390x/kvm.c                  |  4 +--
 target/sparc/cpu.c                  |  2 +-
 target/tilegx/cpu.c                 |  2 +-
 target/xtensa/helper.c              |  2 +-
 tests/check-qom-proplist.c          | 17 +++++-----
 tests/io-channel-helpers.c          |  4 +--
 tests/test-char.c                   |  2 +-
 tests/test-crypto-hash.c            |  2 +-
 tests/test-io-channel-socket.c      |  2 +-
 tests/test-io-channel-tls.c         |  8 +++--
 tests/test-qdev-global-props.c      |  4 +--
 tests/test-qemu-opts.c              |  4 +--
 tests/test-string-input-visitor.c   | 12 +++----
 tpm.c                               |  2 +-
 ui/gtk.c                            | 12 +++----
 ui/input-linux.c                    |  6 ++--
 ui/spice-core.c                     |  2 +-
 ui/vnc-auth-sasl.c                  |  4 +--
 ui/vnc.c                            |  8 ++---
 util/qemu-config.c                  |  6 ++--
 util/qemu-option.c                  |  2 +-
 util/qemu-sockets.c                 |  3 +-
 vl.c                                |  5 +--
 225 files changed, 712 insertions(+), 628 deletions(-)

diff --git a/include/hw/audio/pcspk.h b/include/hw/audio/pcspk.h
index 1a626d718d..fe9a738a49 100644
--- a/include/hw/audio/pcspk.h
+++ b/include/hw/audio/pcspk.h
@@ -39,7 +39,7 @@ static inline ISADevice *pcspk_init(ISABus *bus, ISADevice *pit)
     isadev = isa_create(bus, TYPE_PC_SPEAKER);
     dev = DEVICE(isadev);
     qdev_prop_set_uint32(dev, "iobase", 0x61);
-    object_property_set_link(OBJECT(dev), OBJECT(pit), "pit", NULL);
+    object_property_set_link(OBJECT(dev), OBJECT(pit), "pit", IGNORE_ERRORS);
     qdev_init_nofail(dev);
 
     return isadev;
diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h
index f0574a04e2..4b8c13532c 100644
--- a/include/hw/isa/isa.h
+++ b/include/hw/isa/isa.h
@@ -30,7 +30,8 @@ static inline uint16_t applesmc_port(void)
     Object *obj = object_resolve_path_type("", TYPE_APPLE_SMC, NULL);
 
     if (obj) {
-        return object_property_get_int(obj, APPLESMC_PROP_IO_BASE, NULL);
+        return object_property_get_int(obj, APPLESMC_PROP_IO_BASE,
+                                       IGNORE_ERRORS);
     }
     return 0;
 }
diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h
index 26ab616c8a..13fb10797a 100644
--- a/include/migration/vmstate.h
+++ b/include/migration/vmstate.h
@@ -1033,7 +1033,7 @@ static inline int vmstate_register(DeviceState *dev, int instance_id,
                                    void *opaque)
 {
     return vmstate_register_with_alias_id(dev, instance_id, vmsd,
-                                          opaque, -1, 0, NULL);
+                                          opaque, -1, 0, IGNORE_ERRORS);
 }
 
 void vmstate_unregister(DeviceState *dev, const VMStateDescription *vmsd,
diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h
index c1aa087e8d..2ce509f601 100644
--- a/target/s390x/cpu.h
+++ b/target/s390x/cpu.h
@@ -1267,7 +1267,7 @@ static inline void s390_crypto_reset(void)
 static inline bool s390_get_squash_mcss(void)
 {
     if (object_property_get_bool(OBJECT(qdev_get_machine()), "s390-squash-mcss",
-                                 NULL)) {
+                                 IGNORE_ERRORS)) {
         return true;
     }
 
diff --git a/backends/cryptodev.c b/backends/cryptodev.c
index 832f056266..03a78f269f 100644
--- a/backends/cryptodev.c
+++ b/backends/cryptodev.c
@@ -225,16 +225,16 @@ static void cryptodev_backend_instance_init(Object *obj)
     object_property_add(obj, "queues", "int",
                           cryptodev_backend_get_queues,
                           cryptodev_backend_set_queues,
-                          NULL, NULL, NULL);
+                          NULL, NULL, IGNORE_ERRORS);
     /* Initialize devices' queues property to 1 */
-    object_property_set_int(obj, 1, "queues", NULL);
+    object_property_set_int(obj, 1, "queues", IGNORE_ERRORS);
 }
 
 static void cryptodev_backend_finalize(Object *obj)
 {
     CryptoDevBackend *backend = CRYPTODEV_BACKEND(obj);
 
-    cryptodev_backend_cleanup(backend, NULL);
+    cryptodev_backend_cleanup(backend, IGNORE_ERRORS);
 }
 
 static void
diff --git a/backends/rng-egd.c b/backends/rng-egd.c
index e7ce2cac80..8c2acae177 100644
--- a/backends/rng-egd.c
+++ b/backends/rng-egd.c
@@ -138,7 +138,7 @@ static void rng_egd_init(Object *obj)
 {
     object_property_add_str(obj, "chardev",
                             rng_egd_get_chardev, rng_egd_set_chardev,
-                            NULL);
+                            IGNORE_ERRORS);
 }
 
 static void rng_egd_finalize(Object *obj)
diff --git a/backends/rng-random.c b/backends/rng-random.c
index e2a49b0571..029f6b9b01 100644
--- a/backends/rng-random.c
+++ b/backends/rng-random.c
@@ -110,7 +110,7 @@ static void rng_random_init(Object *obj)
     object_property_add_str(obj, "filename",
                             rng_random_get_filename,
                             rng_random_set_filename,
-                            NULL);
+                            IGNORE_ERRORS);
 
     s->filename = g_strdup("/dev/random");
     s->fd = -1;
diff --git a/backends/rng.c b/backends/rng.c
index 398ebe4a7d..59b7503efb 100644
--- a/backends/rng.c
+++ b/backends/rng.c
@@ -108,7 +108,7 @@ static void rng_backend_init(Object *obj)
     object_property_add_bool(obj, "opened",
                              rng_backend_prop_get_opened,
                              rng_backend_prop_set_opened,
-                             NULL);
+                             IGNORE_ERRORS);
 }
 
 static void rng_backend_finalize(Object *obj)
diff --git a/backends/tpm.c b/backends/tpm.c
index 536f262bb7..ef3e20a3cb 100644
--- a/backends/tpm.c
+++ b/backends/tpm.c
@@ -155,7 +155,7 @@ static void tpm_backend_instance_init(Object *obj)
     object_property_add_bool(obj, "opened",
                              tpm_backend_prop_get_opened,
                              tpm_backend_prop_set_opened,
-                             NULL);
+                             IGNORE_ERRORS);
 }
 
 void tpm_backend_thread_deliver_request(TPMBackendThread *tbt)
diff --git a/block.c b/block.c
index 1750a1838e..ecb5be9a32 100644
--- a/block.c
+++ b/block.c
@@ -2096,7 +2096,7 @@ void bdrv_set_backing_hd(BlockDriverState *bs, BlockDriverState *backing_hd,
     bdrv_refresh_filename(bs);
 
 out:
-    bdrv_refresh_limits(bs, NULL);
+    bdrv_refresh_limits(bs, IGNORE_ERRORS);
 }
 
 /*
@@ -3002,7 +3002,7 @@ void bdrv_reopen_commit(BDRVReopenState *reopen_state)
     reopen_state->bs->open_flags         = reopen_state->flags;
     reopen_state->bs->read_only = !(reopen_state->flags & BDRV_O_RDWR);
 
-    bdrv_refresh_limits(reopen_state->bs, NULL);
+    bdrv_refresh_limits(reopen_state->bs, IGNORE_ERRORS);
 }
 
 /*
diff --git a/block/backup.c b/block/backup.c
index 5387fbd84e..6976129e7d 100644
--- a/block/backup.c
+++ b/block/backup.c
@@ -218,11 +218,11 @@ static void backup_cleanup_sync_bitmap(BackupBlockJob *job, int ret)
 
     if (ret < 0 || block_job_is_cancelled(&job->common)) {
         /* Merge the successor back into the parent, delete nothing. */
-        bm = bdrv_reclaim_dirty_bitmap(bs, job->sync_bitmap, NULL);
+        bm = bdrv_reclaim_dirty_bitmap(bs, job->sync_bitmap, IGNORE_ERRORS);
         assert(bm);
     } else {
         /* Everything is fine, delete this bitmap and install the backup. */
-        bm = bdrv_dirty_bitmap_abdicate(bs, job->sync_bitmap, NULL);
+        bm = bdrv_dirty_bitmap_abdicate(bs, job->sync_bitmap, IGNORE_ERRORS);
         assert(bm);
     }
 }
@@ -688,7 +688,7 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
 
  error:
     if (sync_bitmap) {
-        bdrv_reclaim_dirty_bitmap(bs, sync_bitmap, NULL);
+        bdrv_reclaim_dirty_bitmap(bs, sync_bitmap, IGNORE_ERRORS);
     }
     if (job) {
         backup_clean(&job->common);
diff --git a/block/block-backend.c b/block/block-backend.c
index 7a885031e2..9b9ca2eb35 100644
--- a/block/block-backend.c
+++ b/block/block-backend.c
@@ -819,7 +819,7 @@ void blk_dev_change_media_cb(BlockBackend *blk, bool load, Error **errp)
 
 static void blk_root_change_media(BdrvChild *child, bool load)
 {
-    blk_dev_change_media_cb(child->opaque, load, NULL);
+    blk_dev_change_media_cb(child->opaque, load, IGNORE_ERRORS);
 }
 
 /*
diff --git a/block/commit.c b/block/commit.c
index af6fa68cf3..264495177e 100644
--- a/block/commit.c
+++ b/block/commit.c
@@ -112,10 +112,10 @@ static void commit_complete(BlockJob *job, void *opaque)
      * to r/o). These reopens do not need to be atomic, since we won't abort
      * even on failure here */
     if (s->base_flags != bdrv_get_flags(base)) {
-        bdrv_reopen(base, s->base_flags, NULL);
+        bdrv_reopen(base, s->base_flags, IGNORE_ERRORS);
     }
     if (overlay_bs && s->orig_overlay_flags != bdrv_get_flags(overlay_bs)) {
-        bdrv_reopen(overlay_bs, s->orig_overlay_flags, NULL);
+        bdrv_reopen(overlay_bs, s->orig_overlay_flags, IGNORE_ERRORS);
     }
     g_free(s->backing_file_str);
     blk_unref(s->top);
@@ -158,7 +158,7 @@ static void coroutine_fn commit_run(void *opaque)
     }
 
     if (base_len < s->common.len) {
-        ret = blk_truncate(s->base, s->common.len, NULL);
+        ret = blk_truncate(s->base, s->common.len, IGNORE_ERRORS);
         if (ret) {
             goto out;
         }
@@ -459,8 +459,8 @@ int bdrv_commit(BlockDriverState *bs)
         return -ENOTSUP;
     }
 
-    if (bdrv_op_is_blocked(bs, BLOCK_OP_TYPE_COMMIT_SOURCE, NULL) ||
-        bdrv_op_is_blocked(bs->backing->bs, BLOCK_OP_TYPE_COMMIT_TARGET, NULL)) {
+    if (bdrv_op_is_blocked(bs, BLOCK_OP_TYPE_COMMIT_SOURCE, IGNORE_ERRORS) ||
+        bdrv_op_is_blocked(bs->backing->bs, BLOCK_OP_TYPE_COMMIT_TARGET, IGNORE_ERRORS)) {
         return -EBUSY;
     }
 
@@ -468,7 +468,7 @@ int bdrv_commit(BlockDriverState *bs)
     open_flags =  bs->backing->bs->open_flags;
 
     if (ro) {
-        if (bdrv_reopen(bs->backing->bs, open_flags | BDRV_O_RDWR, NULL)) {
+        if (bdrv_reopen(bs->backing->bs, open_flags | BDRV_O_RDWR, IGNORE_ERRORS)) {
             return -EACCES;
         }
     }
@@ -582,7 +582,7 @@ ro_cleanup:
 
     if (ro) {
         /* ignoring error return here */
-        bdrv_reopen(bs->backing->bs, open_flags & ~BDRV_O_RDWR, NULL);
+        bdrv_reopen(bs->backing->bs, open_flags & ~BDRV_O_RDWR, IGNORE_ERRORS);
     }
 
     return ret;
diff --git a/block/crypto.c b/block/crypto.c
index 10e5ddccaa..f317eda83f 100644
--- a/block/crypto.c
+++ b/block/crypto.c
@@ -601,7 +601,7 @@ block_crypto_get_specific_info_luks(BlockDriverState *bs)
     ImageInfoSpecific *spec_info;
     QCryptoBlockInfo *info;
 
-    info = qcrypto_block_get_info(crypto->block, NULL);
+    info = qcrypto_block_get_info(crypto->block, IGNORE_ERRORS);
     if (!info) {
         return NULL;
     }
diff --git a/block/file-posix.c b/block/file-posix.c
index de2d3a2e3c..5e30164be3 100644
--- a/block/file-posix.c
+++ b/block/file-posix.c
@@ -2175,14 +2175,14 @@ static int raw_check_perm(BlockDriverState *bs, uint64_t perm, uint64_t shared,
 static void raw_set_perm(BlockDriverState *bs, uint64_t perm, uint64_t shared)
 {
     BDRVRawState *s = bs->opaque;
-    raw_handle_perm_lock(bs, RAW_PL_COMMIT, perm, shared, NULL);
+    raw_handle_perm_lock(bs, RAW_PL_COMMIT, perm, shared, IGNORE_ERRORS);
     s->perm = perm;
     s->shared_perm = shared;
 }
 
 static void raw_abort_perm_update(BlockDriverState *bs)
 {
-    raw_handle_perm_lock(bs, RAW_PL_ABORT, 0, 0, NULL);
+    raw_handle_perm_lock(bs, RAW_PL_ABORT, 0, 0, IGNORE_ERRORS);
 }
 
 BlockDriver bdrv_file = {
diff --git a/block/gluster.c b/block/gluster.c
index 031596adbc..6179195620 100644
--- a/block/gluster.c
+++ b/block/gluster.c
@@ -547,7 +547,7 @@ static int qemu_gluster_parse_json(BlockdevOptionsGluster *gconf,
             ptr = "inet";       /* accept legacy "tcp" */
         }
         type = qapi_enum_parse(SocketAddressType_lookup, ptr,
-                               SOCKET_ADDRESS_TYPE__MAX, -1, NULL);
+                               SOCKET_ADDRESS_TYPE__MAX, -1, IGNORE_ERRORS);
         if (type != SOCKET_ADDRESS_TYPE_INET
             && type != SOCKET_ADDRESS_TYPE_UNIX) {
             error_setg(&local_err,
diff --git a/block/iscsi.c b/block/iscsi.c
index 9f1d94f7f1..0116fe97ce 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -1362,7 +1362,7 @@ static char *get_initiator_name(QemuOpts *opts)
         return g_strdup(name);
     }
 
-    uuid_info = qmp_query_uuid(NULL);
+    uuid_info = qmp_query_uuid(IGNORE_ERRORS);
     if (strcmp(uuid_info->UUID, UUID_NONE) == 0) {
         name = qemu_get_vm_name();
     } else {
@@ -2111,7 +2111,7 @@ static int iscsi_create(const char *filename, QemuOpts *opts, Error **errp)
         error_propagate(errp, local_err);
         ret = -EINVAL;
     } else {
-        ret = iscsi_open(bs, bs_options, 0, NULL);
+        ret = iscsi_open(bs, bs_options, 0, IGNORE_ERRORS);
     }
     QDECREF(bs_options);
 
diff --git a/block/mirror.c b/block/mirror.c
index a2a970301c..2d5d7dbbc2 100644
--- a/block/mirror.c
+++ b/block/mirror.c
@@ -550,7 +550,7 @@ static void mirror_exit(BlockJob *job, void *opaque)
         }
 
         if (bdrv_get_flags(target_bs) != bdrv_get_flags(to_replace)) {
-            bdrv_reopen(target_bs, bdrv_get_flags(to_replace), NULL);
+            bdrv_reopen(target_bs, bdrv_get_flags(to_replace), IGNORE_ERRORS);
         }
 
         /* The mirror job has no requests in flight any more, but we need to
@@ -729,7 +729,7 @@ static void coroutine_fn mirror_run(void *opaque)
         }
 
         if (s->bdev_length > base_length) {
-            ret = blk_truncate(s->target, s->bdev_length, NULL);
+            ret = blk_truncate(s->target, s->bdev_length, IGNORE_ERRORS);
             if (ret < 0) {
                 goto immediate_exit;
             }
@@ -1322,6 +1322,6 @@ void commit_active_start(const char *job_id, BlockDriverState *bs,
 error_restore_flags:
     /* ignore error and errp for bdrv_reopen, because we want to propagate
      * the original error */
-    bdrv_reopen(base, orig_base_flags, NULL);
+    bdrv_reopen(base, orig_base_flags, IGNORE_ERRORS);
     return;
 }
diff --git a/block/nbd-client.c b/block/nbd-client.c
index 87d19c7253..ac3f735d27 100644
--- a/block/nbd-client.c
+++ b/block/nbd-client.c
@@ -56,7 +56,7 @@ static void nbd_teardown_connection(BlockDriverState *bs)
     /* finish any pending coroutines */
     qio_channel_shutdown(client->ioc,
                          QIO_CHANNEL_SHUTDOWN_BOTH,
-                         NULL);
+                         IGNORE_ERRORS);
     BDRV_POLL_WHILE(bs, client->read_reply_co);
 
     nbd_client_detach_aio_context(bs);
@@ -145,7 +145,7 @@ static int nbd_co_send_request(BlockDriverState *bs,
         rc = nbd_send_request(s->ioc, request);
         if (rc >= 0) {
             ret = nbd_wr_syncv(s->ioc, qiov->iov, qiov->niov, request->len,
-                               false, NULL);
+                               false, IGNORE_ERRORS);
             if (ret != request->len) {
                 rc = -EIO;
             }
@@ -174,7 +174,7 @@ static void nbd_co_receive_reply(NBDClientSession *s,
     } else {
         if (qiov && reply->error == 0) {
             ret = nbd_wr_syncv(s->ioc, qiov->iov, qiov->niov, request->len,
-                               true, NULL);
+                               true, IGNORE_ERRORS);
             if (ret != request->len) {
                 reply->error = EIO;
             }
@@ -382,7 +382,7 @@ int nbd_client_init(BlockDriverState *bs,
 
     /* NBD handshake */
     logout("session init %s\n", export);
-    qio_channel_set_blocking(QIO_CHANNEL(sioc), true, NULL);
+    qio_channel_set_blocking(QIO_CHANNEL(sioc), true, IGNORE_ERRORS);
 
     ret = nbd_receive_negotiate(QIO_CHANNEL(sioc), export,
                                 &client->nbdflags,
@@ -413,7 +413,7 @@ int nbd_client_init(BlockDriverState *bs,
 
     /* Now that we're connected, set the socket to be non-blocking and
      * kick the reply mechanism.  */
-    qio_channel_set_blocking(QIO_CHANNEL(sioc), false, NULL);
+    qio_channel_set_blocking(QIO_CHANNEL(sioc), false, IGNORE_ERRORS);
     client->read_reply_co = qemu_coroutine_create(nbd_read_reply_entry, client);
     nbd_client_attach_aio_context(bs, bdrv_get_aio_context(bs));
 
diff --git a/block/parallels.c b/block/parallels.c
index 8be46a7d48..d4125a6220 100644
--- a/block/parallels.c
+++ b/block/parallels.c
@@ -224,7 +224,7 @@ static int64_t allocate_clusters(BlockDriverState *bs, int64_t sector_num,
         } else {
             ret = bdrv_truncate(bs->file,
                                 (s->data_end + space) << BDRV_SECTOR_BITS,
-                                NULL);
+                                IGNORE_ERRORS);
         }
         if (ret < 0) {
             return ret;
@@ -699,7 +699,7 @@ static int parallels_open(BlockDriverState *bs, QDict *options, int flags,
     }
 
     if (!(flags & BDRV_O_RESIZE) || !bdrv_has_zero_init(bs->file->bs) ||
-            bdrv_truncate(bs->file, bdrv_getlength(bs->file->bs), NULL) != 0) {
+            bdrv_truncate(bs->file, bdrv_getlength(bs->file->bs), IGNORE_ERRORS) != 0) {
         s->prealloc_mode = PRL_PREALLOC_MODE_FALLOCATE;
     }
 
@@ -742,7 +742,8 @@ static void parallels_close(BlockDriverState *bs)
     }
 
     if (bs->open_flags & BDRV_O_RDWR) {
-        bdrv_truncate(bs->file, s->data_end << BDRV_SECTOR_BITS, NULL);
+        bdrv_truncate(bs->file, s->data_end << BDRV_SECTOR_BITS,
+                      IGNORE_ERRORS);
     }
 
     g_free(s->bat_dirty_bmap);
diff --git a/block/qcow.c b/block/qcow.c
index 7bd94dcd46..13d7842db3 100644
--- a/block/qcow.c
+++ b/block/qcow.c
@@ -473,7 +473,8 @@ static uint64_t get_cluster_offset(BlockDriverState *bs,
                 /* round to cluster size */
                 cluster_offset = (cluster_offset + s->cluster_size - 1) &
                     ~(s->cluster_size - 1);
-                bdrv_truncate(bs->file, cluster_offset + s->cluster_size, NULL);
+                bdrv_truncate(bs->file, cluster_offset + s->cluster_size,
+                              IGNORE_ERRORS);
                 /* if encrypted, we must initialize the cluster
                    content which won't be written */
                 if (bs->encrypted &&
@@ -917,7 +918,8 @@ static int qcow_make_empty(BlockDriverState *bs)
     if (bdrv_pwrite_sync(bs->file, s->l1_table_offset, s->l1_table,
             l1_length) < 0)
         return -1;
-    ret = bdrv_truncate(bs->file, s->l1_table_offset + l1_length, NULL);
+    ret = bdrv_truncate(bs->file, s->l1_table_offset + l1_length,
+                        IGNORE_ERRORS);
     if (ret < 0)
         return ret;
 
diff --git a/block/qcow2.c b/block/qcow2.c
index b3ba5daa93..aa0dc46162 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -929,7 +929,7 @@ static int qcow2_do_open(BlockDriverState *bs, QDict *options, int flags,
     if (s->incompatible_features & ~QCOW2_INCOMPAT_MASK) {
         void *feature_table = NULL;
         qcow2_read_extensions(bs, header.header_length, ext_end,
-                              &feature_table, NULL);
+                              &feature_table, IGNORE_ERRORS);
         report_unsupported_feature(errp, feature_table,
                                    s->incompatible_features &
                                    ~QCOW2_INCOMPAT_MASK);
diff --git a/block/quorum.c b/block/quorum.c
index 1b2a8c3937..ab9f253c96 100644
--- a/block/quorum.c
+++ b/block/quorum.c
@@ -385,7 +385,7 @@ static int quorum_compute_hash(QuorumAIOCB *acb, int i, QuorumVoteValue *hash)
     if (qcrypto_hash_bytesv(QCRYPTO_HASH_ALG_SHA256,
                             qiov->iov, qiov->niov,
                             &data, &len,
-                            NULL) < 0) {
+                            IGNORE_ERRORS) < 0) {
         return -EINVAL;
     }
 
diff --git a/block/replication.c b/block/replication.c
index 3885f04c31..c4ac17201a 100644
--- a/block/replication.c
+++ b/block/replication.c
@@ -142,7 +142,7 @@ static void replication_close(BlockDriverState *bs)
     BDRVReplicationState *s = bs->opaque;
 
     if (s->stage == BLOCK_REPLICATION_RUNNING) {
-        replication_stop(s->rs, false, NULL);
+        replication_stop(s->rs, false, IGNORE_ERRORS);
     }
     if (s->stage == BLOCK_REPLICATION_FAILOVER) {
         block_job_cancel_sync(s->active_disk->bs->job);
@@ -389,13 +389,13 @@ static void backup_job_cleanup(BlockDriverState *bs)
     BDRVReplicationState *s = bs->opaque;
     BlockDriverState *top_bs;
 
-    top_bs = bdrv_lookup_bs(s->top_id, s->top_id, NULL);
+    top_bs = bdrv_lookup_bs(s->top_id, s->top_id, IGNORE_ERRORS);
     if (!top_bs) {
         return;
     }
     bdrv_op_unblock_all(top_bs, s->blocker);
     error_free(s->blocker);
-    reopen_backing_file(bs, false, NULL);
+    reopen_backing_file(bs, false, IGNORE_ERRORS);
 }
 
 static void backup_job_completed(void *opaque, int ret)
@@ -516,11 +516,11 @@ static void replication_start(ReplicationState *rs, ReplicationMode mode,
         error_setg(&s->blocker,
                    "Block device is in use by internal backup job");
 
-        top_bs = bdrv_lookup_bs(s->top_id, s->top_id, NULL);
+        top_bs = bdrv_lookup_bs(s->top_id, s->top_id, IGNORE_ERRORS);
         if (!top_bs || !bdrv_is_root_node(top_bs) ||
             !check_top_bs(top_bs, bs)) {
             error_setg(errp, "No top_bs or it is invalid");
-            reopen_backing_file(bs, false, NULL);
+            reopen_backing_file(bs, false, IGNORE_ERRORS);
             aio_context_release(aio_context);
             return;
         }
diff --git a/block/sheepdog.c b/block/sheepdog.c
index a18315a1ca..dd75571435 100644
--- a/block/sheepdog.c
+++ b/block/sheepdog.c
@@ -2020,7 +2020,7 @@ static int sd_create(const char *filename, QemuOpts *opts,
         BlockDriver *drv;
 
         /* Currently, only Sheepdog backing image is supported. */
-        drv = bdrv_find_protocol(backing_file, true, NULL);
+        drv = bdrv_find_protocol(backing_file, true, IGNORE_ERRORS);
         if (!drv || strcmp(drv->protocol_name, "sheepdog") != 0) {
             error_setg(errp, "backing_file must be a sheepdog image");
             ret = -EINVAL;
@@ -2448,7 +2448,7 @@ static coroutine_fn int sd_co_writev(BlockDriverState *bs, int64_t sector_num,
     BDRVSheepdogState *s = bs->opaque;
 
     if (offset > s->inode.vdi_size) {
-        ret = sd_truncate(bs, offset, NULL);
+        ret = sd_truncate(bs, offset, IGNORE_ERRORS);
         if (ret < 0) {
             return ret;
         }
diff --git a/block/stream.c b/block/stream.c
index 52d329f5c6..826783635a 100644
--- a/block/stream.c
+++ b/block/stream.c
@@ -93,7 +93,7 @@ out:
     if (s->bs_flags != bdrv_get_flags(bs)) {
         /* Give up write permissions before making it read-only */
         blk_set_perm(job->blk, 0, BLK_PERM_ALL, &error_abort);
-        bdrv_reopen(bs, s->bs_flags, NULL);
+        bdrv_reopen(bs, s->bs_flags, IGNORE_ERRORS);
     }
 
     g_free(s->backing_file_str);
@@ -280,6 +280,6 @@ void stream_start(const char *job_id, BlockDriverState *bs,
 
 fail:
     if (orig_bs_flags != bdrv_get_flags(bs)) {
-        bdrv_reopen(bs, orig_bs_flags, NULL);
+        bdrv_reopen(bs, orig_bs_flags, IGNORE_ERRORS);
     }
 }
diff --git a/block/vhdx-log.c b/block/vhdx-log.c
index 3f4c2aa095..906d5439fb 100644
--- a/block/vhdx-log.c
+++ b/block/vhdx-log.c
@@ -548,7 +548,7 @@ static int vhdx_log_flush(BlockDriverState *bs, BDRVVHDXState *s,
             if (new_file_size % (1024*1024)) {
                 /* round up to nearest 1MB boundary */
                 new_file_size = ((new_file_size >> 20) + 1) << 20;
-                bdrv_truncate(bs->file, new_file_size, NULL);
+                bdrv_truncate(bs->file, new_file_size, IGNORE_ERRORS);
             }
         }
         qemu_vfree(desc_entries);
diff --git a/block/vhdx.c b/block/vhdx.c
index 8b270b57c9..890afe064b 100644
--- a/block/vhdx.c
+++ b/block/vhdx.c
@@ -1171,7 +1171,7 @@ static int vhdx_allocate_block(BlockDriverState *bs, BDRVVHDXState *s,
     /* per the spec, the address for a block is in units of 1MB */
     *new_offset = ROUND_UP(*new_offset, 1024 * 1024);
 
-    return bdrv_truncate(bs->file, *new_offset + s->block_size, NULL);
+    return bdrv_truncate(bs->file, *new_offset + s->block_size, IGNORE_ERRORS);
 }
 
 /*
diff --git a/blockdev-nbd.c b/blockdev-nbd.c
index dd0860f4a6..e7bf14a8ed 100644
--- a/blockdev-nbd.c
+++ b/blockdev-nbd.c
@@ -38,7 +38,7 @@ static gboolean nbd_accept(QIOChannel *ioc, GIOCondition condition,
     }
 
     cioc = qio_channel_socket_accept(QIO_CHANNEL_SOCKET(ioc),
-                                     NULL);
+                                     IGNORE_ERRORS);
     if (!cioc) {
         return TRUE;
     }
diff --git a/blockdev.c b/blockdev.c
index 6472548186..fdbf33aa3d 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -1377,7 +1377,7 @@ static BdrvDirtyBitmap *block_dirty_bitmap_lookup(const char *node,
         error_setg(errp, "Bitmap name cannot be NULL");
         return NULL;
     }
-    bs = bdrv_lookup_bs(node, node, NULL);
+    bs = bdrv_lookup_bs(node, node, IGNORE_ERRORS);
     if (!bs) {
         error_setg(errp, "Node '%s' not found", node);
         return NULL;
@@ -1707,7 +1707,7 @@ static void external_snapshot_prepare(BlkActionState *common,
         }
 
         if (snapshot_node_name &&
-            bdrv_lookup_bs(snapshot_node_name, snapshot_node_name, NULL)) {
+            bdrv_lookup_bs(snapshot_node_name, snapshot_node_name, IGNORE_ERRORS)) {
             error_setg(errp, "New snapshot node name already in use");
             return;
         }
@@ -1793,7 +1793,7 @@ static void external_snapshot_commit(BlkActionState *common)
      * don't want to abort all of them if one of them fails the reopen */
     if (!state->old_bs->copy_on_read) {
         bdrv_reopen(state->old_bs, state->old_bs->open_flags & ~BDRV_O_RDWR,
-                    NULL);
+                    IGNORE_ERRORS);
     }
 }
 
@@ -2916,7 +2916,7 @@ void qmp_block_resize(bool has_device, const char *device,
         goto out;
     }
 
-    if (bdrv_op_is_blocked(bs, BLOCK_OP_TYPE_RESIZE, NULL)) {
+    if (bdrv_op_is_blocked(bs, BLOCK_OP_TYPE_RESIZE, IGNORE_ERRORS)) {
         error_setg(errp, QERR_DEVICE_IN_USE, device);
         goto out;
     }
@@ -3055,7 +3055,7 @@ void qmp_block_commit(bool has_job_id, const char *job_id, const char *device,
      *  scenario in which all optional arguments are omitted. */
     bs = qmp_get_root_bs(device, &local_err);
     if (!bs) {
-        bs = bdrv_lookup_bs(device, device, NULL);
+        bs = bdrv_lookup_bs(device, device, IGNORE_ERRORS);
         if (!bs) {
             error_free(local_err);
             error_set(errp, ERROR_CLASS_DEVICE_NOT_FOUND,
diff --git a/blockjob.c b/blockjob.c
index a0d7e29b83..69ad28dd65 100644
--- a/blockjob.c
+++ b/blockjob.c
@@ -419,7 +419,7 @@ static void block_job_completed_txn_abort(BlockJob *job)
         ctx = blk_get_aio_context(other_job->blk);
         if (!other_job->completed) {
             assert(other_job->cancelled);
-            block_job_finish_sync(other_job, NULL, NULL);
+            block_job_finish_sync(other_job, NULL, IGNORE_ERRORS);
         }
         block_job_completed_single(other_job);
         aio_context_release(ctx);
@@ -523,7 +523,7 @@ static void block_job_cancel_err(BlockJob *job, Error **errp)
 
 int block_job_cancel_sync(BlockJob *job)
 {
-    return block_job_finish_sync(job, &block_job_cancel_err, NULL);
+    return block_job_finish_sync(job, &block_job_cancel_err, IGNORE_ERRORS);
 }
 
 void block_job_cancel_sync_all(void)
diff --git a/bootdevice.c b/bootdevice.c
index 33e3029e40..29ebbb1c48 100644
--- a/bootdevice.c
+++ b/bootdevice.c
@@ -338,5 +338,5 @@ void device_add_bootindex_property(Object *obj, int32_t *bootindex,
         return;
     }
     /* initialize devices' bootindex property to -1 */
-    object_property_set_int(obj, -1, name, NULL);
+    object_property_set_int(obj, -1, name, IGNORE_ERRORS);
 }
diff --git a/bsd-user/elfload.c b/bsd-user/elfload.c
index 0d626a418a..6362238dbf 100644
--- a/bsd-user/elfload.c
+++ b/bsd-user/elfload.c
@@ -93,7 +93,8 @@ enum {
 static const char *get_elf_platform(void)
 {
     static char elf_platform[] = "i386";
-    int family = object_property_get_int(OBJECT(thread_cpu), "family", NULL);
+    int family = object_property_get_int(OBJECT(thread_cpu), "family",
+                                         IGNORE_ERRORS);
     if (family > 6)
         family = 6;
     if (family >= 3)
diff --git a/chardev/char-fd.c b/chardev/char-fd.c
index 1584a3de20..b0ebccf0c6 100644
--- a/chardev/char-fd.c
+++ b/chardev/char-fd.c
@@ -56,7 +56,7 @@ static gboolean fd_chr_read(QIOChannel *chan, GIOCondition cond, void *opaque)
     }
 
     ret = qio_channel_read(
-        chan, (gchar *)buf, len, NULL);
+        chan, (gchar *)buf, len, IGNORE_ERRORS);
     if (ret == 0) {
         remove_fd_in_watch(chr);
         qemu_chr_be_event(chr, CHR_EVENT_CLOSED);
diff --git a/chardev/char-io.c b/chardev/char-io.c
index a017af784d..13a2431b34 100644
--- a/chardev/char-io.c
+++ b/chardev/char-io.c
@@ -161,7 +161,7 @@ int io_channel_send_full(QIOChannel *ioc,
 
         ret = qio_channel_writev_full(
             ioc, &iov, 1,
-            fds, nfds, NULL);
+            fds, nfds, IGNORE_ERRORS);
         if (ret == QIO_CHANNEL_ERR_BLOCK) {
             if (offset) {
                 return offset;
diff --git a/chardev/char-pty.c b/chardev/char-pty.c
index e5d20a0e6a..09609d397d 100644
--- a/chardev/char-pty.c
+++ b/chardev/char-pty.c
@@ -168,7 +168,7 @@ static gboolean pty_chr_read(QIOChannel *chan, GIOCondition cond, void *opaque)
     if (len == 0) {
         return TRUE;
     }
-    ret = qio_channel_read(s->ioc, (char *)buf, len, NULL);
+    ret = qio_channel_read(s->ioc, (char *)buf, len, IGNORE_ERRORS);
     if (ret <= 0) {
         pty_chr_state(chr, 0);
         return FALSE;
diff --git a/chardev/char-socket.c b/chardev/char-socket.c
index ccc499cfa1..7ca9863631 100644
--- a/chardev/char-socket.c
+++ b/chardev/char-socket.c
@@ -276,11 +276,11 @@ static ssize_t tcp_chr_recv(Chardev *chr, char *buf, size_t len)
     if (qio_channel_has_feature(s->ioc, QIO_CHANNEL_FEATURE_FD_PASS)) {
         ret = qio_channel_readv_full(s->ioc, &iov, 1,
                                      &msgfds, &msgfds_num,
-                                     NULL);
+                                     IGNORE_ERRORS);
     } else {
         ret = qio_channel_readv_full(s->ioc, &iov, 1,
                                      NULL, NULL,
-                                     NULL);
+                                     IGNORE_ERRORS);
     }
 
     if (ret == QIO_CHANNEL_ERR_BLOCK) {
@@ -550,7 +550,7 @@ static gboolean tcp_chr_telnet_init_io(QIOChannel *ioc,
     TCPChardevTelnetInit *init = user_data;
     ssize_t ret;
 
-    ret = qio_channel_write(ioc, init->buf, init->buflen, NULL);
+    ret = qio_channel_write(ioc, init->buf, init->buflen, IGNORE_ERRORS);
     if (ret < 0) {
         if (ret == QIO_CHANNEL_ERR_BLOCK) {
             ret = 0;
@@ -620,7 +620,7 @@ static void tcp_chr_tls_handshake(QIOTask *task,
     Chardev *chr = user_data;
     SocketChardev *s = user_data;
 
-    if (qio_task_propagate_error(task, NULL)) {
+    if (qio_task_propagate_error(task, IGNORE_ERRORS)) {
         tcp_chr_disconnect(chr);
     } else {
         /* tn3270 does not support TLS yet */
@@ -697,7 +697,7 @@ static int tcp_chr_new_client(Chardev *chr, QIOChannelSocket *sioc)
     s->sioc = sioc;
     object_ref(OBJECT(sioc));
 
-    qio_channel_set_blocking(s->ioc, false, NULL);
+    qio_channel_set_blocking(s->ioc, false, IGNORE_ERRORS);
 
     if (s->do_nodelay) {
         qio_channel_set_delay(s->ioc, false);
@@ -726,7 +726,7 @@ static int tcp_chr_add_client(Chardev *chr, int fd)
     int ret;
     QIOChannelSocket *sioc;
 
-    sioc = qio_channel_socket_new_fd(fd, NULL);
+    sioc = qio_channel_socket_new_fd(fd, IGNORE_ERRORS);
     if (!sioc) {
         return -1;
     }
@@ -744,7 +744,7 @@ static gboolean tcp_chr_accept(QIOChannel *channel,
     QIOChannelSocket *sioc;
 
     sioc = qio_channel_socket_accept(QIO_CHANNEL_SOCKET(channel),
-                                     NULL);
+                                     IGNORE_ERRORS);
     if (!sioc) {
         return TRUE;
     }
@@ -767,9 +767,11 @@ static int tcp_chr_wait_connected(Chardev *chr, Error **errp)
         if (s->is_listen) {
             error_report("QEMU waiting for connection on: %s",
                          chr->filename);
-            qio_channel_set_blocking(QIO_CHANNEL(s->listen_ioc), true, NULL);
+            qio_channel_set_blocking(QIO_CHANNEL(s->listen_ioc), true,
+                                     IGNORE_ERRORS);
             tcp_chr_accept(QIO_CHANNEL(s->listen_ioc), G_IO_IN, chr);
-            qio_channel_set_blocking(QIO_CHANNEL(s->listen_ioc), false, NULL);
+            qio_channel_set_blocking(QIO_CHANNEL(s->listen_ioc), false,
+                                     IGNORE_ERRORS);
         } else {
             sioc = qio_channel_socket_new();
             tcp_chr_set_client_ioc_name(chr, sioc);
diff --git a/chardev/char-udp.c b/chardev/char-udp.c
index 4ee11d3ebf..d8766b1fd0 100644
--- a/chardev/char-udp.c
+++ b/chardev/char-udp.c
@@ -48,7 +48,7 @@ static int udp_chr_write(Chardev *chr, const uint8_t *buf, int len)
     UdpChardev *s = UDP_CHARDEV(chr);
 
     return qio_channel_write(
-        s->ioc, (const char *)buf, len, NULL);
+        s->ioc, (const char *)buf, len, IGNORE_ERRORS);
 }
 
 static void udp_chr_flush_buffer(UdpChardev *s)
@@ -88,7 +88,7 @@ static gboolean udp_chr_read(QIOChannel *chan, GIOCondition cond, void *opaque)
         return TRUE;
     }
     ret = qio_channel_read(
-        s->ioc, (char *)s->buf, sizeof(s->buf), NULL);
+        s->ioc, (char *)s->buf, sizeof(s->buf), IGNORE_ERRORS);
     if (ret <= 0) {
         remove_fd_in_watch(chr);
         return FALSE;
diff --git a/crypto/secret.c b/crypto/secret.c
index 285ab7a63c..e5631b9dd2 100644
--- a/crypto/secret.c
+++ b/crypto/secret.c
@@ -375,29 +375,29 @@ qcrypto_secret_class_init(ObjectClass *oc, void *data)
     object_class_property_add_bool(oc, "loaded",
                                    qcrypto_secret_prop_get_loaded,
                                    qcrypto_secret_prop_set_loaded,
-                                   NULL);
+                                   IGNORE_ERRORS);
     object_class_property_add_enum(oc, "format",
                                    "QCryptoSecretFormat",
                                    QCryptoSecretFormat_lookup,
                                    qcrypto_secret_prop_get_format,
                                    qcrypto_secret_prop_set_format,
-                                   NULL);
+                                   IGNORE_ERRORS);
     object_class_property_add_str(oc, "data",
                                   qcrypto_secret_prop_get_data,
                                   qcrypto_secret_prop_set_data,
-                                  NULL);
+                                  IGNORE_ERRORS);
     object_class_property_add_str(oc, "file",
                                   qcrypto_secret_prop_get_file,
                                   qcrypto_secret_prop_set_file,
-                                  NULL);
+                                  IGNORE_ERRORS);
     object_class_property_add_str(oc, "keyid",
                                   qcrypto_secret_prop_get_keyid,
                                   qcrypto_secret_prop_set_keyid,
-                                  NULL);
+                                  IGNORE_ERRORS);
     object_class_property_add_str(oc, "iv",
                                   qcrypto_secret_prop_get_iv,
                                   qcrypto_secret_prop_set_iv,
-                                  NULL);
+                                  IGNORE_ERRORS);
 }
 
 
diff --git a/crypto/tlscreds.c b/crypto/tlscreds.c
index a8965531b6..21bd388769 100644
--- a/crypto/tlscreds.c
+++ b/crypto/tlscreds.c
@@ -226,21 +226,21 @@ qcrypto_tls_creds_class_init(ObjectClass *oc, void *data)
     object_class_property_add_bool(oc, "verify-peer",
                                    qcrypto_tls_creds_prop_get_verify,
                                    qcrypto_tls_creds_prop_set_verify,
-                                   NULL);
+                                   IGNORE_ERRORS);
     object_class_property_add_str(oc, "dir",
                                   qcrypto_tls_creds_prop_get_dir,
                                   qcrypto_tls_creds_prop_set_dir,
-                                  NULL);
+                                  IGNORE_ERRORS);
     object_class_property_add_enum(oc, "endpoint",
                                    "QCryptoTLSCredsEndpoint",
                                    QCryptoTLSCredsEndpoint_lookup,
                                    qcrypto_tls_creds_prop_get_endpoint,
                                    qcrypto_tls_creds_prop_set_endpoint,
-                                   NULL);
+                                   IGNORE_ERRORS);
     object_class_property_add_str(oc, "priority",
                                   qcrypto_tls_creds_prop_get_priority,
                                   qcrypto_tls_creds_prop_set_priority,
-                                  NULL);
+                                  IGNORE_ERRORS);
 }
 
 
diff --git a/crypto/tlscredsanon.c b/crypto/tlscredsanon.c
index 1464220080..ad6f331aca 100644
--- a/crypto/tlscredsanon.c
+++ b/crypto/tlscredsanon.c
@@ -191,7 +191,7 @@ qcrypto_tls_creds_anon_class_init(ObjectClass *oc, void *data)
     object_class_property_add_bool(oc, "loaded",
                                    qcrypto_tls_creds_anon_prop_get_loaded,
                                    qcrypto_tls_creds_anon_prop_set_loaded,
-                                   NULL);
+                                   IGNORE_ERRORS);
 }
 
 
diff --git a/crypto/tlscredsx509.c b/crypto/tlscredsx509.c
index 50eb54f6bb..f4dc85cb75 100644
--- a/crypto/tlscredsx509.c
+++ b/crypto/tlscredsx509.c
@@ -833,15 +833,15 @@ qcrypto_tls_creds_x509_class_init(ObjectClass *oc, void *data)
     object_class_property_add_bool(oc, "loaded",
                                    qcrypto_tls_creds_x509_prop_get_loaded,
                                    qcrypto_tls_creds_x509_prop_set_loaded,
-                                   NULL);
+                                   IGNORE_ERRORS);
     object_class_property_add_bool(oc, "sanity-check",
                                    qcrypto_tls_creds_x509_prop_get_sanity,
                                    qcrypto_tls_creds_x509_prop_set_sanity,
-                                   NULL);
+                                   IGNORE_ERRORS);
     object_class_property_add_str(oc, "passwordid",
                                   qcrypto_tls_creds_x509_prop_get_passwordid,
                                   qcrypto_tls_creds_x509_prop_set_passwordid,
-                                  NULL);
+                                  IGNORE_ERRORS);
 }
 
 
diff --git a/dump.c b/dump.c
index d9090a24cc..dc78c98b23 100644
--- a/dump.c
+++ b/dump.c
@@ -1681,7 +1681,7 @@ static void dump_process(DumpState *s, Error **errp)
                (local_err ? DUMP_STATUS_FAILED : DUMP_STATUS_COMPLETED));
 
     /* send DUMP_COMPLETED message (unconditionally) */
-    result = qmp_query_dump(NULL);
+    result = qmp_query_dump(IGNORE_ERRORS);
     /* should never fail */
     assert(result);
     qapi_event_send_dump_completed(result, !!local_err, (local_err ? \
diff --git a/exec.c b/exec.c
index 67fc5b92b9..9d73a63f1c 100644
--- a/exec.c
+++ b/exec.c
@@ -1404,7 +1404,7 @@ static int find_max_supported_pagesize(Object *obj, void *opaque)
     long *hpsize_min = opaque;
 
     if (object_dynamic_cast(obj, TYPE_MEMORY_BACKEND)) {
-        mem_path = object_property_get_str(obj, "mem-path", NULL);
+        mem_path = object_property_get_str(obj, "mem-path", IGNORE_ERRORS);
         if (mem_path) {
             long hpsize = qemu_mempath_getpagesize(mem_path);
             if (hpsize < *hpsize_min) {
diff --git a/hmp.c b/hmp.c
index f92445827c..cd87d7dfd6 100644
--- a/hmp.c
+++ b/hmp.c
@@ -59,7 +59,7 @@ void hmp_info_name(Monitor *mon, const QDict *qdict)
 {
     NameInfo *info;
 
-    info = qmp_query_name(NULL);
+    info = qmp_query_name(IGNORE_ERRORS);
     if (info->has_name) {
         monitor_printf(mon, "%s\n", info->name);
     }
@@ -70,7 +70,7 @@ void hmp_info_version(Monitor *mon, const QDict *qdict)
 {
     VersionInfo *info;
 
-    info = qmp_query_version(NULL);
+    info = qmp_query_version(IGNORE_ERRORS);
 
     monitor_printf(mon, "%" PRId64 ".%" PRId64 ".%" PRId64 "%s\n",
                    info->qemu->major, info->qemu->minor, info->qemu->micro,
@@ -83,7 +83,7 @@ void hmp_info_kvm(Monitor *mon, const QDict *qdict)
 {
     KvmInfo *info;
 
-    info = qmp_query_kvm(NULL);
+    info = qmp_query_kvm(IGNORE_ERRORS);
     monitor_printf(mon, "kvm support: ");
     if (info->present) {
         monitor_printf(mon, "%s\n", info->enabled ? "enabled" : "disabled");
@@ -98,7 +98,7 @@ void hmp_info_status(Monitor *mon, const QDict *qdict)
 {
     StatusInfo *info;
 
-    info = qmp_query_status(NULL);
+    info = qmp_query_status(IGNORE_ERRORS);
 
     monitor_printf(mon, "VM status: %s%s",
                    info->running ? "running" : "paused",
@@ -117,7 +117,7 @@ void hmp_info_uuid(Monitor *mon, const QDict *qdict)
 {
     UuidInfo *info;
 
-    info = qmp_query_uuid(NULL);
+    info = qmp_query_uuid(IGNORE_ERRORS);
     monitor_printf(mon, "%s\n", info->UUID);
     qapi_free_UuidInfo(info);
 }
@@ -126,7 +126,7 @@ void hmp_info_chardev(Monitor *mon, const QDict *qdict)
 {
     ChardevInfoList *char_info, *info;
 
-    char_info = qmp_query_chardev(NULL);
+    char_info = qmp_query_chardev(IGNORE_ERRORS);
     for (info = char_info; info; info = info->next) {
         monitor_printf(mon, "%s: filename=%s\n", info->value->label,
                                                  info->value->filename);
@@ -139,7 +139,7 @@ void hmp_info_mice(Monitor *mon, const QDict *qdict)
 {
     MouseInfoList *mice_list, *mouse;
 
-    mice_list = qmp_query_mice(NULL);
+    mice_list = qmp_query_mice(IGNORE_ERRORS);
     if (!mice_list) {
         monitor_printf(mon, "No mouse devices connected\n");
         return;
@@ -160,8 +160,8 @@ void hmp_info_migrate(Monitor *mon, const QDict *qdict)
     MigrationInfo *info;
     MigrationCapabilityStatusList *caps, *cap;
 
-    info = qmp_query_migrate(NULL);
-    caps = qmp_query_migrate_capabilities(NULL);
+    info = qmp_query_migrate(IGNORE_ERRORS);
+    caps = qmp_query_migrate_capabilities(IGNORE_ERRORS);
 
     /* do not display parameters during setup */
     if (info->has_status && caps) {
@@ -269,7 +269,7 @@ void hmp_info_migrate_capabilities(Monitor *mon, const QDict *qdict)
 {
     MigrationCapabilityStatusList *caps, *cap;
 
-    caps = qmp_query_migrate_capabilities(NULL);
+    caps = qmp_query_migrate_capabilities(IGNORE_ERRORS);
 
     if (caps) {
         for (cap = caps; cap; cap = cap->next) {
@@ -286,7 +286,7 @@ void hmp_info_migrate_parameters(Monitor *mon, const QDict *qdict)
 {
     MigrationParameters *params;
 
-    params = qmp_query_migrate_parameters(NULL);
+    params = qmp_query_migrate_parameters(IGNORE_ERRORS);
 
     if (params) {
         assert(params->has_compress_level);
@@ -339,14 +339,14 @@ void hmp_info_migrate_parameters(Monitor *mon, const QDict *qdict)
 void hmp_info_migrate_cache_size(Monitor *mon, const QDict *qdict)
 {
     monitor_printf(mon, "xbzrel cache size: %" PRId64 " kbytes\n",
-                   qmp_query_migrate_cache_size(NULL) >> 10);
+                   qmp_query_migrate_cache_size(IGNORE_ERRORS) >> 10);
 }
 
 void hmp_info_cpus(Monitor *mon, const QDict *qdict)
 {
     CpuInfoList *cpu_list, *cpu;
 
-    cpu_list = qmp_query_cpus(NULL);
+    cpu_list = qmp_query_cpus(IGNORE_ERRORS);
 
     for (cpu = cpu_list; cpu; cpu = cpu->next) {
         int active = ' ';
@@ -513,7 +513,7 @@ void hmp_info_block(Monitor *mon, const QDict *qdict)
 
     /* Print BlockBackend information */
     if (!nodes) {
-        block_list = qmp_query_block(NULL);
+        block_list = qmp_query_block(IGNORE_ERRORS);
     } else {
         block_list = NULL;
     }
@@ -540,7 +540,7 @@ void hmp_info_block(Monitor *mon, const QDict *qdict)
     }
 
     /* Print node information */
-    blockdev_list = qmp_query_named_block_nodes(NULL);
+    blockdev_list = qmp_query_named_block_nodes(IGNORE_ERRORS);
     for (blockdev = blockdev_list; blockdev; blockdev = blockdev->next) {
         assert(blockdev->value->has_node_name);
         if (device && strcmp(device, blockdev->value->node_name)) {
@@ -560,7 +560,7 @@ void hmp_info_blockstats(Monitor *mon, const QDict *qdict)
 {
     BlockStatsList *stats_list, *stats;
 
-    stats_list = qmp_query_blockstats(false, false, NULL);
+    stats_list = qmp_query_blockstats(false, false, IGNORE_ERRORS);
 
     for (stats = stats_list; stats; stats = stats->next) {
         if (!stats->value->has_device) {
@@ -667,7 +667,7 @@ void hmp_info_spice(Monitor *mon, const QDict *qdict)
 #endif
     };
 
-    info = qmp_query_spice(NULL);
+    info = qmp_query_spice(IGNORE_ERRORS);
 
     if (!info->enabled) {
         monitor_printf(mon, "Server: disabled\n");
@@ -985,22 +985,22 @@ void hmp_info_tpm(Monitor *mon, const QDict *qdict)
 void hmp_quit(Monitor *mon, const QDict *qdict)
 {
     monitor_suspend(mon);
-    qmp_quit(NULL);
+    qmp_quit(IGNORE_ERRORS);
 }
 
 void hmp_stop(Monitor *mon, const QDict *qdict)
 {
-    qmp_stop(NULL);
+    qmp_stop(IGNORE_ERRORS);
 }
 
 void hmp_system_reset(Monitor *mon, const QDict *qdict)
 {
-    qmp_system_reset(NULL);
+    qmp_system_reset(IGNORE_ERRORS);
 }
 
 void hmp_system_powerdown(Monitor *mon, const QDict *qdict)
 {
-    qmp_system_powerdown(NULL);
+    qmp_system_powerdown(IGNORE_ERRORS);
 }
 
 void hmp_cpu(Monitor *mon, const QDict *qdict)
@@ -1087,7 +1087,7 @@ void hmp_ringbuf_read(Monitor *mon, const QDict *qdict)
 static void hmp_cont_cb(void *opaque, int err)
 {
     if (!err) {
-        qmp_cont(NULL);
+        qmp_cont(IGNORE_ERRORS);
     }
 }
 
@@ -1101,7 +1101,7 @@ void hmp_cont(Monitor *mon, const QDict *qdict)
     BlockInfoList *bdev_list, *bdev;
     Error *err = NULL;
 
-    bdev_list = qmp_query_block(NULL);
+    bdev_list = qmp_query_block(IGNORE_ERRORS);
     for (bdev = bdev_list; bdev; bdev = bdev->next) {
         if (key_is_missing(bdev->value)) {
             monitor_read_block_device_key(mon, bdev->value->device,
@@ -1119,7 +1119,7 @@ out:
 
 void hmp_system_wakeup(Monitor *mon, const QDict *qdict)
 {
-    qmp_system_wakeup(NULL);
+    qmp_system_wakeup(IGNORE_ERRORS);
 }
 
 void hmp_nmi(Monitor *mon, const QDict *qdict)
@@ -1456,7 +1456,7 @@ void hmp_info_snapshots(Monitor *mon, const QDict *qdict)
 
 void hmp_migrate_cancel(Monitor *mon, const QDict *qdict)
 {
-    qmp_migrate_cancel(NULL);
+    qmp_migrate_cancel(IGNORE_ERRORS);
 }
 
 void hmp_migrate_incoming(Monitor *mon, const QDict *qdict)
@@ -1473,7 +1473,7 @@ void hmp_migrate_incoming(Monitor *mon, const QDict *qdict)
 void hmp_migrate_set_downtime(Monitor *mon, const QDict *qdict)
 {
     double value = qdict_get_double(qdict, "value");
-    qmp_migrate_set_downtime(value, NULL);
+    qmp_migrate_set_downtime(value, IGNORE_ERRORS);
 }
 
 void hmp_migrate_set_cache_size(Monitor *mon, const QDict *qdict)
@@ -1492,7 +1492,7 @@ void hmp_migrate_set_cache_size(Monitor *mon, const QDict *qdict)
 void hmp_migrate_set_speed(Monitor *mon, const QDict *qdict)
 {
     int64_t value = qdict_get_int(qdict, "value");
-    qmp_migrate_set_speed(value, NULL);
+    qmp_migrate_set_speed(value, IGNORE_ERRORS);
 }
 
 void hmp_migrate_set_capability(Monitor *mon, const QDict *qdict)
@@ -1695,7 +1695,7 @@ void hmp_eject(Monitor *mon, const QDict *qdict)
 static void hmp_change_read_arg(void *opaque, const char *password,
                                 void *readline_opaque)
 {
-    qmp_change_vnc_password(password, NULL);
+    qmp_change_vnc_password(password, IGNORE_ERRORS);
     monitor_read_command(opaque, 1);
 }
 
@@ -1844,7 +1844,7 @@ static void hmp_migrate_status_cb(void *opaque)
     HMPMigrationStatus *status = opaque;
     MigrationInfo *info;
 
-    info = qmp_query_migrate(NULL);
+    info = qmp_query_migrate(IGNORE_ERRORS);
     if (!info->has_status || info->status == MIGRATION_STATUS_ACTIVE ||
         info->status == MIGRATION_STATUS_SETUP) {
         if (info->has_disk) {
@@ -2154,7 +2154,7 @@ void hmp_nbd_server_start(Monitor *mon, const QDict *qdict)
     /* Then try adding all block devices.  If one fails, close all and
      * exit.
      */
-    block_list = qmp_query_block(NULL);
+    block_list = qmp_query_block(IGNORE_ERRORS);
 
     for (info = block_list; info; info = info->next) {
         if (!info->value->has_inserted) {
@@ -2164,7 +2164,7 @@ void hmp_nbd_server_start(Monitor *mon, const QDict *qdict)
         qmp_nbd_server_add(info->value->device, true, writable, &local_err);
 
         if (local_err != NULL) {
-            qmp_nbd_server_stop(NULL);
+            qmp_nbd_server_stop(IGNORE_ERRORS);
             break;
         }
     }
@@ -2308,7 +2308,7 @@ void hmp_info_memdev(Monitor *mon, const QDict *qdict)
 
     while (m) {
         v = string_output_visitor_new(false, &str);
-        visit_type_uint16List(v, NULL, &m->value->host_nodes, NULL);
+        visit_type_uint16List(v, NULL, &m->value->host_nodes, IGNORE_ERRORS);
         monitor_printf(mon, "memory backend: %s\n", m->value->id);
         monitor_printf(mon, "  size:  %" PRId64 "\n", m->value->size);
         monitor_printf(mon, "  merge: %s\n",
@@ -2372,7 +2372,7 @@ void hmp_info_memory_devices(Monitor *mon, const QDict *qdict)
 
 void hmp_info_iothreads(Monitor *mon, const QDict *qdict)
 {
-    IOThreadInfoList *info_list = qmp_query_iothreads(NULL);
+    IOThreadInfoList *info_list = qmp_query_iothreads(IGNORE_ERRORS);
     IOThreadInfoList *info;
     IOThreadInfo *value;
 
@@ -2740,7 +2740,7 @@ void hmp_rocker_of_dpa_groups(Monitor *mon, const QDict *qdict)
 
 void hmp_info_dump(Monitor *mon, const QDict *qdict)
 {
-    DumpQueryResult *result = qmp_query_dump(NULL);
+    DumpQueryResult *result = qmp_query_dump(IGNORE_ERRORS);
 
     assert(result && result->status < DUMP_STATUS__MAX);
     monitor_printf(mon, "Status: %s\n", DumpStatus_lookup[result->status]);
diff --git a/hw/9pfs/xen-9p-backend.c b/hw/9pfs/xen-9p-backend.c
index 6ab999d2ce..5c7dcfd61b 100644
--- a/hw/9pfs/xen-9p-backend.c
+++ b/hw/9pfs/xen-9p-backend.c
@@ -401,13 +401,14 @@ static int xen_9pfs_connect(struct XenDevice *xendev)
     v9fs_register_transport(s, &xen_9p_transport);
     fsdev = qemu_opts_create(qemu_find_opts("fsdev"),
             s->fsconf.tag,
-            1, NULL);
-    qemu_opt_set(fsdev, "fsdriver", "local", NULL);
-    qemu_opt_set(fsdev, "path", xen_9pdev->path, NULL);
-    qemu_opt_set(fsdev, "security_model", xen_9pdev->security_model, NULL);
+            1, IGNORE_ERRORS);
+    qemu_opt_set(fsdev, "fsdriver", "local", IGNORE_ERRORS);
+    qemu_opt_set(fsdev, "path", xen_9pdev->path, IGNORE_ERRORS);
+    qemu_opt_set(fsdev, "security_model", xen_9pdev->security_model,
+                 IGNORE_ERRORS);
     qemu_opts_set_id(fsdev, s->fsconf.fsdev_id);
     qemu_fsdev_add(fsdev);
-    v9fs_device_realize_common(s, NULL);
+    v9fs_device_realize_common(s, IGNORE_ERRORS);
 
     return 0;
 
diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c
index 5c279bbaca..54e422a39f 100644
--- a/hw/acpi/ich9.c
+++ b/hw/acpi/ich9.c
@@ -455,33 +455,33 @@ void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs *pm, Error **errp)
                                    &pm->pm_io_base, errp);
     object_property_add(obj, ACPI_PM_PROP_GPE0_BLK, "uint32",
                         ich9_pm_get_gpe0_blk,
-                        NULL, NULL, pm, NULL);
+                        NULL, NULL, pm, IGNORE_ERRORS);
     object_property_add_uint32_ptr(obj, ACPI_PM_PROP_GPE0_BLK_LEN,
                                    &gpe0_len, errp);
     object_property_add_bool(obj, "memory-hotplug-support",
                              ich9_pm_get_memory_hotplug_support,
                              ich9_pm_set_memory_hotplug_support,
-                             NULL);
+                             IGNORE_ERRORS);
     object_property_add_bool(obj, "cpu-hotplug-legacy",
                              ich9_pm_get_cpu_hotplug_legacy,
                              ich9_pm_set_cpu_hotplug_legacy,
-                             NULL);
+                             IGNORE_ERRORS);
     object_property_add(obj, ACPI_PM_PROP_S3_DISABLED, "uint8",
                         ich9_pm_get_disable_s3,
                         ich9_pm_set_disable_s3,
-                        NULL, pm, NULL);
+                        NULL, pm, IGNORE_ERRORS);
     object_property_add(obj, ACPI_PM_PROP_S4_DISABLED, "uint8",
                         ich9_pm_get_disable_s4,
                         ich9_pm_set_disable_s4,
-                        NULL, pm, NULL);
+                        NULL, pm, IGNORE_ERRORS);
     object_property_add(obj, ACPI_PM_PROP_S4_VAL, "uint8",
                         ich9_pm_get_s4_val,
                         ich9_pm_set_s4_val,
-                        NULL, pm, NULL);
+                        NULL, pm, IGNORE_ERRORS);
     object_property_add_bool(obj, ACPI_PM_PROP_TCO_ENABLED,
                              ich9_pm_get_enable_tco,
                              ich9_pm_set_enable_tco,
-                             NULL);
+                             IGNORE_ERRORS);
 }
 
 void ich9_pm_device_plug_cb(HotplugHandler *hotplug_dev, DeviceState *dev,
diff --git a/hw/acpi/memory_hotplug.c b/hw/acpi/memory_hotplug.c
index f28c6766e5..f4b6a096c0 100644
--- a/hw/acpi/memory_hotplug.c
+++ b/hw/acpi/memory_hotplug.c
@@ -84,23 +84,23 @@ static uint64_t acpi_memory_hotplug_read(void *opaque, hwaddr addr,
     o = OBJECT(mdev->dimm);
     switch (addr) {
     case 0x0: /* Lo part of phys address where DIMM is mapped */
-        val = o ? object_property_get_int(o, PC_DIMM_ADDR_PROP, NULL) : 0;
+        val = o ? object_property_get_int(o, PC_DIMM_ADDR_PROP, IGNORE_ERRORS) : 0;
         trace_mhp_acpi_read_addr_lo(mem_st->selector, val);
         break;
     case 0x4: /* Hi part of phys address where DIMM is mapped */
-        val = o ? object_property_get_int(o, PC_DIMM_ADDR_PROP, NULL) >> 32 : 0;
+        val = o ? object_property_get_int(o, PC_DIMM_ADDR_PROP, IGNORE_ERRORS) >> 32 : 0;
         trace_mhp_acpi_read_addr_hi(mem_st->selector, val);
         break;
     case 0x8: /* Lo part of DIMM size */
-        val = o ? object_property_get_int(o, PC_DIMM_SIZE_PROP, NULL) : 0;
+        val = o ? object_property_get_int(o, PC_DIMM_SIZE_PROP, IGNORE_ERRORS) : 0;
         trace_mhp_acpi_read_size_lo(mem_st->selector, val);
         break;
     case 0xc: /* Hi part of DIMM size */
-        val = o ? object_property_get_int(o, PC_DIMM_SIZE_PROP, NULL) >> 32 : 0;
+        val = o ? object_property_get_int(o, PC_DIMM_SIZE_PROP, IGNORE_ERRORS) >> 32 : 0;
         trace_mhp_acpi_read_size_hi(mem_st->selector, val);
         break;
     case 0x10: /* node proximity for _PXM method */
-        val = o ? object_property_get_int(o, PC_DIMM_NODE_PROP, NULL) : 0;
+        val = o ? object_property_get_int(o, PC_DIMM_NODE_PROP, IGNORE_ERRORS) : 0;
         trace_mhp_acpi_read_pxm(mem_st->selector, val);
         break;
     case 0x14: /* pack and return is_* fields */
diff --git a/hw/acpi/nvdimm.c b/hw/acpi/nvdimm.c
index c691a1de5b..a8c3a9e7f0 100644
--- a/hw/acpi/nvdimm.c
+++ b/hw/acpi/nvdimm.c
@@ -220,7 +220,7 @@ static NVDIMMDevice *nvdimm_get_device_by_handle(uint32_t handle)
     for (list = device_list; list; list = list->next) {
         NVDIMMDevice *nvd = list->data;
         int slot = object_property_get_int(OBJECT(nvd), PC_DIMM_SLOT_PROP,
-                                           NULL);
+                                           IGNORE_ERRORS);
 
         if (nvdimm_slot_to_handle(slot) == handle) {
             nvdimm = nvd;
@@ -238,13 +238,13 @@ nvdimm_build_structure_spa(GArray *structures, DeviceState *dev)
 {
     NvdimmNfitSpa *nfit_spa;
     uint64_t addr = object_property_get_int(OBJECT(dev), PC_DIMM_ADDR_PROP,
-                                            NULL);
+                                            IGNORE_ERRORS);
     uint64_t size = object_property_get_int(OBJECT(dev), PC_DIMM_SIZE_PROP,
-                                            NULL);
+                                            IGNORE_ERRORS);
     uint32_t node = object_property_get_int(OBJECT(dev), PC_DIMM_NODE_PROP,
-                                            NULL);
+                                            IGNORE_ERRORS);
     int slot = object_property_get_int(OBJECT(dev), PC_DIMM_SLOT_PROP,
-                                            NULL);
+                                            IGNORE_ERRORS);
 
     nfit_spa = acpi_data_push(structures, sizeof(*nfit_spa));
 
@@ -286,9 +286,9 @@ nvdimm_build_structure_memdev(GArray *structures, DeviceState *dev)
 {
     NvdimmNfitMemDev *nfit_memdev;
     uint64_t size = object_property_get_int(OBJECT(dev), PC_DIMM_SIZE_PROP,
-                                            NULL);
+                                            IGNORE_ERRORS);
     int slot = object_property_get_int(OBJECT(dev), PC_DIMM_SLOT_PROP,
-                                            NULL);
+                                            IGNORE_ERRORS);
     uint32_t handle = nvdimm_slot_to_handle(slot);
 
     nfit_memdev = acpi_data_push(structures, sizeof(*nfit_memdev));
@@ -322,7 +322,7 @@ static void nvdimm_build_structure_dcr(GArray *structures, DeviceState *dev)
 {
     NvdimmNfitControlRegion *nfit_dcr;
     int slot = object_property_get_int(OBJECT(dev), PC_DIMM_SLOT_PROP,
-                                       NULL);
+                                       IGNORE_ERRORS);
     uint32_t sn = nvdimm_slot_to_sn(slot);
 
     nfit_dcr = acpi_data_push(structures, sizeof(*nfit_dcr));
diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c
index f276967365..f3c5f03d35 100644
--- a/hw/acpi/piix4.c
+++ b/hw/acpi/piix4.c
@@ -480,17 +480,17 @@ static void piix4_pm_add_propeties(PIIX4PMState *s)
     static const uint16_t sci_int = 9;
 
     object_property_add_uint8_ptr(OBJECT(s), ACPI_PM_PROP_ACPI_ENABLE_CMD,
-                                  &acpi_enable_cmd, NULL);
+                                  &acpi_enable_cmd, IGNORE_ERRORS);
     object_property_add_uint8_ptr(OBJECT(s), ACPI_PM_PROP_ACPI_DISABLE_CMD,
-                                  &acpi_disable_cmd, NULL);
+                                  &acpi_disable_cmd, IGNORE_ERRORS);
     object_property_add_uint32_ptr(OBJECT(s), ACPI_PM_PROP_GPE0_BLK,
-                                  &gpe0_blk, NULL);
+                                  &gpe0_blk, IGNORE_ERRORS);
     object_property_add_uint32_ptr(OBJECT(s), ACPI_PM_PROP_GPE0_BLK_LEN,
-                                  &gpe0_blk_len, NULL);
+                                  &gpe0_blk_len, IGNORE_ERRORS);
     object_property_add_uint16_ptr(OBJECT(s), ACPI_PM_PROP_SCI_INT,
-                                  &sci_int, NULL);
+                                  &sci_int, IGNORE_ERRORS);
     object_property_add_uint32_ptr(OBJECT(s), ACPI_PM_PROP_PM_IO_BASE,
-                                  &s->io_base, NULL);
+                                  &s->io_base, IGNORE_ERRORS);
 }
 
 static void piix4_pm_realize(PCIDevice *dev, Error **errp)
@@ -646,7 +646,7 @@ static void piix4_acpi_system_hot_add_init(MemoryRegion *parent,
     object_property_add_bool(OBJECT(s), "cpu-hotplug-legacy",
                              piix4_get_cpu_hotplug_legacy,
                              piix4_set_cpu_hotplug_legacy,
-                             NULL);
+                             IGNORE_ERRORS);
     legacy_acpi_cpu_hotplug_init(parent, OBJECT(s), &s->gpe_cpu,
                                  PIIX4_CPU_HOTPLUG_IO_BASE);
 
diff --git a/hw/acpi/vmgenid.c b/hw/acpi/vmgenid.c
index 780637028e..5bc495960c 100644
--- a/hw/acpi/vmgenid.c
+++ b/hw/acpi/vmgenid.c
@@ -243,11 +243,11 @@ static void vmgenid_device_class_init(ObjectClass *klass, void *data)
     dc->props = vmgenid_properties;
 
     object_class_property_add_str(klass, VMGENID_GUID, NULL,
-                                  vmgenid_set_guid, NULL);
+                                  vmgenid_set_guid, IGNORE_ERRORS);
     object_class_property_set_description(klass, VMGENID_GUID,
                                     "Set Global Unique Identifier "
                                     "(big-endian) or auto for random value",
-                                    NULL);
+                                    IGNORE_ERRORS);
 }
 
 static const TypeInfo vmgenid_device_info = {
diff --git a/hw/arm/allwinner-a10.c b/hw/arm/allwinner-a10.c
index f62a9a3541..651409094c 100644
--- a/hw/arm/allwinner-a10.c
+++ b/hw/arm/allwinner-a10.c
@@ -28,7 +28,7 @@ static void aw_a10_init(Object *obj)
     AwA10State *s = AW_A10(obj);
 
     object_initialize(&s->cpu, sizeof(s->cpu), "cortex-a8-" TYPE_ARM_CPU);
-    object_property_add_child(obj, "cpu", OBJECT(&s->cpu), NULL);
+    object_property_add_child(obj, "cpu", OBJECT(&s->cpu), IGNORE_ERRORS);
 
     object_initialize(&s->intc, sizeof(s->intc), TYPE_AW_A10_PIC);
     qdev_set_parent_bus(DEVICE(&s->intc), sysbus_get_default());
diff --git a/hw/arm/aspeed_soc.c b/hw/arm/aspeed_soc.c
index 4937e2bc83..d546b6af91 100644
--- a/hw/arm/aspeed_soc.c
+++ b/hw/arm/aspeed_soc.c
@@ -129,23 +129,24 @@ static void aspeed_soc_init(Object *obj)
 
     cpu_typename = g_strdup_printf("%s-" TYPE_ARM_CPU, sc->info->cpu_model);
     object_initialize(&s->cpu, sizeof(s->cpu), cpu_typename);
-    object_property_add_child(obj, "cpu", OBJECT(&s->cpu), NULL);
+    object_property_add_child(obj, "cpu", OBJECT(&s->cpu), IGNORE_ERRORS);
     g_free(cpu_typename);
 
     object_initialize(&s->vic, sizeof(s->vic), TYPE_ASPEED_VIC);
-    object_property_add_child(obj, "vic", OBJECT(&s->vic), NULL);
+    object_property_add_child(obj, "vic", OBJECT(&s->vic), IGNORE_ERRORS);
     qdev_set_parent_bus(DEVICE(&s->vic), sysbus_get_default());
 
     object_initialize(&s->timerctrl, sizeof(s->timerctrl), TYPE_ASPEED_TIMER);
-    object_property_add_child(obj, "timerctrl", OBJECT(&s->timerctrl), NULL);
+    object_property_add_child(obj, "timerctrl", OBJECT(&s->timerctrl),
+                              IGNORE_ERRORS);
     qdev_set_parent_bus(DEVICE(&s->timerctrl), sysbus_get_default());
 
     object_initialize(&s->i2c, sizeof(s->i2c), TYPE_ASPEED_I2C);
-    object_property_add_child(obj, "i2c", OBJECT(&s->i2c), NULL);
+    object_property_add_child(obj, "i2c", OBJECT(&s->i2c), IGNORE_ERRORS);
     qdev_set_parent_bus(DEVICE(&s->i2c), sysbus_get_default());
 
     object_initialize(&s->scu, sizeof(s->scu), TYPE_ASPEED_SCU);
-    object_property_add_child(obj, "scu", OBJECT(&s->scu), NULL);
+    object_property_add_child(obj, "scu", OBJECT(&s->scu), IGNORE_ERRORS);
     qdev_set_parent_bus(DEVICE(&s->scu), sysbus_get_default());
     qdev_prop_set_uint32(DEVICE(&s->scu), "silicon-rev",
                          sc->info->silicon_rev);
@@ -155,7 +156,7 @@ static void aspeed_soc_init(Object *obj)
                               "hw-strap2", &error_abort);
 
     object_initialize(&s->fmc, sizeof(s->fmc), sc->info->fmc_typename);
-    object_property_add_child(obj, "fmc", OBJECT(&s->fmc), NULL);
+    object_property_add_child(obj, "fmc", OBJECT(&s->fmc), IGNORE_ERRORS);
     qdev_set_parent_bus(DEVICE(&s->fmc), sysbus_get_default());
     object_property_add_alias(obj, "num-cs", OBJECT(&s->fmc), "num-cs",
                               &error_abort);
@@ -163,12 +164,13 @@ static void aspeed_soc_init(Object *obj)
     for (i = 0; i < sc->info->spis_num; i++) {
         object_initialize(&s->spi[i], sizeof(s->spi[i]),
                           sc->info->spi_typename[i]);
-        object_property_add_child(obj, "spi[*]", OBJECT(&s->spi[i]), NULL);
+        object_property_add_child(obj, "spi[*]", OBJECT(&s->spi[i]),
+                                  IGNORE_ERRORS);
         qdev_set_parent_bus(DEVICE(&s->spi[i]), sysbus_get_default());
     }
 
     object_initialize(&s->sdmc, sizeof(s->sdmc), TYPE_ASPEED_SDMC);
-    object_property_add_child(obj, "sdmc", OBJECT(&s->sdmc), NULL);
+    object_property_add_child(obj, "sdmc", OBJECT(&s->sdmc), IGNORE_ERRORS);
     qdev_set_parent_bus(DEVICE(&s->sdmc), sysbus_get_default());
     qdev_prop_set_uint32(DEVICE(&s->sdmc), "silicon-rev",
                          sc->info->silicon_rev);
@@ -176,11 +178,12 @@ static void aspeed_soc_init(Object *obj)
                               "ram-size", &error_abort);
 
     object_initialize(&s->wdt, sizeof(s->wdt), TYPE_ASPEED_WDT);
-    object_property_add_child(obj, "wdt", OBJECT(&s->wdt), NULL);
+    object_property_add_child(obj, "wdt", OBJECT(&s->wdt), IGNORE_ERRORS);
     qdev_set_parent_bus(DEVICE(&s->wdt), sysbus_get_default());
 
     object_initialize(&s->ftgmac100, sizeof(s->ftgmac100), TYPE_FTGMAC100);
-    object_property_add_child(obj, "ftgmac100", OBJECT(&s->ftgmac100), NULL);
+    object_property_add_child(obj, "ftgmac100", OBJECT(&s->ftgmac100),
+                              IGNORE_ERRORS);
     qdev_set_parent_bus(DEVICE(&s->ftgmac100), sysbus_get_default());
 }
 
diff --git a/hw/arm/bcm2835_peripherals.c b/hw/arm/bcm2835_peripherals.c
index 502f04c02a..447870b5a7 100644
--- a/hw/arm/bcm2835_peripherals.c
+++ b/hw/arm/bcm2835_peripherals.c
@@ -27,12 +27,14 @@ static void bcm2835_peripherals_init(Object *obj)
 
     /* Memory region for peripheral devices, which we export to our parent */
     memory_region_init(&s->peri_mr, obj,"bcm2835-peripherals", 0x1000000);
-    object_property_add_child(obj, "peripheral-io", OBJECT(&s->peri_mr), NULL);
+    object_property_add_child(obj, "peripheral-io", OBJECT(&s->peri_mr),
+                              IGNORE_ERRORS);
     sysbus_init_mmio(SYS_BUS_DEVICE(s), &s->peri_mr);
 
     /* Internal memory region for peripheral bus addresses (not exported) */
     memory_region_init(&s->gpu_bus_mr, obj, "bcm2835-gpu", (uint64_t)1 << 32);
-    object_property_add_child(obj, "gpu-bus", OBJECT(&s->gpu_bus_mr), NULL);
+    object_property_add_child(obj, "gpu-bus", OBJECT(&s->gpu_bus_mr),
+                              IGNORE_ERRORS);
 
     /* Internal memory region for request/response communication with
      * mailbox-addressable peripherals (not exported)
@@ -42,22 +44,22 @@ static void bcm2835_peripherals_init(Object *obj)
 
     /* Interrupt Controller */
     object_initialize(&s->ic, sizeof(s->ic), TYPE_BCM2835_IC);
-    object_property_add_child(obj, "ic", OBJECT(&s->ic), NULL);
+    object_property_add_child(obj, "ic", OBJECT(&s->ic), IGNORE_ERRORS);
     qdev_set_parent_bus(DEVICE(&s->ic), sysbus_get_default());
 
     /* UART0 */
     s->uart0 = SYS_BUS_DEVICE(object_new("pl011"));
-    object_property_add_child(obj, "uart0", OBJECT(s->uart0), NULL);
+    object_property_add_child(obj, "uart0", OBJECT(s->uart0), IGNORE_ERRORS);
     qdev_set_parent_bus(DEVICE(s->uart0), sysbus_get_default());
 
     /* AUX / UART1 */
     object_initialize(&s->aux, sizeof(s->aux), TYPE_BCM2835_AUX);
-    object_property_add_child(obj, "aux", OBJECT(&s->aux), NULL);
+    object_property_add_child(obj, "aux", OBJECT(&s->aux), IGNORE_ERRORS);
     qdev_set_parent_bus(DEVICE(&s->aux), sysbus_get_default());
 
     /* Mailboxes */
     object_initialize(&s->mboxes, sizeof(s->mboxes), TYPE_BCM2835_MBOX);
-    object_property_add_child(obj, "mbox", OBJECT(&s->mboxes), NULL);
+    object_property_add_child(obj, "mbox", OBJECT(&s->mboxes), IGNORE_ERRORS);
     qdev_set_parent_bus(DEVICE(&s->mboxes), sysbus_get_default());
 
     object_property_add_const_link(OBJECT(&s->mboxes), "mbox-mr",
@@ -65,7 +67,7 @@ static void bcm2835_peripherals_init(Object *obj)
 
     /* Framebuffer */
     object_initialize(&s->fb, sizeof(s->fb), TYPE_BCM2835_FB);
-    object_property_add_child(obj, "fb", OBJECT(&s->fb), NULL);
+    object_property_add_child(obj, "fb", OBJECT(&s->fb), IGNORE_ERRORS);
     object_property_add_alias(obj, "vcram-size", OBJECT(&s->fb), "vcram-size",
                               &error_abort);
     qdev_set_parent_bus(DEVICE(&s->fb), sysbus_get_default());
@@ -75,7 +77,8 @@ static void bcm2835_peripherals_init(Object *obj)
 
     /* Property channel */
     object_initialize(&s->property, sizeof(s->property), TYPE_BCM2835_PROPERTY);
-    object_property_add_child(obj, "property", OBJECT(&s->property), NULL);
+    object_property_add_child(obj, "property", OBJECT(&s->property),
+                              IGNORE_ERRORS);
     object_property_add_alias(obj, "board-rev", OBJECT(&s->property),
                               "board-rev", &error_abort);
     qdev_set_parent_bus(DEVICE(&s->property), sysbus_get_default());
@@ -87,22 +90,23 @@ static void bcm2835_peripherals_init(Object *obj)
 
     /* Random Number Generator */
     object_initialize(&s->rng, sizeof(s->rng), TYPE_BCM2835_RNG);
-    object_property_add_child(obj, "rng", OBJECT(&s->rng), NULL);
+    object_property_add_child(obj, "rng", OBJECT(&s->rng), IGNORE_ERRORS);
     qdev_set_parent_bus(DEVICE(&s->rng), sysbus_get_default());
 
     /* Extended Mass Media Controller */
     object_initialize(&s->sdhci, sizeof(s->sdhci), TYPE_SYSBUS_SDHCI);
-    object_property_add_child(obj, "sdhci", OBJECT(&s->sdhci), NULL);
+    object_property_add_child(obj, "sdhci", OBJECT(&s->sdhci), IGNORE_ERRORS);
     qdev_set_parent_bus(DEVICE(&s->sdhci), sysbus_get_default());
 
     /* SDHOST */
     object_initialize(&s->sdhost, sizeof(s->sdhost), TYPE_BCM2835_SDHOST);
-    object_property_add_child(obj, "sdhost", OBJECT(&s->sdhost), NULL);
+    object_property_add_child(obj, "sdhost", OBJECT(&s->sdhost),
+                              IGNORE_ERRORS);
     qdev_set_parent_bus(DEVICE(&s->sdhost), sysbus_get_default());
 
     /* DMA Channels */
     object_initialize(&s->dma, sizeof(s->dma), TYPE_BCM2835_DMA);
-    object_property_add_child(obj, "dma", OBJECT(&s->dma), NULL);
+    object_property_add_child(obj, "dma", OBJECT(&s->dma), IGNORE_ERRORS);
     qdev_set_parent_bus(DEVICE(&s->dma), sysbus_get_default());
 
     object_property_add_const_link(OBJECT(&s->dma), "dma-mr",
@@ -110,7 +114,7 @@ static void bcm2835_peripherals_init(Object *obj)
 
     /* GPIO */
     object_initialize(&s->gpio, sizeof(s->gpio), TYPE_BCM2835_GPIO);
-    object_property_add_child(obj, "gpio", OBJECT(&s->gpio), NULL);
+    object_property_add_child(obj, "gpio", OBJECT(&s->gpio), IGNORE_ERRORS);
     qdev_set_parent_bus(DEVICE(&s->gpio), sysbus_get_default());
 
     object_property_add_const_link(OBJECT(&s->gpio), "sdbus-sdhci",
diff --git a/hw/arm/bcm2836.c b/hw/arm/bcm2836.c
index 8c43291112..2c6a082395 100644
--- a/hw/arm/bcm2836.c
+++ b/hw/arm/bcm2836.c
@@ -36,7 +36,8 @@ static void bcm2836_init(Object *obj)
     }
 
     object_initialize(&s->control, sizeof(s->control), TYPE_BCM2836_CONTROL);
-    object_property_add_child(obj, "control", OBJECT(&s->control), NULL);
+    object_property_add_child(obj, "control", OBJECT(&s->control),
+                              IGNORE_ERRORS);
     qdev_set_parent_bus(DEVICE(&s->control), sysbus_get_default());
 
     object_initialize(&s->peripherals, sizeof(s->peripherals),
diff --git a/hw/arm/digic.c b/hw/arm/digic.c
index 94f32637f0..f22fae73c3 100644
--- a/hw/arm/digic.c
+++ b/hw/arm/digic.c
@@ -36,7 +36,7 @@ static void digic_init(Object *obj)
     int i;
 
     object_initialize(&s->cpu, sizeof(s->cpu), "arm946-" TYPE_ARM_CPU);
-    object_property_add_child(obj, "cpu", OBJECT(&s->cpu), NULL);
+    object_property_add_child(obj, "cpu", OBJECT(&s->cpu), IGNORE_ERRORS);
 
     for (i = 0; i < DIGIC4_NB_TIMERS; i++) {
 #define DIGIC_TIMER_NAME_MLEN    11
@@ -46,13 +46,14 @@ static void digic_init(Object *obj)
         dev = DEVICE(&s->timer[i]);
         qdev_set_parent_bus(dev, sysbus_get_default());
         snprintf(name, DIGIC_TIMER_NAME_MLEN, "timer[%d]", i);
-        object_property_add_child(obj, name, OBJECT(&s->timer[i]), NULL);
+        object_property_add_child(obj, name, OBJECT(&s->timer[i]),
+                                  IGNORE_ERRORS);
     }
 
     object_initialize(&s->uart, sizeof(s->uart), TYPE_DIGIC_UART);
     dev = DEVICE(&s->uart);
     qdev_set_parent_bus(dev, sysbus_get_default());
-    object_property_add_child(obj, "uart", OBJECT(&s->uart), NULL);
+    object_property_add_child(obj, "uart", OBJECT(&s->uart), IGNORE_ERRORS);
 }
 
 static void digic_realize(DeviceState *dev, Error **errp)
diff --git a/hw/arm/exynos4210.c b/hw/arm/exynos4210.c
index 960f27e45a..4a712a58b0 100644
--- a/hw/arm/exynos4210.c
+++ b/hw/arm/exynos4210.c
@@ -180,7 +180,7 @@ Exynos4210State *exynos4210_init(MemoryRegion *system_mem,
         /* By default A9 CPUs have EL3 enabled.  This board does not currently
          * support EL3 so the CPU EL3 property is disabled before realization.
          */
-        if (object_property_find(cpuobj, "has_el3", NULL)) {
+        if (object_property_find(cpuobj, "has_el3", IGNORE_ERRORS)) {
             object_property_set_bool(cpuobj, false, "has_el3", &error_fatal);
         }
 
diff --git a/hw/arm/fsl-imx6.c b/hw/arm/fsl-imx6.c
index 27773c9c47..73610d48a5 100644
--- a/hw/arm/fsl-imx6.c
+++ b/hw/arm/fsl-imx6.c
@@ -45,70 +45,78 @@ static void fsl_imx6_init(Object *obj)
         object_initialize(&s->cpu[i], sizeof(s->cpu[i]),
                           "cortex-a9-" TYPE_ARM_CPU);
         snprintf(name, NAME_SIZE, "cpu%d", i);
-        object_property_add_child(obj, name, OBJECT(&s->cpu[i]), NULL);
+        object_property_add_child(obj, name, OBJECT(&s->cpu[i]),
+                                  IGNORE_ERRORS);
     }
 
     object_initialize(&s->a9mpcore, sizeof(s->a9mpcore), TYPE_A9MPCORE_PRIV);
     qdev_set_parent_bus(DEVICE(&s->a9mpcore), sysbus_get_default());
-    object_property_add_child(obj, "a9mpcore", OBJECT(&s->a9mpcore), NULL);
+    object_property_add_child(obj, "a9mpcore", OBJECT(&s->a9mpcore),
+                              IGNORE_ERRORS);
 
     object_initialize(&s->ccm, sizeof(s->ccm), TYPE_IMX6_CCM);
     qdev_set_parent_bus(DEVICE(&s->ccm), sysbus_get_default());
-    object_property_add_child(obj, "ccm", OBJECT(&s->ccm), NULL);
+    object_property_add_child(obj, "ccm", OBJECT(&s->ccm), IGNORE_ERRORS);
 
     object_initialize(&s->src, sizeof(s->src), TYPE_IMX6_SRC);
     qdev_set_parent_bus(DEVICE(&s->src), sysbus_get_default());
-    object_property_add_child(obj, "src", OBJECT(&s->src), NULL);
+    object_property_add_child(obj, "src", OBJECT(&s->src), IGNORE_ERRORS);
 
     for (i = 0; i < FSL_IMX6_NUM_UARTS; i++) {
         object_initialize(&s->uart[i], sizeof(s->uart[i]), TYPE_IMX_SERIAL);
         qdev_set_parent_bus(DEVICE(&s->uart[i]), sysbus_get_default());
         snprintf(name, NAME_SIZE, "uart%d", i + 1);
-        object_property_add_child(obj, name, OBJECT(&s->uart[i]), NULL);
+        object_property_add_child(obj, name, OBJECT(&s->uart[i]),
+                                  IGNORE_ERRORS);
     }
 
     object_initialize(&s->gpt, sizeof(s->gpt), TYPE_IMX6_GPT);
     qdev_set_parent_bus(DEVICE(&s->gpt), sysbus_get_default());
-    object_property_add_child(obj, "gpt", OBJECT(&s->gpt), NULL);
+    object_property_add_child(obj, "gpt", OBJECT(&s->gpt), IGNORE_ERRORS);
 
     for (i = 0; i < FSL_IMX6_NUM_EPITS; i++) {
         object_initialize(&s->epit[i], sizeof(s->epit[i]), TYPE_IMX_EPIT);
         qdev_set_parent_bus(DEVICE(&s->epit[i]), sysbus_get_default());
         snprintf(name, NAME_SIZE, "epit%d", i + 1);
-        object_property_add_child(obj, name, OBJECT(&s->epit[i]), NULL);
+        object_property_add_child(obj, name, OBJECT(&s->epit[i]),
+                                  IGNORE_ERRORS);
     }
 
     for (i = 0; i < FSL_IMX6_NUM_I2CS; i++) {
         object_initialize(&s->i2c[i], sizeof(s->i2c[i]), TYPE_IMX_I2C);
         qdev_set_parent_bus(DEVICE(&s->i2c[i]), sysbus_get_default());
         snprintf(name, NAME_SIZE, "i2c%d", i + 1);
-        object_property_add_child(obj, name, OBJECT(&s->i2c[i]), NULL);
+        object_property_add_child(obj, name, OBJECT(&s->i2c[i]),
+                                  IGNORE_ERRORS);
     }
 
     for (i = 0; i < FSL_IMX6_NUM_GPIOS; i++) {
         object_initialize(&s->gpio[i], sizeof(s->gpio[i]), TYPE_IMX_GPIO);
         qdev_set_parent_bus(DEVICE(&s->gpio[i]), sysbus_get_default());
         snprintf(name, NAME_SIZE, "gpio%d", i + 1);
-        object_property_add_child(obj, name, OBJECT(&s->gpio[i]), NULL);
+        object_property_add_child(obj, name, OBJECT(&s->gpio[i]),
+                                  IGNORE_ERRORS);
     }
 
     for (i = 0; i < FSL_IMX6_NUM_ESDHCS; i++) {
         object_initialize(&s->esdhc[i], sizeof(s->esdhc[i]), TYPE_SYSBUS_SDHCI);
         qdev_set_parent_bus(DEVICE(&s->esdhc[i]), sysbus_get_default());
         snprintf(name, NAME_SIZE, "sdhc%d", i + 1);
-        object_property_add_child(obj, name, OBJECT(&s->esdhc[i]), NULL);
+        object_property_add_child(obj, name, OBJECT(&s->esdhc[i]),
+                                  IGNORE_ERRORS);
     }
 
     for (i = 0; i < FSL_IMX6_NUM_ECSPIS; i++) {
         object_initialize(&s->spi[i], sizeof(s->spi[i]), TYPE_IMX_SPI);
         qdev_set_parent_bus(DEVICE(&s->spi[i]), sysbus_get_default());
         snprintf(name, NAME_SIZE, "spi%d", i + 1);
-        object_property_add_child(obj, name, OBJECT(&s->spi[i]), NULL);
+        object_property_add_child(obj, name, OBJECT(&s->spi[i]),
+                                  IGNORE_ERRORS);
     }
 
     object_initialize(&s->eth, sizeof(s->eth), TYPE_IMX_ENET);
     qdev_set_parent_bus(DEVICE(&s->eth), sysbus_get_default());
-    object_property_add_child(obj, "eth", OBJECT(&s->eth), NULL);
+    object_property_add_child(obj, "eth", OBJECT(&s->eth), IGNORE_ERRORS);
 }
 
 static void fsl_imx6_realize(DeviceState *dev, Error **errp)
diff --git a/hw/arm/highbank.c b/hw/arm/highbank.c
index d209b97dee..b7016c7c20 100644
--- a/hw/arm/highbank.c
+++ b/hw/arm/highbank.c
@@ -260,7 +260,7 @@ static void calxeda_init(MachineState *machine, enum cxmachines machine_id)
                                      "start-powered-off", &error_abort);
         }
 
-        if (object_property_find(cpuobj, "reset-cbar", NULL)) {
+        if (object_property_find(cpuobj, "reset-cbar", IGNORE_ERRORS)) {
             object_property_set_int(cpuobj, MPCORE_PERIPHBASE,
                                     "reset-cbar", &error_abort);
         }
diff --git a/hw/arm/integratorcp.c b/hw/arm/integratorcp.c
index ca3eca1d16..5af0d7fe5b 100644
--- a/hw/arm/integratorcp.c
+++ b/hw/arm/integratorcp.c
@@ -618,7 +618,7 @@ static void integratorcp_init(MachineState *machine)
      * currently support EL3 so the CPU EL3 property is disabled before
      * realization.
      */
-    if (object_property_find(cpuobj, "has_el3", NULL)) {
+    if (object_property_find(cpuobj, "has_el3", IGNORE_ERRORS)) {
         object_property_set_bool(cpuobj, false, "has_el3", &error_fatal);
     }
 
diff --git a/hw/arm/realview.c b/hw/arm/realview.c
index b7d4753400..d5f307432b 100644
--- a/hw/arm/realview.c
+++ b/hw/arm/realview.c
@@ -109,7 +109,7 @@ static void realview_init(MachineState *machine,
          * does not currently support EL3 so the CPU EL3 property is disabled
          * before realization.
          */
-        if (object_property_find(cpuobj, "has_el3", NULL)) {
+        if (object_property_find(cpuobj, "has_el3", IGNORE_ERRORS)) {
             object_property_set_bool(cpuobj, false, "has_el3", &error_fatal);
         }
 
diff --git a/hw/arm/versatilepb.c b/hw/arm/versatilepb.c
index b0e9f5be65..a7385f9232 100644
--- a/hw/arm/versatilepb.c
+++ b/hw/arm/versatilepb.c
@@ -223,7 +223,7 @@ static void versatile_init(MachineState *machine, int board_id)
      * currently support EL3 so the CPU EL3 property is disabled before
      * realization.
      */
-    if (object_property_find(cpuobj, "has_el3", NULL)) {
+    if (object_property_find(cpuobj, "has_el3", IGNORE_ERRORS)) {
         object_property_set_bool(cpuobj, false, "has_el3", &error_fatal);
     }
 
diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c
index c6b1e674b4..d1e294f969 100644
--- a/hw/arm/vexpress.c
+++ b/hw/arm/vexpress.c
@@ -218,10 +218,10 @@ static void init_cpus(const char *cpu_model, const char *privdev,
         Object *cpuobj = object_new(object_class_get_name(cpu_oc));
 
         if (!secure) {
-            object_property_set_bool(cpuobj, false, "has_el3", NULL);
+            object_property_set_bool(cpuobj, false, "has_el3", IGNORE_ERRORS);
         }
 
-        if (object_property_find(cpuobj, "reset-cbar", NULL)) {
+        if (object_property_find(cpuobj, "reset-cbar", IGNORE_ERRORS)) {
             object_property_set_int(cpuobj, periphbase,
                                     "reset-cbar", &error_abort);
         }
@@ -739,11 +739,11 @@ static void vexpress_instance_init(Object *obj)
     /* EL3 is enabled by default on vexpress */
     vms->secure = true;
     object_property_add_bool(obj, "secure", vexpress_get_secure,
-                             vexpress_set_secure, NULL);
+                             vexpress_set_secure, IGNORE_ERRORS);
     object_property_set_description(obj, "secure",
                                     "Set on/off to enable/disable the ARM "
                                     "Security Extensions (TrustZone)",
-                                    NULL);
+                                    IGNORE_ERRORS);
 }
 
 static void vexpress_class_init(ObjectClass *oc, void *data)
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 010f7244bf..4c187bba59 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -1379,7 +1379,7 @@ static void machvirt_init(MachineState *machine)
 
         cpuobj = object_new(typename);
         object_property_set_int(cpuobj, possible_cpus->cpus[n].arch_id,
-                                "mp-affinity", NULL);
+                                "mp-affinity", IGNORE_ERRORS);
 
         cs = CPU(cpuobj);
         cs->cpu_index = n;
@@ -1388,29 +1388,29 @@ static void machvirt_init(MachineState *machine)
                           &error_fatal);
 
         if (!vms->secure) {
-            object_property_set_bool(cpuobj, false, "has_el3", NULL);
+            object_property_set_bool(cpuobj, false, "has_el3", IGNORE_ERRORS);
         }
 
-        if (!vms->virt && object_property_find(cpuobj, "has_el2", NULL)) {
-            object_property_set_bool(cpuobj, false, "has_el2", NULL);
+        if (!vms->virt && object_property_find(cpuobj, "has_el2", IGNORE_ERRORS)) {
+            object_property_set_bool(cpuobj, false, "has_el2", IGNORE_ERRORS);
         }
 
         if (vms->psci_conduit != QEMU_PSCI_CONDUIT_DISABLED) {
             object_property_set_int(cpuobj, vms->psci_conduit,
-                                    "psci-conduit", NULL);
+                                    "psci-conduit", IGNORE_ERRORS);
 
             /* Secondary CPUs start in PSCI powered-down state */
             if (n > 0) {
                 object_property_set_bool(cpuobj, true,
-                                         "start-powered-off", NULL);
+                                         "start-powered-off", IGNORE_ERRORS);
             }
         }
 
-        if (vmc->no_pmu && object_property_find(cpuobj, "pmu", NULL)) {
-            object_property_set_bool(cpuobj, false, "pmu", NULL);
+        if (vmc->no_pmu && object_property_find(cpuobj, "pmu", IGNORE_ERRORS)) {
+            object_property_set_bool(cpuobj, false, "pmu", IGNORE_ERRORS);
         }
 
-        if (object_property_find(cpuobj, "reset-cbar", NULL)) {
+        if (object_property_find(cpuobj, "reset-cbar", IGNORE_ERRORS)) {
             object_property_set_int(cpuobj, vms->memmap[VIRT_CPUPERIPHS].base,
                                     "reset-cbar", &error_abort);
         }
@@ -1422,7 +1422,7 @@ static void machvirt_init(MachineState *machine)
                                      "secure-memory", &error_abort);
         }
 
-        object_property_set_bool(cpuobj, true, "realized", NULL);
+        object_property_set_bool(cpuobj, true, "realized", IGNORE_ERRORS);
         object_unref(cpuobj);
     }
     fdt_add_timer_nodes(vms);
@@ -1650,37 +1650,38 @@ static void virt_2_9_instance_init(Object *obj)
      */
     vms->secure = false;
     object_property_add_bool(obj, "secure", virt_get_secure,
-                             virt_set_secure, NULL);
+                             virt_set_secure, IGNORE_ERRORS);
     object_property_set_description(obj, "secure",
                                     "Set on/off to enable/disable the ARM "
                                     "Security Extensions (TrustZone)",
-                                    NULL);
+                                    IGNORE_ERRORS);
 
     /* EL2 is also disabled by default, for similar reasons */
     vms->virt = false;
     object_property_add_bool(obj, "virtualization", virt_get_virt,
-                             virt_set_virt, NULL);
+                             virt_set_virt, IGNORE_ERRORS);
     object_property_set_description(obj, "virtualization",
                                     "Set on/off to enable/disable emulating a "
                                     "guest CPU which implements the ARM "
                                     "Virtualization Extensions",
-                                    NULL);
+                                    IGNORE_ERRORS);
 
     /* High memory is enabled by default */
     vms->highmem = true;
     object_property_add_bool(obj, "highmem", virt_get_highmem,
-                             virt_set_highmem, NULL);
+                             virt_set_highmem, IGNORE_ERRORS);
     object_property_set_description(obj, "highmem",
                                     "Set on/off to enable/disable using "
                                     "physical address space above 32 bits",
-                                    NULL);
+                                    IGNORE_ERRORS);
     /* Default GIC type is v2 */
     vms->gic_version = 2;
     object_property_add_str(obj, "gic-version", virt_get_gic_version,
-                        virt_set_gic_version, NULL);
+                        virt_set_gic_version, IGNORE_ERRORS);
     object_property_set_description(obj, "gic-version",
                                     "Set GIC version. "
-                                    "Valid values are 2, 3 and host", NULL);
+                                    "Valid values are 2, 3 and host",
+                                    IGNORE_ERRORS);
 
     if (vmc->no_its) {
         vms->its = false;
@@ -1688,11 +1689,11 @@ static void virt_2_9_instance_init(Object *obj)
         /* Default allows ITS instantiation */
         vms->its = true;
         object_property_add_bool(obj, "its", virt_get_its,
-                                 virt_set_its, NULL);
+                                 virt_set_its, IGNORE_ERRORS);
         object_property_set_description(obj, "its",
                                         "Set on/off to enable/disable "
                                         "ITS instantiation",
-                                        NULL);
+                                        IGNORE_ERRORS);
     }
 
     vms->memmap = a15memmap;
diff --git a/hw/arm/xilinx_zynq.c b/hw/arm/xilinx_zynq.c
index 3985356fc2..623043239d 100644
--- a/hw/arm/xilinx_zynq.c
+++ b/hw/arm/xilinx_zynq.c
@@ -183,7 +183,7 @@ static void zynq_init(MachineState *machine)
      * currently support EL3 so the CPU EL3 property is disabled before
      * realization.
      */
-    if (object_property_find(OBJECT(cpu), "has_el3", NULL)) {
+    if (object_property_find(OBJECT(cpu), "has_el3", IGNORE_ERRORS)) {
         object_property_set_bool(OBJECT(cpu), false, "has_el3", &error_fatal);
     }
 
diff --git a/hw/arm/xlnx-zynqmp.c b/hw/arm/xlnx-zynqmp.c
index 64f52f80a5..38f9577284 100644
--- a/hw/arm/xlnx-zynqmp.c
+++ b/hw/arm/xlnx-zynqmp.c
@@ -259,9 +259,9 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp)
         g_free(name);
 
         object_property_set_bool(OBJECT(&s->apu_cpu[i]),
-                                 s->secure, "has_el3", NULL);
+                                 s->secure, "has_el3", IGNORE_ERRORS);
         object_property_set_bool(OBJECT(&s->apu_cpu[i]),
-                                 false, "has_el2", NULL);
+                                 false, "has_el2", IGNORE_ERRORS);
         object_property_set_int(OBJECT(&s->apu_cpu[i]), GIC_BASE_ADDR,
                                 "reset-cbar", &error_abort);
         object_property_set_bool(OBJECT(&s->apu_cpu[i]), true, "realized",
diff --git a/hw/block/fdc.c b/hw/block/fdc.c
index 2e629b398b..5fed23c774 100644
--- a/hw/block/fdc.c
+++ b/hw/block/fdc.c
@@ -2835,10 +2835,10 @@ static void isabus_fdc_instance_init(Object *obj)
 
     device_add_bootindex_property(obj, &isa->bootindexA,
                                   "bootindexA", "/floppy@0",
-                                  DEVICE(obj), NULL);
+                                  DEVICE(obj), IGNORE_ERRORS);
     device_add_bootindex_property(obj, &isa->bootindexB,
                                   "bootindexB", "/floppy@1",
-                                  DEVICE(obj), NULL);
+                                  DEVICE(obj), IGNORE_ERRORS);
 }
 
 static const TypeInfo isa_fdc_info = {
diff --git a/hw/block/nvme.c b/hw/block/nvme.c
index 381dc7c5fb..656b0f8c48 100644
--- a/hw/block/nvme.c
+++ b/hw/block/nvme.c
@@ -943,7 +943,7 @@ static int nvme_init(PCIDevice *pci_dev)
     pci_register_bar(&n->parent_obj, 0,
         PCI_BASE_ADDRESS_SPACE_MEMORY | PCI_BASE_ADDRESS_MEM_TYPE_64,
         &n->iomem);
-    msix_init_exclusive_bar(&n->parent_obj, n->num_queues, 4, NULL);
+    msix_init_exclusive_bar(&n->parent_obj, n->num_queues, 4, IGNORE_ERRORS);
 
     id->vid = cpu_to_le16(pci_get_word(pci_conf + PCI_VENDOR_ID));
     id->ssvid = cpu_to_le16(pci_get_word(pci_conf + PCI_SUBSYSTEM_VENDOR_ID));
diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
index 604d37dfc8..ce9cf63c3e 100644
--- a/hw/block/virtio-blk.c
+++ b/hw/block/virtio-blk.c
@@ -984,10 +984,10 @@ static void virtio_blk_instance_init(Object *obj)
     object_property_add_link(obj, "iothread", TYPE_IOTHREAD,
                              (Object **)&s->conf.iothread,
                              qdev_prop_allow_set_link_before_realize,
-                             OBJ_PROP_LINK_UNREF_ON_RELEASE, NULL);
+                             OBJ_PROP_LINK_UNREF_ON_RELEASE, IGNORE_ERRORS);
     device_add_bootindex_property(obj, &s->conf.conf.bootindex,
                                   "bootindex", "/disk@0,0",
-                                  DEVICE(obj), NULL);
+                                  DEVICE(obj), IGNORE_ERRORS);
 }
 
 static const VMStateDescription vmstate_virtio_blk = {
diff --git a/hw/core/bus.c b/hw/core/bus.c
index 4651f24486..ab1925bee9 100644
--- a/hw/core/bus.c
+++ b/hw/core/bus.c
@@ -101,7 +101,8 @@ static void qbus_realize(BusState *bus, DeviceState *parent, const char *name)
     if (bus->parent) {
         QLIST_INSERT_HEAD(&bus->parent->child_bus, bus, sibling);
         bus->parent->num_child_bus++;
-        object_property_add_child(OBJECT(bus->parent), bus->name, OBJECT(bus), NULL);
+        object_property_add_child(OBJECT(bus->parent), bus->name, OBJECT(bus),
+                                  IGNORE_ERRORS);
         object_unref(OBJECT(bus));
     } else if (bus != sysbus_get_default()) {
         /* TODO: once all bus devices are qdevified,
@@ -198,9 +199,10 @@ static void qbus_initfn(Object *obj)
                              (Object **)&bus->hotplug_handler,
                              object_property_allow_set_link,
                              0,
-                             NULL);
+                             IGNORE_ERRORS);
     object_property_add_bool(obj, "realized",
-                             bus_get_realized, bus_set_realized, NULL);
+                             bus_get_realized, bus_set_realized,
+                             IGNORE_ERRORS);
 }
 
 static char *default_bus_get_fw_dev_path(DeviceState *dev)
diff --git a/hw/core/platform-bus.c b/hw/core/platform-bus.c
index e3d69b61f3..d3286e6570 100644
--- a/hw/core/platform-bus.c
+++ b/hw/core/platform-bus.c
@@ -64,7 +64,8 @@ hwaddr platform_bus_get_mmio_addr(PlatformBusDevice *pbus, SysBusDevice *sbdev,
         return -1;
     }
 
-    parent_mr = object_property_get_link(OBJECT(sbdev_mr), "container", NULL);
+    parent_mr = object_property_get_link(OBJECT(sbdev_mr), "container",
+                                         IGNORE_ERRORS);
 
     assert(parent_mr);
     if (parent_mr != pbus_mr_obj) {
@@ -72,7 +73,7 @@ hwaddr platform_bus_get_mmio_addr(PlatformBusDevice *pbus, SysBusDevice *sbdev,
         return -1;
     }
 
-    return object_property_get_int(OBJECT(sbdev_mr), "addr", NULL);
+    return object_property_get_int(OBJECT(sbdev_mr), "addr", IGNORE_ERRORS);
 }
 
 static void platform_bus_count_irqs(SysBusDevice *sbdev, void *opaque)
diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-system.c
index 3bef41914d..73640ee3c6 100644
--- a/hw/core/qdev-properties-system.c
+++ b/hw/core/qdev-properties-system.c
@@ -77,7 +77,7 @@ static void parse_drive(DeviceState *dev, const char *str, void **ptr,
 
     blk = blk_by_name(str);
     if (!blk) {
-        BlockDriverState *bs = bdrv_lookup_bs(NULL, str, NULL);
+        BlockDriverState *bs = bdrv_lookup_bs(NULL, str, IGNORE_ERRORS);
         if (bs) {
             blk = blk_new(0, BLK_PERM_ALL);
             blk_created = true;
@@ -442,7 +442,7 @@ void qdev_set_nic_properties(DeviceState *dev, NICInfo *nd)
         qdev_prop_set_netdev(dev, "netdev", nd->netdev);
     }
     if (nd->nvectors != DEV_NVECTORS_UNSPECIFIED &&
-        object_property_find(OBJECT(dev), "vectors", NULL)) {
+        object_property_find(OBJECT(dev), "vectors", IGNORE_ERRORS)) {
         qdev_prop_set_uint32(dev, "vectors", nd->nvectors);
     }
     nd->instantiated = 1;
diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index 0ce45a2019..faa4af0dc3 100644
--- a/hw/core/qdev.c
+++ b/hw/core/qdev.c
@@ -71,7 +71,7 @@ static void bus_remove_child(BusState *bus, DeviceState *child)
             QTAILQ_REMOVE(&bus->children, kid, sibling);
 
             /* This gives back ownership of kid->child back to us.  */
-            object_property_del(OBJECT(bus), name, NULL);
+            object_property_del(OBJECT(bus), name, IGNORE_ERRORS);
             object_unref(OBJECT(kid->child));
             g_free(kid);
             return;
@@ -97,7 +97,7 @@ static void bus_add_child(BusState *bus, DeviceState *child)
                              (Object **)&kid->child,
                              NULL, /* read-only property */
                              0, /* return ownership on prop deletion */
-                             NULL);
+                             IGNORE_ERRORS);
 }
 
 void qdev_set_parent_bus(DeviceState *dev, BusState *bus)
@@ -470,7 +470,8 @@ void qdev_connect_gpio_out_named(DeviceState *dev, const char *name, int n,
          */
         object_property_add_child(container_get(qdev_get_machine(),
                                                 "/unattached"),
-                                  "non-qdev-gpio[*]", OBJECT(pin), NULL);
+                                  "non-qdev-gpio[*]", OBJECT(pin),
+                                  IGNORE_ERRORS);
     }
     object_property_set_link(OBJECT(dev), OBJECT(pin), propname, &error_abort);
     g_free(propname);
@@ -482,7 +483,7 @@ qemu_irq qdev_get_gpio_out_connector(DeviceState *dev, const char *name, int n)
                                      name ? name : "unnamed-gpio-out", n);
 
     qemu_irq ret = (qemu_irq)object_property_get_link(OBJECT(dev), propname,
-                                                      NULL);
+                                                      IGNORE_ERRORS);
 
     return ret;
 }
@@ -496,9 +497,9 @@ static qemu_irq qdev_disconnect_gpio_out_named(DeviceState *dev,
                                      name ? name : "unnamed-gpio-out", n);
 
     qemu_irq ret = (qemu_irq)object_property_get_link(OBJECT(dev), propname,
-                                                      NULL);
+                                                      IGNORE_ERRORS);
     if (ret) {
-        object_property_set_link(OBJECT(dev), NULL, propname, NULL);
+        object_property_set_link(OBJECT(dev), NULL, propname, IGNORE_ERRORS);
     }
     g_free(propname);
     return ret;
@@ -838,7 +839,7 @@ static int qdev_add_hotpluggable_device(Object *obj, void *opaque)
         return 0;
     }
 
-    if (dev->realized && object_property_get_bool(obj, "hotpluggable", NULL)) {
+    if (dev->realized && object_property_get_bool(obj, "hotpluggable", IGNORE_ERRORS)) {
         *list = g_slist_append(*list, dev);
     }
 
@@ -978,7 +979,7 @@ static void device_set_realized(Object *obj, bool value, Error **errp)
 child_realize_fail:
     QLIST_FOREACH(bus, &dev->child_bus, sibling) {
         object_property_set_bool(OBJECT(bus), false, "realized",
-                                 NULL);
+                                 IGNORE_ERRORS);
     }
 
     if (qdev_get_vmsd(dev)) {
@@ -1029,9 +1030,10 @@ static void device_initfn(Object *obj)
     dev->realized = false;
 
     object_property_add_bool(obj, "realized",
-                             device_get_realized, device_set_realized, NULL);
+                             device_get_realized, device_set_realized,
+                             IGNORE_ERRORS);
     object_property_add_bool(obj, "hotpluggable",
-                             device_get_hotpluggable, NULL, NULL);
+                             device_get_hotpluggable, NULL, IGNORE_ERRORS);
     object_property_add_bool(obj, "hotplugged",
                              device_get_hotplugged, NULL,
                              &error_abort);
@@ -1090,7 +1092,7 @@ static void device_unparent(Object *obj)
     BusState *bus;
 
     if (dev->realized) {
-        object_property_set_bool(obj, false, "realized", NULL);
+        object_property_set_bool(obj, false, "realized", IGNORE_ERRORS);
     }
     while (dev->num_child_bus) {
         bus = QLIST_FIRST(&dev->child_bus);
diff --git a/hw/core/sysbus.c b/hw/core/sysbus.c
index c6dfd9ae0c..8600af9050 100644
--- a/hw/core/sysbus.c
+++ b/hw/core/sysbus.c
@@ -92,7 +92,7 @@ bool sysbus_has_irq(SysBusDevice *dev, int n)
     char *prop = g_strdup_printf("%s[%d]", SYSBUS_DEVICE_GPIO_IRQ, n);
     ObjectProperty *r;
 
-    r = object_property_find(OBJECT(dev), prop, NULL);
+    r = object_property_find(OBJECT(dev), prop, IGNORE_ERRORS);
     g_free(prop);
 
     return (r != NULL);
@@ -362,7 +362,8 @@ static void main_system_bus_create(void)
     OBJECT(main_system_bus)->free = g_free;
     object_property_add_child(container_get(qdev_get_machine(),
                                             "/unattached"),
-                              "sysbus", OBJECT(main_system_bus), NULL);
+                              "sysbus", OBJECT(main_system_bus),
+                              IGNORE_ERRORS);
 }
 
 BusState *sysbus_get_default(void)
diff --git a/hw/cpu/a15mpcore.c b/hw/cpu/a15mpcore.c
index bc05152fd3..6d376b978d 100644
--- a/hw/cpu/a15mpcore.c
+++ b/hw/cpu/a15mpcore.c
@@ -66,7 +66,7 @@ static void a15mp_priv_realize(DeviceState *dev, Error **errp)
          * either all the CPUs have TZ, or none do.
          */
         cpuobj = OBJECT(qemu_get_cpu(0));
-        has_el3 = object_property_find(cpuobj, "has_el3", NULL) &&
+        has_el3 = object_property_find(cpuobj, "has_el3", IGNORE_ERRORS) &&
             object_property_get_bool(cpuobj, "has_el3", &error_abort);
         qdev_prop_set_bit(gicdev, "has-security-extensions", has_el3);
     }
diff --git a/hw/cpu/a9mpcore.c b/hw/cpu/a9mpcore.c
index f17f292090..23f2c252bd 100644
--- a/hw/cpu/a9mpcore.c
+++ b/hw/cpu/a9mpcore.c
@@ -72,7 +72,7 @@ static void a9mp_priv_realize(DeviceState *dev, Error **errp)
      * either all the CPUs have TZ, or none do.
      */
     cpuobj = OBJECT(qemu_get_cpu(0));
-    has_el3 = object_property_find(cpuobj, "has_el3", NULL) &&
+    has_el3 = object_property_find(cpuobj, "has_el3", IGNORE_ERRORS) &&
         object_property_get_bool(cpuobj, "has_el3", &error_abort);
     qdev_prop_set_bit(gicdev, "has-security-extensions", has_el3);
 
diff --git a/hw/cpu/core.c b/hw/cpu/core.c
index 2bf960d6a8..b38d882432 100644
--- a/hw/cpu/core.c
+++ b/hw/cpu/core.c
@@ -66,9 +66,9 @@ static void cpu_core_instance_init(Object *obj)
     CPUCore *core = CPU_CORE(obj);
 
     object_property_add(obj, "core-id", "int", core_prop_get_core_id,
-                        core_prop_set_core_id, NULL, NULL, NULL);
+                        core_prop_set_core_id, NULL, NULL, IGNORE_ERRORS);
     object_property_add(obj, "nr-threads", "int", core_prop_get_nr_threads,
-                        core_prop_set_nr_threads, NULL, NULL, NULL);
+                        core_prop_set_nr_threads, NULL, NULL, IGNORE_ERRORS);
     core->nr_threads = smp_threads;
 }
 
diff --git a/hw/display/vga-pci.c b/hw/display/vga-pci.c
index 0f6a836b77..950fa207b5 100644
--- a/hw/display/vga-pci.c
+++ b/hw/display/vga-pci.c
@@ -268,7 +268,8 @@ static void pci_std_vga_init(Object *obj)
 {
     /* Expose framebuffer byteorder via QOM */
     object_property_add_bool(obj, "big-endian-framebuffer",
-                             vga_get_big_endian_fb, vga_set_big_endian_fb, NULL);
+                             vga_get_big_endian_fb, vga_set_big_endian_fb,
+                             IGNORE_ERRORS);
 }
 
 static void pci_secondary_vga_realize(PCIDevice *dev, Error **errp)
@@ -298,7 +299,8 @@ static void pci_secondary_vga_init(Object *obj)
 {
     /* Expose framebuffer byteorder via QOM */
     object_property_add_bool(obj, "big-endian-framebuffer",
-                             vga_get_big_endian_fb, vga_set_big_endian_fb, NULL);
+                             vga_get_big_endian_fb, vga_set_big_endian_fb,
+                             IGNORE_ERRORS);
 }
 
 static void pci_secondary_vga_reset(DeviceState *dev)
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index ce74c84460..0775ea65bf 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -137,9 +137,11 @@ static void acpi_get_pm_info(AcpiPmInfo *pm)
         obj = piix;
         pm->cpu_hp_io_base = PIIX4_CPU_HOTPLUG_IO_BASE;
         pm->pcihp_io_base =
-            object_property_get_int(obj, ACPI_PCIHP_IO_BASE_PROP, NULL);
+            object_property_get_int(obj, ACPI_PCIHP_IO_BASE_PROP,
+                                    IGNORE_ERRORS);
         pm->pcihp_io_len =
-            object_property_get_int(obj, ACPI_PCIHP_IO_LEN_PROP, NULL);
+            object_property_get_int(obj, ACPI_PCIHP_IO_LEN_PROP,
+                                    IGNORE_ERRORS);
     }
     if (lpc) {
         obj = lpc;
@@ -148,21 +150,23 @@ static void acpi_get_pm_info(AcpiPmInfo *pm)
     assert(obj);
 
     /* Fill in optional s3/s4 related properties */
-    o = object_property_get_qobject(obj, ACPI_PM_PROP_S3_DISABLED, NULL);
+    o = object_property_get_qobject(obj, ACPI_PM_PROP_S3_DISABLED,
+                                    IGNORE_ERRORS);
     if (o) {
         pm->s3_disabled = qint_get_int(qobject_to_qint(o));
     } else {
         pm->s3_disabled = false;
     }
     qobject_decref(o);
-    o = object_property_get_qobject(obj, ACPI_PM_PROP_S4_DISABLED, NULL);
+    o = object_property_get_qobject(obj, ACPI_PM_PROP_S4_DISABLED,
+                                    IGNORE_ERRORS);
     if (o) {
         pm->s4_disabled = qint_get_int(qobject_to_qint(o));
     } else {
         pm->s4_disabled = false;
     }
     qobject_decref(o);
-    o = object_property_get_qobject(obj, ACPI_PM_PROP_S4_VAL, NULL);
+    o = object_property_get_qobject(obj, ACPI_PM_PROP_S4_VAL, IGNORE_ERRORS);
     if (o) {
         pm->s4_val = qint_get_int(qobject_to_qint(o));
     } else {
@@ -171,23 +175,24 @@ static void acpi_get_pm_info(AcpiPmInfo *pm)
     qobject_decref(o);
 
     /* Fill in mandatory properties */
-    pm->sci_int = object_property_get_int(obj, ACPI_PM_PROP_SCI_INT, NULL);
+    pm->sci_int = object_property_get_int(obj, ACPI_PM_PROP_SCI_INT,
+                                          IGNORE_ERRORS);
 
     pm->acpi_enable_cmd = object_property_get_int(obj,
                                                   ACPI_PM_PROP_ACPI_ENABLE_CMD,
-                                                  NULL);
+                                                  IGNORE_ERRORS);
     pm->acpi_disable_cmd = object_property_get_int(obj,
                                                   ACPI_PM_PROP_ACPI_DISABLE_CMD,
-                                                  NULL);
+                                                  IGNORE_ERRORS);
     pm->io_base = object_property_get_int(obj, ACPI_PM_PROP_PM_IO_BASE,
-                                          NULL);
+                                          IGNORE_ERRORS);
     pm->gpe0_blk = object_property_get_int(obj, ACPI_PM_PROP_GPE0_BLK,
-                                           NULL);
+                                           IGNORE_ERRORS);
     pm->gpe0_blk_len = object_property_get_int(obj, ACPI_PM_PROP_GPE0_BLK_LEN,
-                                               NULL);
+                                               IGNORE_ERRORS);
     pm->pcihp_bridge_en =
         object_property_get_bool(obj, "acpi-pci-hotplug-with-bridge-support",
-                                 NULL);
+                                 IGNORE_ERRORS);
 }
 
 static void acpi_get_misc_info(AcpiMiscInfo *info)
@@ -239,17 +244,17 @@ static void acpi_get_pci_holes(Range *hole, Range *hole64)
     range_set_bounds1(hole,
                       object_property_get_int(pci_host,
                                               PCI_HOST_PROP_PCI_HOLE_START,
-                                              NULL),
+                                              IGNORE_ERRORS),
                       object_property_get_int(pci_host,
                                               PCI_HOST_PROP_PCI_HOLE_END,
-                                              NULL));
+                                              IGNORE_ERRORS));
     range_set_bounds1(hole64,
                       object_property_get_int(pci_host,
                                               PCI_HOST_PROP_PCI_HOLE64_START,
-                                              NULL),
+                                              IGNORE_ERRORS),
                       object_property_get_int(pci_host,
                                               PCI_HOST_PROP_PCI_HOLE64_END,
-                                              NULL));
+                                              IGNORE_ERRORS));
 }
 
 #define ACPI_PORT_SMI_CMD           0x00b2 /* TODO: this is APM_CNT_IOPORT */
@@ -527,7 +532,8 @@ static void build_append_pci_bus_devices(Aml *parent_scope, PCIBus *bus,
     PCIBus *sec;
     int i;
 
-    bsel = object_property_get_qobject(OBJECT(bus), ACPI_PCIHP_PROP_BSEL, NULL);
+    bsel = object_property_get_qobject(OBJECT(bus), ACPI_PCIHP_PROP_BSEL,
+                                       IGNORE_ERRORS);
     if (bsel) {
         int64_t bsel_val = qint_get_int(qobject_to_qint(bsel));
 
@@ -2138,7 +2144,8 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
          * of the i/o region used is FW_CFG_CTL_SIZE; when using DMA, the
          * DMA control register is located at FW_CFG_DMA_IO_BASE + 4 */
         uint8_t io_size = object_property_get_bool(OBJECT(pcms->fw_cfg),
-                                                   "dma_enabled", NULL) ?
+                                                   "dma_enabled",
+                                                   IGNORE_ERRORS) ?
                           ROUND_UP(FW_CFG_CTL_SIZE, 4) + sizeof(dma_addr_t) :
                           FW_CFG_CTL_SIZE;
 
@@ -2327,7 +2334,7 @@ build_srat(GArray *table_data, BIOSLinker *linker, MachineState *machine)
     PCMachineState *pcms = PC_MACHINE(machine);
     ram_addr_t hotplugabble_address_space_size =
         object_property_get_int(OBJECT(pcms), PC_MACHINE_MEMHP_REGION_SIZE,
-                                NULL);
+                                IGNORE_ERRORS);
 
     srat_start = table_data->len;
 
@@ -2610,14 +2617,16 @@ static bool acpi_get_mcfg(AcpiMcfgInfo *mcfg)
     pci_host = acpi_get_i386_pci_host();
     g_assert(pci_host);
 
-    o = object_property_get_qobject(pci_host, PCIE_HOST_MCFG_BASE, NULL);
+    o = object_property_get_qobject(pci_host, PCIE_HOST_MCFG_BASE,
+                                    IGNORE_ERRORS);
     if (!o) {
         return false;
     }
     mcfg->mcfg_base = qint_get_int(qobject_to_qint(o));
     qobject_decref(o);
 
-    o = object_property_get_qobject(pci_host, PCIE_HOST_MCFG_SIZE, NULL);
+    o = object_property_get_qobject(pci_host, PCIE_HOST_MCFG_SIZE,
+                                    IGNORE_ERRORS);
     assert(o);
     mcfg->mcfg_size = qint_get_int(qobject_to_qint(o));
     qobject_decref(o);
diff --git a/hw/i386/kvm/pci-assign.c b/hw/i386/kvm/pci-assign.c
index 87dcbdd51a..bc8795f7f3 100644
--- a/hw/i386/kvm/pci-assign.c
+++ b/hw/i386/kvm/pci-assign.c
@@ -1843,7 +1843,7 @@ static void assigned_dev_instance_init(Object *obj)
 
     device_add_bootindex_property(obj, &d->bootindex,
                                   "bootindex", NULL,
-                                  &pci_dev->qdev, NULL);
+                                  &pci_dev->qdev, IGNORE_ERRORS);
 }
 
 static Property assigned_dev_properties[] = {
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 742b5507e3..efa6c35157 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1560,7 +1560,7 @@ void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi,
              * IRQ8 and IRQ2.
              */
             uint8_t compat = object_property_get_int(OBJECT(hpet),
-                    HPET_INTCAP, NULL);
+                    HPET_INTCAP, IGNORE_ERRORS);
             if (!compat) {
                 qdev_prop_set_uint32(hpet, HPET_INTCAP, hpet_irqs);
             }
@@ -1671,7 +1671,7 @@ void ioapic_init_gsi(GSIState *gsi_state, const char *parent_name)
     }
     if (parent_name) {
         object_property_add_child(object_resolve_path(parent_name, NULL),
-                                  "ioapic", OBJECT(dev), NULL);
+                                  "ioapic", OBJECT(dev), IGNORE_ERRORS);
     }
     qdev_init_nofail(dev);
     d = SYS_BUS_DEVICE(dev);
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index 9179fb31de..0e9ad9f929 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -162,19 +162,20 @@ static void pc_q35_init(MachineState *machine)
     /* create pci host bus */
     q35_host = Q35_HOST_DEVICE(qdev_create(NULL, TYPE_Q35_HOST_DEVICE));
 
-    object_property_add_child(qdev_get_machine(), "q35", OBJECT(q35_host), NULL);
+    object_property_add_child(qdev_get_machine(), "q35", OBJECT(q35_host),
+                              IGNORE_ERRORS);
     object_property_set_link(OBJECT(q35_host), OBJECT(ram_memory),
-                             MCH_HOST_PROP_RAM_MEM, NULL);
+                             MCH_HOST_PROP_RAM_MEM, IGNORE_ERRORS);
     object_property_set_link(OBJECT(q35_host), OBJECT(pci_memory),
-                             MCH_HOST_PROP_PCI_MEM, NULL);
+                             MCH_HOST_PROP_PCI_MEM, IGNORE_ERRORS);
     object_property_set_link(OBJECT(q35_host), OBJECT(get_system_memory()),
-                             MCH_HOST_PROP_SYSTEM_MEM, NULL);
+                             MCH_HOST_PROP_SYSTEM_MEM, IGNORE_ERRORS);
     object_property_set_link(OBJECT(q35_host), OBJECT(system_io),
-                             MCH_HOST_PROP_IO_MEM, NULL);
+                             MCH_HOST_PROP_IO_MEM, IGNORE_ERRORS);
     object_property_set_int(OBJECT(q35_host), pcms->below_4g_mem_size,
-                            PCI_HOST_BELOW_4G_MEM_SIZE, NULL);
+                            PCI_HOST_BELOW_4G_MEM_SIZE, IGNORE_ERRORS);
     object_property_set_int(OBJECT(q35_host), pcms->above_4g_mem_size,
-                            PCI_HOST_ABOVE_4G_MEM_SIZE, NULL);
+                            PCI_HOST_ABOVE_4G_MEM_SIZE, IGNORE_ERRORS);
     /* pci */
     qdev_init_nofail(DEVICE(q35_host));
     phb = PCI_HOST_BRIDGE(q35_host);
diff --git a/hw/ide/ich.c b/hw/ide/ich.c
index 092f16c2d7..519d3d5e16 100644
--- a/hw/ide/ich.c
+++ b/hw/ide/ich.c
@@ -147,7 +147,7 @@ static void pci_ich9_ahci_realize(PCIDevice *dev, Error **errp)
     /* Although the AHCI 1.3 specification states that the first capability
      * should be PMCAP, the Intel ICH9 data sheet specifies that the ICH9
      * AHCI device puts the MSI capability first, pointing to 0x80. */
-    ret = msi_init(dev, ICH9_MSI_CAP_OFFSET, 1, true, false, NULL);
+    ret = msi_init(dev, ICH9_MSI_CAP_OFFSET, 1, true, false, IGNORE_ERRORS);
     /* Any error other than -ENOTSUP(board's MSI support is broken)
      * is a programming error.  Fall back to INTx silently on -ENOTSUP */
     assert(!ret || ret == -ENOTSUP);
diff --git a/hw/ide/qdev.c b/hw/ide/qdev.c
index 299e592fa2..efa34e429a 100644
--- a/hw/ide/qdev.c
+++ b/hw/ide/qdev.c
@@ -263,8 +263,8 @@ static void ide_dev_instance_init(Object *obj)
 {
     object_property_add(obj, "bootindex", "int32",
                         ide_dev_get_bootindex,
-                        ide_dev_set_bootindex, NULL, NULL, NULL);
-    object_property_set_int(obj, -1, "bootindex", NULL);
+                        ide_dev_set_bootindex, NULL, NULL, IGNORE_ERRORS);
+    object_property_set_int(obj, -1, "bootindex", IGNORE_ERRORS);
 }
 
 static int ide_hd_initfn(IDEDevice *dev)
diff --git a/hw/input/virtio-input-hid.c b/hw/input/virtio-input-hid.c
index 8666234554..ad1beb3b0b 100644
--- a/hw/input/virtio-input-hid.c
+++ b/hw/input/virtio-input-hid.c
@@ -267,7 +267,8 @@ static void virtio_input_hid_realize(DeviceState *dev, Error **errp)
 
     vhid->hs = qemu_input_handler_register(dev, vhid->handler);
     if (vhid->display && vhid->hs) {
-        qemu_input_handler_bind(vhid->hs, vhid->display, vhid->head, NULL);
+        qemu_input_handler_bind(vhid->hs, vhid->display, vhid->head,
+                                IGNORE_ERRORS);
     }
 }
 
diff --git a/hw/intc/apic_common.c b/hw/intc/apic_common.c
index 1ef56f8d10..09b75a3048 100644
--- a/hw/intc/apic_common.c
+++ b/hw/intc/apic_common.c
@@ -331,7 +331,7 @@ static void apic_common_realize(DeviceState *dev, Error **errp)
         instance_id = -1;
     }
     vmstate_register_with_alias_id(NULL, instance_id, &vmstate_apic_common,
-                                   s, -1, 0, NULL);
+                                   s, -1, 0, IGNORE_ERRORS);
 }
 
 static void apic_common_unrealize(DeviceState *dev, Error **errp)
@@ -486,7 +486,7 @@ static void apic_common_initfn(Object *obj)
     s->id = s->initial_apic_id = -1;
     object_property_add(obj, "id", "int",
                         apic_common_get_id,
-                        apic_common_set_id, NULL, NULL, NULL);
+                        apic_common_set_id, NULL, NULL, IGNORE_ERRORS);
 }
 
 static void apic_common_class_init(ObjectClass *klass, void *data)
diff --git a/hw/intc/arm_gicv3_common.c b/hw/intc/arm_gicv3_common.c
index c6493d6c07..3fcd6dfaa9 100644
--- a/hw/intc/arm_gicv3_common.c
+++ b/hw/intc/arm_gicv3_common.c
@@ -267,7 +267,8 @@ static void arm_gicv3_common_realize(DeviceState *dev, Error **errp)
          *  VLPIS == 0 (virtual LPIs not supported)
          *  PLPIS == 0 (physical LPIs not supported)
          */
-        cpu_affid = object_property_get_int(OBJECT(cpu), "mp-affinity", NULL);
+        cpu_affid = object_property_get_int(OBJECT(cpu), "mp-affinity",
+                                            IGNORE_ERRORS);
         last = (i == s->num_cpu - 1);
 
         /* The CPU mp-affinity property is in MPIDR register format; squash
diff --git a/hw/intc/s390_flic.c b/hw/intc/s390_flic.c
index a26e90670f..cc14ddc4bd 100644
--- a/hw/intc/s390_flic.c
+++ b/hw/intc/s390_flic.c
@@ -40,7 +40,7 @@ void s390_flic_init(void)
     if (!dev) {
         dev = qdev_create(NULL, TYPE_QEMU_S390_FLIC);
         object_property_add_child(qdev_get_machine(), TYPE_QEMU_S390_FLIC,
-                                  OBJECT(dev), NULL);
+                                  OBJECT(dev), IGNORE_ERRORS);
     }
     qdev_init_nofail(dev);
 }
diff --git a/hw/intc/s390_flic_kvm.c b/hw/intc/s390_flic_kvm.c
index 7ee9b77399..4ee59628d0 100644
--- a/hw/intc/s390_flic_kvm.c
+++ b/hw/intc/s390_flic_kvm.c
@@ -40,7 +40,7 @@ DeviceState *s390_flic_kvm_create(void)
     if (kvm_enabled()) {
         dev = qdev_create(NULL, TYPE_KVM_S390_FLIC);
         object_property_add_child(qdev_get_machine(), TYPE_KVM_S390_FLIC,
-                                  OBJECT(dev), NULL);
+                                  OBJECT(dev), IGNORE_ERRORS);
     }
     return dev;
 }
diff --git a/hw/ipmi/ipmi.c b/hw/ipmi/ipmi.c
index a51cbca6f7..5dd057cd39 100644
--- a/hw/ipmi/ipmi.c
+++ b/hw/ipmi/ipmi.c
@@ -59,7 +59,7 @@ static int ipmi_do_hw_op(IPMIInterface *s, enum ipmi_op op, int checkonly)
         if (checkonly) {
             return 0;
         }
-        qmp_inject_nmi(NULL);
+        qmp_inject_nmi(IGNORE_ERRORS);
         return 0;
 
     case IPMI_SHUTDOWN_VIA_ACPI_OVERTEMP:
diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c
index 28c0fedb5d..99a136d05a 100644
--- a/hw/isa/lpc_ich9.c
+++ b/hw/isa/lpc_ich9.c
@@ -653,11 +653,11 @@ static void ich9_lpc_add_properties(ICH9LPCState *lpc)
 
     object_property_add(OBJECT(lpc), ACPI_PM_PROP_SCI_INT, "uint32",
                         ich9_lpc_get_sci_int,
-                        NULL, NULL, NULL, NULL);
+                        NULL, NULL, NULL, IGNORE_ERRORS);
     object_property_add_uint8_ptr(OBJECT(lpc), ACPI_PM_PROP_ACPI_ENABLE_CMD,
-                                  &acpi_enable_cmd, NULL);
+                                  &acpi_enable_cmd, IGNORE_ERRORS);
     object_property_add_uint8_ptr(OBJECT(lpc), ACPI_PM_PROP_ACPI_DISABLE_CMD,
-                                  &acpi_disable_cmd, NULL);
+                                  &acpi_disable_cmd, IGNORE_ERRORS);
 
     ich9_pm_add_properties(OBJECT(lpc), &lpc->pm, NULL);
 }
diff --git a/hw/mem/nvdimm.c b/hw/mem/nvdimm.c
index db896b0bb6..3843eb6110 100644
--- a/hw/mem/nvdimm.c
+++ b/hw/mem/nvdimm.c
@@ -68,7 +68,7 @@ static void nvdimm_init(Object *obj)
 {
     object_property_add(obj, "label-size", "int",
                         nvdimm_get_label_size, nvdimm_set_label_size, NULL,
-                        NULL, NULL);
+                        NULL, IGNORE_ERRORS);
 }
 
 static MemoryRegion *nvdimm_get_memory_region(PCDIMMDevice *dimm)
diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc-dimm.c
index 9e8dab0e89..92fb48255a 100644
--- a/hw/mem/pc-dimm.c
+++ b/hw/mem/pc-dimm.c
@@ -182,7 +182,7 @@ int qmp_pc_dimm_device_list(Object *obj, void *opaque)
             di->slot = dimm->slot;
             di->node = dimm->node;
             di->size = object_property_get_int(OBJECT(dimm), PC_DIMM_SIZE_PROP,
-                                               NULL);
+                                               IGNORE_ERRORS);
             di->memdev = object_get_canonical_path(OBJECT(dimm->hostmem));
 
             info->u.dimm.data = di;
diff --git a/hw/microblaze/petalogix_ml605_mmu.c b/hw/microblaze/petalogix_ml605_mmu.c
index 4968bdbb28..69ba8a37d3 100644
--- a/hw/microblaze/petalogix_ml605_mmu.c
+++ b/hw/microblaze/petalogix_ml605_mmu.c
@@ -145,14 +145,15 @@ petalogix_ml605_init(MachineState *machine)
 
     /* FIXME: attach to the sysbus instead */
     object_property_add_child(qdev_get_machine(), "xilinx-eth", OBJECT(eth0),
-                              NULL);
+                              IGNORE_ERRORS);
     object_property_add_child(qdev_get_machine(), "xilinx-dma", OBJECT(dma),
-                              NULL);
+                              IGNORE_ERRORS);
 
     ds = object_property_get_link(OBJECT(dma),
-                                  "axistream-connected-target", NULL);
+                                  "axistream-connected-target", IGNORE_ERRORS);
     cs = object_property_get_link(OBJECT(dma),
-                                  "axistream-control-connected-target", NULL);
+                                  "axistream-control-connected-target",
+                                  IGNORE_ERRORS);
     qdev_set_nic_properties(eth0, &nd_table[0]);
     qdev_prop_set_uint32(eth0, "rxmem", 0x1000);
     qdev_prop_set_uint32(eth0, "txmem", 0x1000);
@@ -165,9 +166,10 @@ petalogix_ml605_init(MachineState *machine)
     sysbus_connect_irq(SYS_BUS_DEVICE(eth0), 0, irq[AXIENET_IRQ]);
 
     ds = object_property_get_link(OBJECT(eth0),
-                                  "axistream-connected-target", NULL);
+                                  "axistream-connected-target", IGNORE_ERRORS);
     cs = object_property_get_link(OBJECT(eth0),
-                                  "axistream-control-connected-target", NULL);
+                                  "axistream-control-connected-target",
+                                  IGNORE_ERRORS);
     qdev_prop_set_uint32(dma, "freqhz", 100 * 1000000);
     object_property_set_link(OBJECT(dma), OBJECT(ds),
                              "axistream-connected", &error_abort);
diff --git a/hw/mips/boston.c b/hw/mips/boston.c
index a4677f7da4..61d03e8b2a 100644
--- a/hw/mips/boston.c
+++ b/hw/mips/boston.c
@@ -531,7 +531,7 @@ static void boston_mach_init(MachineState *machine)
     memory_region_add_subregion_overlap(sys_mem, 0x17fff000, lcd, 0);
 
     chr = qemu_chr_new("lcd", "vc:320x240");
-    qemu_chr_fe_init(&s->lcd_display, chr, NULL);
+    qemu_chr_fe_init(&s->lcd_display, chr, IGNORE_ERRORS);
     qemu_chr_fe_set_handlers(&s->lcd_display, NULL, NULL,
                              boston_lcd_event, s, NULL, true);
 
diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c
index 4b6ccb575e..ef34ebd886 100644
--- a/hw/mips/mips_malta.c
+++ b/hw/mips/mips_malta.c
@@ -569,7 +569,7 @@ static MaltaFPGAState *malta_fpga_init(MemoryRegion *address_space,
     memory_region_add_subregion(address_space, base + 0xa00, &s->iomem_hi);
 
     chr = qemu_chr_new("fpga", "vc:320x200");
-    qemu_chr_fe_init(&s->display, chr, NULL);
+    qemu_chr_fe_init(&s->display, chr, IGNORE_ERRORS);
     qemu_chr_fe_set_handlers(&s->display, NULL, NULL,
                              malta_fgpa_display_event, s, NULL, true);
 
diff --git a/hw/misc/auxbus.c b/hw/misc/auxbus.c
index 3342b65f15..a718aa0cde 100644
--- a/hw/misc/auxbus.c
+++ b/hw/misc/auxbus.c
@@ -245,7 +245,7 @@ static void aux_slave_dev_print(Monitor *mon, DeviceState *dev, int indent)
 
     monitor_printf(mon, "%*smemory " TARGET_FMT_plx "/" TARGET_FMT_plx "\n",
                    indent, "",
-                   object_property_get_int(OBJECT(s->mmio), "addr", NULL),
+                   object_property_get_int(OBJECT(s->mmio), "addr", IGNORE_ERRORS),
                    memory_region_size(s->mmio));
 }
 
diff --git a/hw/misc/edu.c b/hw/misc/edu.c
index eb814df82d..48735517f4 100644
--- a/hw/misc/edu.c
+++ b/hw/misc/edu.c
@@ -392,7 +392,7 @@ static void edu_instance_init(Object *obj)
 
     edu->dma_mask = (1UL << 28) - 1;
     object_property_add(obj, "dma_mask", "uint64", edu_obj_uint64,
-                    edu_obj_uint64, NULL, &edu->dma_mask, NULL);
+                    edu_obj_uint64, NULL, &edu->dma_mask, IGNORE_ERRORS);
 }
 
 static void edu_class_init(ObjectClass *class, void *data)
diff --git a/hw/misc/macio/macio.c b/hw/misc/macio/macio.c
index 5d57f45dc6..fed0c6b269 100644
--- a/hw/misc/macio/macio.c
+++ b/hw/misc/macio/macio.c
@@ -214,7 +214,7 @@ static void macio_init_ide(MacIOState *s, MACIOIDEState *ide, size_t ide_size,
     memory_region_add_subregion(&s->bar, 0x1f000 + ((index + 1) * 0x1000),
                                 &ide->mem);
     name = g_strdup_printf("ide[%i]", index);
-    object_property_add_child(OBJECT(s), name, OBJECT(ide), NULL);
+    object_property_add_child(OBJECT(s), name, OBJECT(ide), IGNORE_ERRORS);
     g_free(name);
 }
 
@@ -333,7 +333,7 @@ static void macio_instance_init(Object *obj)
 
     object_initialize(&s->cuda, sizeof(s->cuda), TYPE_CUDA);
     qdev_set_parent_bus(DEVICE(&s->cuda), sysbus_get_default());
-    object_property_add_child(obj, "cuda", OBJECT(&s->cuda), NULL);
+    object_property_add_child(obj, "cuda", OBJECT(&s->cuda), IGNORE_ERRORS);
 }
 
 static const VMStateDescription vmstate_macio_oldworld = {
diff --git a/hw/misc/pvpanic.c b/hw/misc/pvpanic.c
index 5cd5a92614..0badd7b0a0 100644
--- a/hw/misc/pvpanic.c
+++ b/hw/misc/pvpanic.c
@@ -112,7 +112,7 @@ uint16_t pvpanic_port(void)
     if (!o) {
         return 0;
     }
-    return object_property_get_int(o, PVPANIC_IOPORT_PROP, NULL);
+    return object_property_get_int(o, PVPANIC_IOPORT_PROP, IGNORE_ERRORS);
 }
 
 static Property pvpanic_isa_properties[] = {
diff --git a/hw/misc/tmp105.c b/hw/misc/tmp105.c
index 04e83787d4..82a25b91f4 100644
--- a/hw/misc/tmp105.c
+++ b/hw/misc/tmp105.c
@@ -244,7 +244,7 @@ static void tmp105_initfn(Object *obj)
 {
     object_property_add(obj, "temperature", "int",
                         tmp105_get_temperature,
-                        tmp105_set_temperature, NULL, NULL, NULL);
+                        tmp105_set_temperature, NULL, NULL, IGNORE_ERRORS);
 }
 
 static void tmp105_class_init(ObjectClass *klass, void *data)
diff --git a/hw/net/e1000.c b/hw/net/e1000.c
index 4353f91cff..4141e7e108 100644
--- a/hw/net/e1000.c
+++ b/hw/net/e1000.c
@@ -1676,7 +1676,7 @@ static void e1000_instance_init(Object *obj)
     E1000State *n = E1000(obj);
     device_add_bootindex_property(obj, &n->conf.bootindex,
                                   "bootindex", "/ethernet-phy@0",
-                                  DEVICE(n), NULL);
+                                  DEVICE(n), IGNORE_ERRORS);
 }
 
 static const TypeInfo e1000_base_info = {
diff --git a/hw/net/e1000e.c b/hw/net/e1000e.c
index 664554f33c..34167c0384 100644
--- a/hw/net/e1000e.c
+++ b/hw/net/e1000e.c
@@ -293,7 +293,7 @@ e1000e_init_msix(E1000EState *s)
                         E1000E_MSIX_IDX, E1000E_MSIX_TABLE,
                         &s->msix,
                         E1000E_MSIX_IDX, E1000E_MSIX_PBA,
-                        0xA0, NULL);
+                        0xA0, IGNORE_ERRORS);
 
     if (res < 0) {
         trace_e1000e_msix_init_fail(res);
@@ -463,7 +463,7 @@ static void e1000e_pci_realize(PCIDevice *pci_dev, Error **errp)
         hw_error("Failed to initialize PCIe capability");
     }
 
-    ret = msi_init(PCI_DEVICE(s), 0xD0, 1, true, false, NULL);
+    ret = msi_init(PCI_DEVICE(s), 0xD0, 1, true, false, IGNORE_ERRORS);
     if (ret) {
         trace_e1000e_msi_init_fail(ret);
     }
@@ -474,7 +474,7 @@ static void e1000e_pci_realize(PCIDevice *pci_dev, Error **errp)
     }
 
     if (pcie_aer_init(pci_dev, PCI_ERR_VER, e1000e_aer_offset,
-                      PCI_ERR_SIZEOF, NULL) < 0) {
+                      PCI_ERR_SIZEOF, IGNORE_ERRORS) < 0) {
         hw_error("Failed to initialize AER capability");
     }
 
@@ -694,7 +694,7 @@ static void e1000e_instance_init(Object *obj)
     E1000EState *s = E1000E(obj);
     device_add_bootindex_property(obj, &s->conf.bootindex,
                                   "bootindex", "/ethernet-phy@0",
-                                  DEVICE(obj), NULL);
+                                  DEVICE(obj), IGNORE_ERRORS);
 }
 
 static const TypeInfo e1000e_info = {
diff --git a/hw/net/eepro100.c b/hw/net/eepro100.c
index 5e03c9fb24..663addc758 100644
--- a/hw/net/eepro100.c
+++ b/hw/net/eepro100.c
@@ -1906,7 +1906,7 @@ static void eepro100_instance_init(Object *obj)
     EEPRO100State *s = DO_UPCAST(EEPRO100State, dev, PCI_DEVICE(obj));
     device_add_bootindex_property(obj, &s->conf.bootindex,
                                   "bootindex", "/ethernet-phy@0",
-                                  DEVICE(s), NULL);
+                                  DEVICE(s), IGNORE_ERRORS);
 }
 
 static E100PCIDeviceInfo e100_devices[] = {
diff --git a/hw/net/lance.c b/hw/net/lance.c
index 7ac795d4b2..a3141d7676 100644
--- a/hw/net/lance.c
+++ b/hw/net/lance.c
@@ -145,7 +145,7 @@ static void lance_instance_init(Object *obj)
 
     device_add_bootindex_property(obj, &s->conf.bootindex,
                                   "bootindex", "/ethernet-phy@0",
-                                  DEVICE(obj), NULL);
+                                  DEVICE(obj), IGNORE_ERRORS);
 }
 
 static Property lance_properties[] = {
diff --git a/hw/net/ne2000-isa.c b/hw/net/ne2000-isa.c
index f3455339ee..6065c80f27 100644
--- a/hw/net/ne2000-isa.c
+++ b/hw/net/ne2000-isa.c
@@ -134,8 +134,8 @@ static void isa_ne2000_instance_init(Object *obj)
 {
     object_property_add(obj, "bootindex", "int32",
                         isa_ne2000_get_bootindex,
-                        isa_ne2000_set_bootindex, NULL, NULL, NULL);
-    object_property_set_int(obj, -1, "bootindex", NULL);
+                        isa_ne2000_set_bootindex, NULL, NULL, IGNORE_ERRORS);
+    object_property_set_int(obj, -1, "bootindex", IGNORE_ERRORS);
 }
 static const TypeInfo ne2000_isa_info = {
     .name          = TYPE_ISA_NE2000,
diff --git a/hw/net/ne2000.c b/hw/net/ne2000.c
index f8e86f5184..2aec2b80b0 100644
--- a/hw/net/ne2000.c
+++ b/hw/net/ne2000.c
@@ -757,7 +757,7 @@ static void ne2000_instance_init(Object *obj)
 
     device_add_bootindex_property(obj, &s->c.bootindex,
                                   "bootindex", "/ethernet-phy@0",
-                                  &pci_dev->qdev, NULL);
+                                  &pci_dev->qdev, IGNORE_ERRORS);
 }
 
 static Property ne2000_properties[] = {
diff --git a/hw/net/pcnet-pci.c b/hw/net/pcnet-pci.c
index e08aee92b1..598b60e0eb 100644
--- a/hw/net/pcnet-pci.c
+++ b/hw/net/pcnet-pci.c
@@ -334,7 +334,7 @@ static void pcnet_instance_init(Object *obj)
 
     device_add_bootindex_property(obj, &s->conf.bootindex,
                                   "bootindex", "/ethernet-phy@0",
-                                  DEVICE(obj), NULL);
+                                  DEVICE(obj), IGNORE_ERRORS);
 }
 
 static Property pcnet_properties[] = {
diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c
index 36cd99e3fc..04e1044cd6 100644
--- a/hw/net/rtl8139.c
+++ b/hw/net/rtl8139.c
@@ -3458,7 +3458,7 @@ static void rtl8139_instance_init(Object *obj)
 
     device_add_bootindex_property(obj, &s->conf.bootindex,
                                   "bootindex", "/ethernet-phy@0",
-                                  DEVICE(obj), NULL);
+                                  DEVICE(obj), IGNORE_ERRORS);
 }
 
 static Property rtl8139_properties[] = {
diff --git a/hw/net/spapr_llan.c b/hw/net/spapr_llan.c
index 54ac4f4f44..3e2a9896eb 100644
--- a/hw/net/spapr_llan.c
+++ b/hw/net/spapr_llan.c
@@ -340,7 +340,7 @@ static void spapr_vlan_instance_init(Object *obj)
 
     device_add_bootindex_property(obj, &dev->nicconf.bootindex,
                                   "bootindex", "",
-                                  DEVICE(dev), NULL);
+                                  DEVICE(dev), IGNORE_ERRORS);
 
     if (dev->compat_flags & SPAPRVLAN_FLAG_RX_BUF_POOLS) {
         for (i = 0; i < RX_MAX_POOLS; i++) {
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 3aa2af14e5..b94c23e7ff 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -2036,7 +2036,7 @@ static void virtio_net_instance_init(Object *obj)
     n->config_size = sizeof(struct virtio_net_config);
     device_add_bootindex_property(obj, &n->nic_conf.bootindex,
                                   "bootindex", "/ethernet-phy@0",
-                                  DEVICE(n), NULL);
+                                  DEVICE(n), IGNORE_ERRORS);
 }
 
 static void virtio_net_pre_save(void *opaque)
diff --git a/hw/net/vmxnet3.c b/hw/net/vmxnet3.c
index 7ebb32e664..5d8f150e9d 100644
--- a/hw/net/vmxnet3.c
+++ b/hw/net/vmxnet3.c
@@ -2192,7 +2192,7 @@ vmxnet3_init_msix(VMXNET3State *s)
                         VMXNET3_MSIX_BAR_IDX, VMXNET3_OFF_MSIX_TABLE,
                         &s->msix_bar,
                         VMXNET3_MSIX_BAR_IDX, VMXNET3_OFF_MSIX_PBA(s),
-                        VMXNET3_MSIX_OFFSET(s), NULL);
+                        VMXNET3_MSIX_OFFSET(s), IGNORE_ERRORS);
 
     if (0 > res) {
         VMW_WRPRN("Failed to initialize MSI-X, error %d", res);
@@ -2317,7 +2317,7 @@ static void vmxnet3_pci_realize(PCIDevice *pci_dev, Error **errp)
     pci_dev->config[PCI_INTERRUPT_PIN] = 0x01;
 
     ret = msi_init(pci_dev, VMXNET3_MSI_OFFSET(s), VMXNET3_MAX_NMSIX_INTRS,
-                   VMXNET3_USE_64BIT, VMXNET3_PER_VECTOR_MASK, NULL);
+                   VMXNET3_USE_64BIT, VMXNET3_PER_VECTOR_MASK, IGNORE_ERRORS);
     /* Any error other than -ENOTSUP(board's MSI support is broken)
      * is a programming error. Fall back to INTx silently on -ENOTSUP */
     assert(!ret || ret == -ENOTSUP);
@@ -2345,7 +2345,7 @@ static void vmxnet3_instance_init(Object *obj)
     VMXNET3State *s = VMXNET3(obj);
     device_add_bootindex_property(obj, &s->conf.bootindex,
                                   "bootindex", "/ethernet-phy@0",
-                                  DEVICE(obj), NULL);
+                                  DEVICE(obj), IGNORE_ERRORS);
 }
 
 static void vmxnet3_pci_uninit(PCIDevice *pci_dev)
diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c
index 316fca9bc1..44da2caf51 100644
--- a/hw/nvram/fw_cfg.c
+++ b/hw/nvram/fw_cfg.c
@@ -917,7 +917,8 @@ static void fw_cfg_init1(DeviceState *dev)
 
     assert(!object_resolve_path(FW_CFG_PATH, NULL));
 
-    object_property_add_child(OBJECT(machine), FW_CFG_NAME, OBJECT(s), NULL);
+    object_property_add_child(OBJECT(machine), FW_CFG_NAME, OBJECT(s),
+                              IGNORE_ERRORS);
 
     qdev_init_nofail(dev);
 
diff --git a/hw/pci-host/gpex.c b/hw/pci-host/gpex.c
index 77f64b4ae7..e069ba03da 100644
--- a/hw/pci-host/gpex.c
+++ b/hw/pci-host/gpex.c
@@ -94,7 +94,7 @@ static void gpex_host_initfn(Object *obj)
     GPEXRootState *root = &s->gpex_root;
 
     object_initialize(root, sizeof(*root), TYPE_GPEX_ROOT_DEVICE);
-    object_property_add_child(obj, "gpex_root", OBJECT(root), NULL);
+    object_property_add_child(obj, "gpex_root", OBJECT(root), IGNORE_ERRORS);
     qdev_prop_set_uint32(DEVICE(root), "addr", PCI_DEVFN(0, 0));
     qdev_prop_set_bit(DEVICE(root), "multifunction", false);
 }
diff --git a/hw/pci-host/piix.c b/hw/pci-host/piix.c
index 4ce201ea65..98f3810cc6 100644
--- a/hw/pci-host/piix.c
+++ b/hw/pci-host/piix.c
@@ -275,19 +275,19 @@ static void i440fx_pcihost_initfn(Object *obj)
 
     object_property_add(obj, PCI_HOST_PROP_PCI_HOLE_START, "int",
                         i440fx_pcihost_get_pci_hole_start,
-                        NULL, NULL, NULL, NULL);
+                        NULL, NULL, NULL, IGNORE_ERRORS);
 
     object_property_add(obj, PCI_HOST_PROP_PCI_HOLE_END, "int",
                         i440fx_pcihost_get_pci_hole_end,
-                        NULL, NULL, NULL, NULL);
+                        NULL, NULL, NULL, IGNORE_ERRORS);
 
     object_property_add(obj, PCI_HOST_PROP_PCI_HOLE64_START, "int",
                         i440fx_pcihost_get_pci_hole64_start,
-                        NULL, NULL, NULL, NULL);
+                        NULL, NULL, NULL, IGNORE_ERRORS);
 
     object_property_add(obj, PCI_HOST_PROP_PCI_HOLE64_END, "int",
                         i440fx_pcihost_get_pci_hole64_end,
-                        NULL, NULL, NULL, NULL);
+                        NULL, NULL, NULL, IGNORE_ERRORS);
 }
 
 static void i440fx_pcihost_realize(DeviceState *dev, Error **errp)
@@ -306,7 +306,7 @@ static void i440fx_realize(PCIDevice *dev, Error **errp)
 {
     dev->config[I440FX_SMRAM] = 0x02;
 
-    if (object_property_get_bool(qdev_get_machine(), "iommu", NULL)) {
+    if (object_property_get_bool(qdev_get_machine(), "iommu", IGNORE_ERRORS)) {
         error_report("warning: i440fx doesn't support emulated iommu");
     }
 }
@@ -337,7 +337,8 @@ PCIBus *i440fx_init(const char *host_type, const char *pci_type,
     b = pci_bus_new(dev, NULL, pci_address_space,
                     address_space_io, 0, TYPE_PCI_BUS);
     s->bus = b;
-    object_property_add_child(qdev_get_machine(), "i440fx", OBJECT(dev), NULL);
+    object_property_add_child(qdev_get_machine(), "i440fx", OBJECT(dev),
+                              IGNORE_ERRORS);
     qdev_init_nofail(dev);
 
     d = pci_create_simple(b, 0, pci_type);
diff --git a/hw/pci-host/prep.c b/hw/pci-host/prep.c
index 900a6edfcf..f3a8afcd9f 100644
--- a/hw/pci-host/prep.c
+++ b/hw/pci-host/prep.c
@@ -290,7 +290,7 @@ static void raven_pcihost_initfn(Object *obj)
     pci_dev = DEVICE(&s->pci_dev);
     qdev_set_parent_bus(pci_dev, BUS(&s->pci_bus));
     object_property_set_int(OBJECT(&s->pci_dev), PCI_DEVFN(0, 0), "addr",
-                            NULL);
+                            IGNORE_ERRORS);
     qdev_prop_set_bit(pci_dev, "multifunction", false);
 }
 
diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c
index cd5c49616e..65eba73939 100644
--- a/hw/pci-host/q35.c
+++ b/hw/pci-host/q35.c
@@ -172,45 +172,50 @@ static void q35_host_initfn(Object *obj)
                           "pci-conf-data", 4);
 
     object_initialize(&s->mch, sizeof(s->mch), TYPE_MCH_PCI_DEVICE);
-    object_property_add_child(OBJECT(s), "mch", OBJECT(&s->mch), NULL);
+    object_property_add_child(OBJECT(s), "mch", OBJECT(&s->mch),
+                              IGNORE_ERRORS);
     qdev_prop_set_uint32(DEVICE(&s->mch), "addr", PCI_DEVFN(0, 0));
     qdev_prop_set_bit(DEVICE(&s->mch), "multifunction", false);
 
     object_property_add(obj, PCI_HOST_PROP_PCI_HOLE_START, "int",
                         q35_host_get_pci_hole_start,
-                        NULL, NULL, NULL, NULL);
+                        NULL, NULL, NULL, IGNORE_ERRORS);
 
     object_property_add(obj, PCI_HOST_PROP_PCI_HOLE_END, "int",
                         q35_host_get_pci_hole_end,
-                        NULL, NULL, NULL, NULL);
+                        NULL, NULL, NULL, IGNORE_ERRORS);
 
     object_property_add(obj, PCI_HOST_PROP_PCI_HOLE64_START, "int",
                         q35_host_get_pci_hole64_start,
-                        NULL, NULL, NULL, NULL);
+                        NULL, NULL, NULL, IGNORE_ERRORS);
 
     object_property_add(obj, PCI_HOST_PROP_PCI_HOLE64_END, "int",
                         q35_host_get_pci_hole64_end,
-                        NULL, NULL, NULL, NULL);
+                        NULL, NULL, NULL, IGNORE_ERRORS);
 
     object_property_add(obj, PCIE_HOST_MCFG_SIZE, "int",
                         q35_host_get_mmcfg_size,
-                        NULL, NULL, NULL, NULL);
+                        NULL, NULL, NULL, IGNORE_ERRORS);
 
     object_property_add_link(obj, MCH_HOST_PROP_RAM_MEM, TYPE_MEMORY_REGION,
                              (Object **) &s->mch.ram_memory,
-                             qdev_prop_allow_set_link_before_realize, 0, NULL);
+                             qdev_prop_allow_set_link_before_realize, 0,
+                             IGNORE_ERRORS);
 
     object_property_add_link(obj, MCH_HOST_PROP_PCI_MEM, TYPE_MEMORY_REGION,
                              (Object **) &s->mch.pci_address_space,
-                             qdev_prop_allow_set_link_before_realize, 0, NULL);
+                             qdev_prop_allow_set_link_before_realize, 0,
+                             IGNORE_ERRORS);
 
     object_property_add_link(obj, MCH_HOST_PROP_SYSTEM_MEM, TYPE_MEMORY_REGION,
                              (Object **) &s->mch.system_memory,
-                             qdev_prop_allow_set_link_before_realize, 0, NULL);
+                             qdev_prop_allow_set_link_before_realize, 0,
+                             IGNORE_ERRORS);
 
     object_property_add_link(obj, MCH_HOST_PROP_IO_MEM, TYPE_MEMORY_REGION,
                              (Object **) &s->mch.address_space_io,
-                             qdev_prop_allow_set_link_before_realize, 0, NULL);
+                             qdev_prop_allow_set_link_before_realize, 0,
+                             IGNORE_ERRORS);
 
     /* Leave enough space for the biggest MCFG BAR */
     /* TODO: this matches current bios behaviour, but
diff --git a/hw/pci-host/xilinx-pcie.c b/hw/pci-host/xilinx-pcie.c
index c7ff5fb277..0cc54f167d 100644
--- a/hw/pci-host/xilinx-pcie.c
+++ b/hw/pci-host/xilinx-pcie.c
@@ -121,7 +121,7 @@ static void xilinx_pcie_host_realize(DeviceState *dev, Error **errp)
     memory_region_set_enabled(&s->mmio, false);
 
     /* dummy I/O region */
-    memory_region_init_ram(&s->io, OBJECT(s), "io", 16, NULL);
+    memory_region_init_ram(&s->io, OBJECT(s), "io", 16, IGNORE_ERRORS);
     memory_region_set_enabled(&s->io, false);
 
     /* interrupt out */
@@ -150,7 +150,7 @@ static void xilinx_pcie_host_init(Object *obj)
     XilinxPCIERoot *root = &s->root;
 
     object_initialize(root, sizeof(*root), TYPE_XILINX_PCIE_ROOT);
-    object_property_add_child(obj, "root", OBJECT(root), NULL);
+    object_property_add_child(obj, "root", OBJECT(root), IGNORE_ERRORS);
     qdev_prop_set_uint32(DEVICE(root), "addr", PCI_DEVFN(0, 0));
     qdev_prop_set_bit(DEVICE(root), "multifunction", false);
 }
diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index 84d63728e1..a848d1508b 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -2018,7 +2018,7 @@ static void pci_qdev_realize(DeviceState *qdev, Error **errp)
     pci_add_option_rom(pci_dev, is_default_rom, &local_err);
     if (local_err) {
         error_propagate(errp, local_err);
-        pci_qdev_unrealize(DEVICE(pci_dev), NULL);
+        pci_qdev_unrealize(DEVICE(pci_dev), IGNORE_ERRORS);
         return;
     }
 }
diff --git a/hw/pci/pcie.c b/hw/pci/pcie.c
index 18e634f577..15bd92086c 100644
--- a/hw/pci/pcie.c
+++ b/hw/pci/pcie.c
@@ -427,7 +427,7 @@ void pcie_cap_slot_init(PCIDevice *dev, uint16_t slot)
     dev->exp.hpev_notified = false;
 
     qbus_set_hotplug_handler(BUS(pci_bridge_get_sec_bus(PCI_BRIDGE(dev))),
-                             DEVICE(dev), NULL);
+                             DEVICE(dev), IGNORE_ERRORS);
 }
 
 void pcie_cap_slot_reset(PCIDevice *dev)
diff --git a/hw/pci/shpc.c b/hw/pci/shpc.c
index 42fafac91b..844bc97737 100644
--- a/hw/pci/shpc.c
+++ b/hw/pci/shpc.c
@@ -646,7 +646,7 @@ int shpc_init(PCIDevice *d, PCIBus *sec_bus, MemoryRegion *bar, unsigned offset)
     shpc_cap_update_dword(d);
     memory_region_add_subregion(bar, offset, &shpc->mmio);
 
-    qbus_set_hotplug_handler(BUS(sec_bus), DEVICE(d), NULL);
+    qbus_set_hotplug_handler(BUS(sec_bus), DEVICE(d), IGNORE_ERRORS);
 
     d->cap_present |= QEMU_PCI_CAP_SHPC;
     return 0;
diff --git a/hw/pcmcia/pxa2xx.c b/hw/pcmcia/pxa2xx.c
index 5833358f87..efa8bbf8ab 100644
--- a/hw/pcmcia/pxa2xx.c
+++ b/hw/pcmcia/pxa2xx.c
@@ -189,7 +189,7 @@ static void pxa2xx_pcmcia_initfn(Object *obj)
     object_property_add_link(obj, "card", TYPE_PCMCIA_CARD,
                              (Object **)&s->card,
                              NULL, /* read-only property */
-                             0, NULL);
+                             0, IGNORE_ERRORS);
 }
 
 /* Insert a new card into a slot */
diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c
index 62f1857206..04621d5534 100644
--- a/hw/ppc/e500.c
+++ b/hw/ppc/e500.c
@@ -872,7 +872,7 @@ void ppce500_init(MachineState *machine, PPCE500Params *params)
 
     dev = qdev_create(NULL, "e500-ccsr");
     object_property_add_child(qdev_get_machine(), "e500-ccsr",
-                              OBJECT(dev), NULL);
+                              OBJECT(dev), IGNORE_ERRORS);
     qdev_init_nofail(dev);
     ccsr = CCSR(dev);
     ccsr_addr_space = &ccsr->ccsr_space;
diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c
index 89b6801f67..655f1da14c 100644
--- a/hw/ppc/pnv.c
+++ b/hw/ppc/pnv.c
@@ -833,15 +833,15 @@ static void pnv_chip_init(Object *obj)
     chip->xscom_base = pcc->xscom_base;
 
     object_initialize(&chip->lpc, sizeof(chip->lpc), TYPE_PNV_LPC);
-    object_property_add_child(obj, "lpc", OBJECT(&chip->lpc), NULL);
+    object_property_add_child(obj, "lpc", OBJECT(&chip->lpc), IGNORE_ERRORS);
 
     object_initialize(&chip->psi, sizeof(chip->psi), TYPE_PNV_PSI);
-    object_property_add_child(obj, "psi", OBJECT(&chip->psi), NULL);
+    object_property_add_child(obj, "psi", OBJECT(&chip->psi), IGNORE_ERRORS);
     object_property_add_const_link(OBJECT(&chip->psi), "xics",
                                    OBJECT(qdev_get_machine()), &error_abort);
 
     object_initialize(&chip->occ, sizeof(chip->occ), TYPE_PNV_OCC);
-    object_property_add_child(obj, "occ", OBJECT(&chip->occ), NULL);
+    object_property_add_child(obj, "occ", OBJECT(&chip->occ), IGNORE_ERRORS);
     object_property_add_const_link(OBJECT(&chip->occ), "psi",
                                    OBJECT(&chip->psi), &error_abort);
 
@@ -1113,10 +1113,10 @@ static void powernv_machine_class_props_init(ObjectClass *oc)
 {
     object_class_property_add(oc, "num-chips", "uint32_t",
                               pnv_get_num_chips, pnv_set_num_chips,
-                              NULL, NULL, NULL);
+                              NULL, NULL, IGNORE_ERRORS);
     object_class_property_set_description(oc, "num-chips",
                               "Specifies the number of processor chips",
-                              NULL);
+                              IGNORE_ERRORS);
 }
 
 static void powernv_machine_class_init(ObjectClass *oc, void *data)
diff --git a/hw/ppc/pnv_core.c b/hw/ppc/pnv_core.c
index 1b7ec70f03..161f7dbc62 100644
--- a/hw/ppc/pnv_core.c
+++ b/hw/ppc/pnv_core.c
@@ -119,7 +119,7 @@ static void pnv_core_realize_child(Object *child, XICSFabric *xi, Error **errp)
     Object *obj;
 
     obj = object_new(TYPE_PNV_ICP);
-    object_property_add_child(OBJECT(cpu), "icp", obj, NULL);
+    object_property_add_child(OBJECT(cpu), "icp", obj, IGNORE_ERRORS);
     object_property_add_const_link(obj, "xics", OBJECT(xi), &error_abort);
     object_property_set_bool(obj, true, "realized", &local_err);
     if (local_err) {
diff --git a/hw/ppc/pnv_psi.c b/hw/ppc/pnv_psi.c
index 2bf5bfe3fd..5dd697bdb4 100644
--- a/hw/ppc/pnv_psi.c
+++ b/hw/ppc/pnv_psi.c
@@ -446,7 +446,8 @@ static void pnv_psi_init(Object *obj)
     PnvPsi *psi = PNV_PSI(obj);
 
     object_initialize(&psi->ics, sizeof(psi->ics), TYPE_ICS_SIMPLE);
-    object_property_add_child(obj, "ics-psi", OBJECT(&psi->ics), NULL);
+    object_property_add_child(obj, "ics-psi", OBJECT(&psi->ics),
+                              IGNORE_ERRORS);
 }
 
 static const uint8_t irq_to_xivr[] = {
diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c
index a917be6ca3..bc7b2fd287 100644
--- a/hw/ppc/prep.c
+++ b/hw/ppc/prep.c
@@ -598,7 +598,8 @@ static void ppc_prep_init(MachineState *machine)
     qdev_prop_set_string(dev, "bios-name", bios_name);
     qdev_prop_set_uint32(dev, "elf-machine", PPC_ELF_MACHINE);
     pcihost = PCI_HOST_BRIDGE(dev);
-    object_property_add_child(qdev_get_machine(), "raven", OBJECT(dev), NULL);
+    object_property_add_child(qdev_get_machine(), "raven", OBJECT(dev),
+                              IGNORE_ERRORS);
     qdev_init_nofail(dev);
     pci_bus = (PCIBus *)qdev_get_child_bus(dev, "pci.0");
     if (pci_bus == NULL) {
@@ -755,7 +756,8 @@ static void ibm_40p_init(MachineState *machine)
     qdev_prop_set_string(dev, "bios-name", bios_name);
     qdev_prop_set_uint32(dev, "elf-machine", PPC_ELF_MACHINE);
     pcihost = SYS_BUS_DEVICE(dev);
-    object_property_add_child(qdev_get_machine(), "raven", OBJECT(dev), NULL);
+    object_property_add_child(qdev_get_machine(), "raven", OBJECT(dev),
+                              IGNORE_ERRORS);
     qdev_init_nofail(dev);
     pci_bus = PCI_BUS(qdev_get_child_bus(dev, "pci.0"));
     if (!pci_bus) {
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 91b4057933..e07fd88a55 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -659,7 +659,7 @@ static int spapr_populate_drconf_memory(sPAPRMachineState *spapr, void *fdt)
             dynamic_memory[1] = cpu_to_be32(addr & 0xffffffff);
             dynamic_memory[2] = cpu_to_be32(spapr_drc_index(drc));
             dynamic_memory[3] = cpu_to_be32(0); /* reserved */
-            dynamic_memory[4] = cpu_to_be32(numa_get_node(addr, NULL));
+            dynamic_memory[4] = cpu_to_be32(numa_get_node(addr, IGNORE_ERRORS));
             if (memory_region_present(get_system_memory(), addr)) {
                 dynamic_memory[5] = cpu_to_be32(SPAPR_LMB_FLAGS_ASSIGNED);
             } else {
@@ -2481,19 +2481,20 @@ static void spapr_machine_initfn(Object *obj)
     spapr->htab_fd = -1;
     spapr->use_hotplug_event_source = true;
     object_property_add_str(obj, "kvm-type",
-                            spapr_get_kvm_type, spapr_set_kvm_type, NULL);
+                            spapr_get_kvm_type, spapr_set_kvm_type,
+                            IGNORE_ERRORS);
     object_property_set_description(obj, "kvm-type",
                                     "Specifies the KVM virtualization mode (HV, PR)",
-                                    NULL);
+                                    IGNORE_ERRORS);
     object_property_add_bool(obj, "modern-hotplug-events",
                             spapr_get_modern_hotplug_events,
                             spapr_set_modern_hotplug_events,
-                            NULL);
+                            IGNORE_ERRORS);
     object_property_set_description(obj, "modern-hotplug-events",
                                     "Use dedicated hotplug event mechanism in"
                                     " place of standard EPOW events when possible"
                                     " (required for memory hot-unplug support)",
-                                    NULL);
+                                    IGNORE_ERRORS);
 }
 
 static void spapr_machine_finalizefn(Object *obj)
@@ -2611,7 +2612,8 @@ static void spapr_memory_pre_plug(HotplugHandler *hotplug_dev, DeviceState *dev,
         return;
     }
 
-    mem_dev = object_property_get_str(OBJECT(dimm), PC_DIMM_MEMDEV_PROP, NULL);
+    mem_dev = object_property_get_str(OBJECT(dimm), PC_DIMM_MEMDEV_PROP,
+                                      IGNORE_ERRORS);
     if (mem_dev && !kvmppc_is_mem_backend_page_size_ok(mem_dev)) {
         error_setg(errp, "Memory backend has bad page size. "
                    "Use 'memory-backend-file' with correct mem-path.");
diff --git a/hw/ppc/spapr_drc.c b/hw/ppc/spapr_drc.c
index 39e7f3080a..d7d0c0ee8e 100644
--- a/hw/ppc/spapr_drc.c
+++ b/hw/ppc/spapr_drc.c
@@ -360,7 +360,7 @@ static void attach(sPAPRDRConnector *drc, DeviceState *d, void *fdt,
     object_property_add_link(OBJECT(drc), "device",
                              object_get_typename(OBJECT(drc->dev)),
                              (Object **)(&drc->dev),
-                             NULL, 0, NULL);
+                             NULL, 0, IGNORE_ERRORS);
 }
 
 static void detach(sPAPRDRConnector *drc, DeviceState *d, Error **errp)
@@ -432,7 +432,7 @@ static void detach(sPAPRDRConnector *drc, DeviceState *d, Error **errp)
     g_free(drc->fdt);
     drc->fdt = NULL;
     drc->fdt_start_offset = 0;
-    object_property_del(OBJECT(drc), "device", NULL);
+    object_property_del(OBJECT(drc), "device", IGNORE_ERRORS);
     drc->dev = NULL;
 }
 
@@ -592,8 +592,8 @@ sPAPRDRConnector *spapr_dr_connector_new(Object *owner, const char *type,
     drc->owner = owner;
     prop_name = g_strdup_printf("dr-connector[%"PRIu32"]",
                                 spapr_drc_index(drc));
-    object_property_add_child(owner, prop_name, OBJECT(drc), NULL);
-    object_property_set_bool(OBJECT(drc), true, "realized", NULL);
+    object_property_add_child(owner, prop_name, OBJECT(drc), IGNORE_ERRORS);
+    object_property_set_bool(OBJECT(drc), true, "realized", IGNORE_ERRORS);
     g_free(prop_name);
 
     /* human-readable name for a DRC to encode into the DT
@@ -647,12 +647,12 @@ static void spapr_dr_connector_instance_init(Object *obj)
 {
     sPAPRDRConnector *drc = SPAPR_DR_CONNECTOR(obj);
 
-    object_property_add_uint32_ptr(obj, "id", &drc->id, NULL);
+    object_property_add_uint32_ptr(obj, "id", &drc->id, IGNORE_ERRORS);
     object_property_add(obj, "index", "uint32", prop_get_index,
-                        NULL, NULL, NULL, NULL);
-    object_property_add_str(obj, "name", prop_get_name, NULL, NULL);
+                        NULL, NULL, NULL, IGNORE_ERRORS);
+    object_property_add_str(obj, "name", prop_get_name, NULL, IGNORE_ERRORS);
     object_property_add(obj, "fdt", "struct", prop_get_fdt,
-                        NULL, NULL, NULL, NULL);
+                        NULL, NULL, NULL, IGNORE_ERRORS);
 }
 
 static void spapr_dr_connector_class_init(ObjectClass *k, void *data)
@@ -823,7 +823,8 @@ int spapr_drc_populate_dt(void *fdt, int fdt_offset, Object *owner,
             continue;
         }
 
-        obj = object_property_get_link(root_container, prop->name, NULL);
+        obj = object_property_get_link(root_container, prop->name,
+                                       IGNORE_ERRORS);
         drc = SPAPR_DR_CONNECTOR(obj);
         drck = SPAPR_DR_CONNECTOR_GET_CLASS(drc);
 
diff --git a/hw/ppc/spapr_iommu.c b/hw/ppc/spapr_iommu.c
index d587772b9c..bee492de12 100644
--- a/hw/ppc/spapr_iommu.c
+++ b/hw/ppc/spapr_iommu.c
@@ -323,9 +323,9 @@ sPAPRTCETable *spapr_tce_new_table(DeviceState *owner, uint32_t liobn)
     tcet->liobn = liobn;
 
     snprintf(tmp, sizeof(tmp), "tce-table-%x", liobn);
-    object_property_add_child(OBJECT(owner), tmp, OBJECT(tcet), NULL);
+    object_property_add_child(OBJECT(owner), tmp, OBJECT(tcet), IGNORE_ERRORS);
 
-    object_property_set_bool(OBJECT(tcet), true, "realized", NULL);
+    object_property_set_bool(OBJECT(tcet), true, "realized", IGNORE_ERRORS);
 
     return tcet;
 }
diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
index 0c181bbca5..b0c58ad3f1 100644
--- a/hw/ppc/spapr_pci.c
+++ b/hw/ppc/spapr_pci.c
@@ -760,7 +760,7 @@ static char *spapr_phb_vfio_get_loc_code(sPAPRPHBState *sphb,  PCIDevice *pdev)
     char *path = NULL, *buf = NULL, *host = NULL;
 
     /* Get the PCI VFIO host id */
-    host = object_property_get_str(OBJECT(pdev), "host", NULL);
+    host = object_property_get_str(OBJECT(pdev), "host", IGNORE_ERRORS);
     if (!host) {
         goto err_out;
     }
@@ -1697,7 +1697,7 @@ static void spapr_phb_realize(DeviceState *dev, Error **errp)
                            &sphb->memspace, &sphb->iospace,
                            PCI_DEVFN(0, 0), PCI_NUM_PINS, TYPE_PCI_BUS);
     phb->bus = bus;
-    qbus_set_hotplug_handler(BUS(phb->bus), DEVICE(sphb), NULL);
+    qbus_set_hotplug_handler(BUS(phb->bus), DEVICE(sphb), IGNORE_ERRORS);
 
     /*
      * Initialize PHB address space.
diff --git a/hw/ppc/spapr_rng.c b/hw/ppc/spapr_rng.c
index 80515eb54d..1d0968358e 100644
--- a/hw/ppc/spapr_rng.c
+++ b/hw/ppc/spapr_rng.c
@@ -106,10 +106,10 @@ static void spapr_rng_instance_init(Object *obj)
     object_property_add_link(obj, "rng", TYPE_RNG_BACKEND,
                              (Object **)&rngstate->backend,
                              object_property_allow_set_link,
-                             OBJ_PROP_LINK_UNREF_ON_RELEASE, NULL);
+                             OBJ_PROP_LINK_UNREF_ON_RELEASE, IGNORE_ERRORS);
     object_property_set_description(obj, "rng",
                                     "ID of the random number generator backend",
-                                    NULL);
+                                    IGNORE_ERRORS);
 }
 
 static void spapr_rng_realize(DeviceState *dev, Error **errp)
diff --git a/hw/ppc/spapr_rtc.c b/hw/ppc/spapr_rtc.c
index 7e250dcbaf..5f4489ac1b 100644
--- a/hw/ppc/spapr_rtc.c
+++ b/hw/ppc/spapr_rtc.c
@@ -146,7 +146,8 @@ static void spapr_rtc_realize(DeviceState *dev, Error **errp)
     rtc_ns = qemu_clock_get_ns(rtc_clock);
     rtc->ns_offset = host_s * NANOSECONDS_PER_SECOND - rtc_ns;
 
-    object_property_add_tm(OBJECT(rtc), "date", spapr_rtc_qom_date, NULL);
+    object_property_add_tm(OBJECT(rtc), "date", spapr_rtc_qom_date,
+                           IGNORE_ERRORS);
 }
 
 static const VMStateDescription vmstate_spapr_rtc = {
diff --git a/hw/s390x/event-facility.c b/hw/s390x/event-facility.c
index 34b2faf013..2f2bf8b45d 100644
--- a/hw/s390x/event-facility.c
+++ b/hw/s390x/event-facility.c
@@ -354,12 +354,12 @@ static void init_event_facility(Object *obj)
                         TYPE_SCLP_EVENTS_BUS, sdev, NULL);
 
     new = object_new(TYPE_SCLP_QUIESCE);
-    object_property_add_child(obj, TYPE_SCLP_QUIESCE, new, NULL);
+    object_property_add_child(obj, TYPE_SCLP_QUIESCE, new, IGNORE_ERRORS);
     object_unref(new);
     qdev_set_parent_bus(DEVICE(new), &event_facility->sbus.qbus);
 
     new = object_new(TYPE_SCLP_CPU_HOTPLUG);
-    object_property_add_child(obj, TYPE_SCLP_CPU_HOTPLUG, new, NULL);
+    object_property_add_child(obj, TYPE_SCLP_CPU_HOTPLUG, new, IGNORE_ERRORS);
     object_unref(new);
     qdev_set_parent_bus(DEVICE(new), &event_facility->sbus.qbus);
     /* the facility will automatically realize the devices via the bus */
diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c
index 4e6469db0f..1a9fd04692 100644
--- a/hw/s390x/ipl.c
+++ b/hw/s390x/ipl.c
@@ -282,7 +282,8 @@ static bool s390_gen_initial_iplb(S390IPLState *ipl)
 int s390_ipl_set_loadparm(uint8_t *loadparm)
 {
     MachineState *machine = MACHINE(qdev_get_machine());
-    char *lp = object_property_get_str(OBJECT(machine), "loadparm", NULL);
+    char *lp = object_property_get_str(OBJECT(machine), "loadparm",
+                                       IGNORE_ERRORS);
 
     if (lp) {
         int i;
diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c
index 5651483781..aa4d7f5aa4 100644
--- a/hw/s390x/s390-pci-bus.c
+++ b/hw/s390x/s390-pci-bus.c
@@ -189,7 +189,7 @@ void s390_pci_sclp_deconfigure(SCCB *sccb)
         rc = SCLP_RC_NORMAL_COMPLETION;
 
         if (pbdev->release_timer) {
-            qdev_unplug(DEVICE(pbdev->pdev), NULL);
+            qdev_unplug(DEVICE(pbdev->pdev), IGNORE_ERRORS);
         }
     }
 out:
@@ -569,11 +569,11 @@ static int s390_pcihost_init(SysBusDevice *dev)
     pci_setup_iommu(b, s390_pci_dma_iommu, s);
 
     bus = BUS(b);
-    qbus_set_hotplug_handler(bus, DEVICE(dev), NULL);
+    qbus_set_hotplug_handler(bus, DEVICE(dev), IGNORE_ERRORS);
     phb->bus = b;
 
     s->bus = S390_PCI_BUS(qbus_create(TYPE_S390_PCI_BUS, DEVICE(s), NULL));
-    qbus_set_hotplug_handler(BUS(s->bus), DEVICE(s), NULL);
+    qbus_set_hotplug_handler(BUS(s->bus), DEVICE(s), IGNORE_ERRORS);
 
     s->iommu_table = g_hash_table_new_full(g_int64_hash, g_int64_equal,
                                            NULL, g_free);
@@ -761,7 +761,7 @@ static void s390_pcihost_timer_cb(void *opaque)
     pbdev->state = ZPCI_FS_STANDBY;
     s390_pci_generate_plug_event(HP_EVENT_CONFIGURED_TO_STBRES,
                                  pbdev->fh, pbdev->fid);
-    qdev_unplug(DEVICE(pbdev), NULL);
+    qdev_unplug(DEVICE(pbdev), IGNORE_ERRORS);
 }
 
 static void s390_pcihost_hot_unplug(HotplugHandler *hotplug_dev,
diff --git a/hw/s390x/s390-skeys.c b/hw/s390x/s390-skeys.c
index 2db2f9c8a8..251882a9dc 100644
--- a/hw/s390x/s390-skeys.c
+++ b/hw/s390x/s390-skeys.c
@@ -41,7 +41,7 @@ void s390_skeys_init(void)
         obj = object_new(TYPE_QEMU_S390_SKEYS);
     }
     object_property_add_child(qdev_get_machine(), TYPE_S390_SKEYS,
-                              obj, NULL);
+                              obj, IGNORE_ERRORS);
     object_unref(obj);
 
     qdev_init_nofail(DEVICE(obj));
@@ -392,8 +392,8 @@ static void s390_skeys_instance_init(Object *obj)
 {
     object_property_add_bool(obj, "migration-enabled",
                              s390_skeys_get_migration_enabled,
-                             s390_skeys_set_migration_enabled, NULL);
-    object_property_set_bool(obj, true, "migration-enabled", NULL);
+                             s390_skeys_set_migration_enabled, IGNORE_ERRORS);
+    object_property_set_bool(obj, true, "migration-enabled", IGNORE_ERRORS);
 }
 
 static void s390_skeys_class_init(ObjectClass *oc, void *data)
diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
index a806345276..ae81723914 100644
--- a/hw/s390x/s390-virtio-ccw.c
+++ b/hw/s390x/s390-virtio-ccw.c
@@ -128,7 +128,7 @@ static void ccw_init(MachineState *machine)
 
     dev = qdev_create(NULL, TYPE_S390_PCI_HOST_BRIDGE);
     object_property_add_child(qdev_get_machine(), TYPE_S390_PCI_HOST_BRIDGE,
-                              OBJECT(dev), NULL);
+                              OBJECT(dev), IGNORE_ERRORS);
     qdev_init_nofail(dev);
 
     /* register hypercalls */
@@ -331,33 +331,33 @@ static inline void s390_machine_initfn(Object *obj)
 {
     object_property_add_bool(obj, "aes-key-wrap",
                              machine_get_aes_key_wrap,
-                             machine_set_aes_key_wrap, NULL);
+                             machine_set_aes_key_wrap, IGNORE_ERRORS);
     object_property_set_description(obj, "aes-key-wrap",
             "enable/disable AES key wrapping using the CPACF wrapping key",
-            NULL);
-    object_property_set_bool(obj, true, "aes-key-wrap", NULL);
+            IGNORE_ERRORS);
+    object_property_set_bool(obj, true, "aes-key-wrap", IGNORE_ERRORS);
 
     object_property_add_bool(obj, "dea-key-wrap",
                              machine_get_dea_key_wrap,
-                             machine_set_dea_key_wrap, NULL);
+                             machine_set_dea_key_wrap, IGNORE_ERRORS);
     object_property_set_description(obj, "dea-key-wrap",
             "enable/disable DEA key wrapping using the CPACF wrapping key",
-            NULL);
-    object_property_set_bool(obj, true, "dea-key-wrap", NULL);
+            IGNORE_ERRORS);
+    object_property_set_bool(obj, true, "dea-key-wrap", IGNORE_ERRORS);
     object_property_add_str(obj, "loadparm",
-            machine_get_loadparm, machine_set_loadparm, NULL);
+            machine_get_loadparm, machine_set_loadparm, IGNORE_ERRORS);
     object_property_set_description(obj, "loadparm",
             "Up to 8 chars in set of [A-Za-z0-9. ] (lower case chars converted"
             " to upper case) to pass to machine loader, boot manager,"
             " and guest kernel",
-            NULL);
+            IGNORE_ERRORS);
     object_property_add_bool(obj, "s390-squash-mcss",
                              machine_get_squash_mcss,
-                             machine_set_squash_mcss, NULL);
+                             machine_set_squash_mcss, IGNORE_ERRORS);
     object_property_set_description(obj, "s390-squash-mcss",
             "enable/disable squashing subchannels into the default css",
-            NULL);
-    object_property_set_bool(obj, false, "s390-squash-mcss", NULL);
+            IGNORE_ERRORS);
+    object_property_set_bool(obj, false, "s390-squash-mcss", IGNORE_ERRORS);
 }
 
 static const TypeInfo ccw_machine_info = {
diff --git a/hw/s390x/s390-virtio.c b/hw/s390x/s390-virtio.c
index afa4148e6b..79a1fa3b49 100644
--- a/hw/s390x/s390-virtio.c
+++ b/hw/s390x/s390-virtio.c
@@ -82,7 +82,7 @@ void s390_init_ipl_dev(const char *kernel_filename,
     qdev_prop_set_string(dev, "netboot_fw", netboot_fw);
     qdev_prop_set_bit(dev, "enforce_bios", enforce_bios);
     object_property_add_child(qdev_get_machine(), TYPE_S390_IPL,
-                              new, NULL);
+                              new, IGNORE_ERRORS);
     object_unref(new);
     qdev_init_nofail(dev);
 }
diff --git a/hw/s390x/sclp.c b/hw/s390x/sclp.c
index 83d6023894..1bd6b568f4 100644
--- a/hw/s390x/sclp.c
+++ b/hw/s390x/sclp.c
@@ -478,7 +478,7 @@ void s390_sclp_init(void)
     Object *new = object_new(TYPE_SCLP);
 
     object_property_add_child(qdev_get_machine(), TYPE_SCLP, new,
-                              NULL);
+                              IGNORE_ERRORS);
     object_unref(OBJECT(new));
     qdev_init_nofail(DEVICE(new));
 }
@@ -569,7 +569,8 @@ static void sclp_init(Object *obj)
     Object *new;
 
     new = object_new(TYPE_SCLP_EVENT_FACILITY);
-    object_property_add_child(obj, TYPE_SCLP_EVENT_FACILITY, new, NULL);
+    object_property_add_child(obj, TYPE_SCLP_EVENT_FACILITY, new,
+                              IGNORE_ERRORS);
     object_unref(new);
     sclp->event_facility = EVENT_FACILITY(new);
 
@@ -612,7 +613,7 @@ sclpMemoryHotplugDev *init_sclp_memory_hotplug_dev(void)
     dev = qdev_create(NULL, TYPE_SCLP_MEMORY_HOTPLUG_DEV);
     object_property_add_child(qdev_get_machine(),
                               TYPE_SCLP_MEMORY_HOTPLUG_DEV,
-                              OBJECT(dev), NULL);
+                              OBJECT(dev), IGNORE_ERRORS);
     qdev_init_nofail(dev);
     return SCLP_MEMORY_HOTPLUG_DEV(object_resolve_path(
                                    TYPE_SCLP_MEMORY_HOTPLUG_DEV, NULL));
diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c
index e6a6f74be3..9c56e17196 100644
--- a/hw/s390x/virtio-ccw.c
+++ b/hw/s390x/virtio-ccw.c
@@ -912,7 +912,7 @@ static void virtio_ccw_rng_realize(VirtioCcwDevice *ccw_dev, Error **errp)
 
     object_property_set_link(OBJECT(dev),
                              OBJECT(dev->vdev.conf.rng), "rng",
-                             NULL);
+                             IGNORE_ERRORS);
 }
 
 static void virtio_ccw_crypto_realize(VirtioCcwDevice *ccw_dev, Error **errp)
@@ -930,7 +930,7 @@ static void virtio_ccw_crypto_realize(VirtioCcwDevice *ccw_dev, Error **errp)
 
     object_property_set_link(OBJECT(vdev),
                              OBJECT(dev->vdev.conf.cryptodev), "cryptodev",
-                             NULL);
+                             IGNORE_ERRORS);
 }
 
 /* DeviceState to VirtioCcwDevice. Note: used on datapath,
diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c
index 804122ab05..e5a3e20a69 100644
--- a/hw/scsi/megasas.c
+++ b/hw/scsi/megasas.c
@@ -2366,7 +2366,7 @@ static void megasas_scsi_realize(PCIDevice *dev, Error **errp)
 
     if (megasas_use_msix(s) &&
         msix_init(dev, 15, &s->mmio_io, b->mmio_bar, 0x2000,
-                  &s->mmio_io, b->mmio_bar, 0x3800, 0x68, NULL)) {
+                  &s->mmio_io, b->mmio_bar, 0x3800, 0x68, IGNORE_ERRORS)) {
         /* TODO: check msix_init's error, and should fail on msix=on */
         s->msix = ON_OFF_AUTO_OFF;
     }
diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c
index f5574469c8..796ae562bf 100644
--- a/hw/scsi/scsi-bus.c
+++ b/hw/scsi/scsi-bus.c
@@ -234,7 +234,7 @@ SCSIDevice *scsi_bus_legacy_add_drive(SCSIBus *bus, BlockBackend *blk,
     driver = blk_is_sg(blk) ? "scsi-generic" : "scsi-disk";
     dev = qdev_create(&bus->qbus, driver);
     name = g_strdup_printf("legacy[%d]", unit);
-    object_property_add_child(OBJECT(bus), name, OBJECT(dev), NULL);
+    object_property_add_child(OBJECT(bus), name, OBJECT(dev), IGNORE_ERRORS);
     g_free(name);
 
     qdev_prop_set_uint32(dev, "scsi-id", unit);
@@ -242,10 +242,10 @@ SCSIDevice *scsi_bus_legacy_add_drive(SCSIBus *bus, BlockBackend *blk,
         object_property_set_int(OBJECT(dev), bootindex, "bootindex",
                                 &error_abort);
     }
-    if (object_property_find(OBJECT(dev), "removable", NULL)) {
+    if (object_property_find(OBJECT(dev), "removable", IGNORE_ERRORS)) {
         qdev_prop_set_bit(dev, "removable", removable);
     }
-    if (serial && object_property_find(OBJECT(dev), "serial", NULL)) {
+    if (serial && object_property_find(OBJECT(dev), "serial", IGNORE_ERRORS)) {
         qdev_prop_set_string(dev, "serial", serial);
     }
     qdev_prop_set_drive(dev, "drive", blk, &err);
@@ -2127,7 +2127,7 @@ static void scsi_dev_instance_init(Object *obj)
 
     device_add_bootindex_property(obj, &s->conf.bootindex,
                                   "bootindex", NULL,
-                                  &s->qdev, NULL);
+                                  &s->qdev, IGNORE_ERRORS);
 }
 
 static const TypeInfo scsi_device_type_info = {
diff --git a/hw/scsi/vhost-scsi.c b/hw/scsi/vhost-scsi.c
index cd4ab05233..c44d1045b6 100644
--- a/hw/scsi/vhost-scsi.c
+++ b/hw/scsi/vhost-scsi.c
@@ -262,7 +262,7 @@ static void vhost_scsi_instance_init(Object *obj)
     vsc->feature_bits = kernel_feature_bits;
 
     device_add_bootindex_property(obj, &vsc->bootindex, "bootindex", NULL,
-                                  DEVICE(vsc), NULL);
+                                  DEVICE(vsc), IGNORE_ERRORS);
 }
 
 static const TypeInfo vhost_scsi_info = {
diff --git a/hw/scsi/vmw_pvscsi.c b/hw/scsi/vmw_pvscsi.c
index 4a106da856..e5133595dc 100644
--- a/hw/scsi/vmw_pvscsi.c
+++ b/hw/scsi/vmw_pvscsi.c
@@ -1065,7 +1065,7 @@ pvscsi_init_msi(PVSCSIState *s)
     PCIDevice *d = PCI_DEVICE(s);
 
     res = msi_init(d, PVSCSI_MSI_OFFSET(s), PVSCSI_MSIX_NUM_VECTORS,
-                   PVSCSI_USE_64BIT, PVSCSI_PER_VECTOR_MASK, NULL);
+                   PVSCSI_USE_64BIT, PVSCSI_PER_VECTOR_MASK, IGNORE_ERRORS);
     if (res < 0) {
         trace_pvscsi_init_msi_fail(res);
         s->msi_used = false;
diff --git a/hw/timer/mc146818rtc.c b/hw/timer/mc146818rtc.c
index 4c1986b97f..b7b9e0f754 100644
--- a/hw/timer/mc146818rtc.c
+++ b/hw/timer/mc146818rtc.c
@@ -989,10 +989,10 @@ static void rtc_realizefn(DeviceState *dev, Error **errp)
     qdev_set_legacy_instance_id(dev, base, 3);
     qemu_register_reset(rtc_reset, s);
 
-    object_property_add_tm(OBJECT(s), "date", rtc_get_date, NULL);
+    object_property_add_tm(OBJECT(s), "date", rtc_get_date, IGNORE_ERRORS);
 
     object_property_add_alias(qdev_get_machine(), "rtc-time",
-                              OBJECT(s), "date", NULL);
+                              OBJECT(s), "date", IGNORE_ERRORS);
 
     qdev_init_gpio_out(dev, &s->irq, 1);
 }
@@ -1050,7 +1050,7 @@ static void rtc_class_initfn(ObjectClass *klass, void *data)
 
 static void rtc_finalize(Object *obj)
 {
-    object_property_del(qdev_get_machine(), "rtc", NULL);
+    object_property_del(qdev_get_machine(), "rtc", IGNORE_ERRORS);
 }
 
 static const TypeInfo mc146818rtc_info = {
diff --git a/hw/usb/bus.c b/hw/usb/bus.c
index 5939b273b9..c25247e3cb 100644
--- a/hw/usb/bus.c
+++ b/hw/usb/bus.c
@@ -270,7 +270,7 @@ static void usb_qdev_realize(DeviceState *qdev, Error **errp)
     if (dev->auto_attach) {
         usb_device_attach(dev, &local_err);
         if (local_err) {
-            usb_qdev_unrealize(qdev, NULL);
+            usb_qdev_unrealize(qdev, IGNORE_ERRORS);
             error_propagate(errp, local_err);
             return;
         }
@@ -446,7 +446,7 @@ void usb_claim_port(USBDevice *dev, Error **errp)
     } else {
         if (bus->nfree == 1 && strcmp(object_get_typename(OBJECT(dev)), "usb-hub") != 0) {
             /* Create a new hub and chain it on */
-            usb_try_create_simple(bus, "usb-hub", NULL);
+            usb_try_create_simple(bus, "usb-hub", IGNORE_ERRORS);
         }
         if (bus->nfree == 0) {
             error_setg(errp, "tried to attach usb device %s to a bus "
@@ -776,11 +776,11 @@ static void usb_device_instance_init(Object *obj)
     if (klass->attached_settable) {
         object_property_add_bool(obj, "attached",
                                  usb_get_attached, usb_set_attached,
-                                 NULL);
+                                 IGNORE_ERRORS);
     } else {
         object_property_add_bool(obj, "attached",
                                  usb_get_attached, NULL,
-                                 NULL);
+                                 IGNORE_ERRORS);
     }
 }
 
diff --git a/hw/usb/dev-hid.c b/hw/usb/dev-hid.c
index c40019df96..5b31791392 100644
--- a/hw/usb/dev-hid.c
+++ b/hw/usb/dev-hid.c
@@ -725,7 +725,8 @@ static void usb_hid_initfn(USBDevice *dev, int kind,
     us->intr = usb_ep_get(dev, USB_TOKEN_IN, 1);
     hid_init(&us->hid, kind, usb_hid_changed);
     if (us->display && us->hid.s) {
-        qemu_input_handler_bind(us->hid.s, us->display, us->head, NULL);
+        qemu_input_handler_bind(us->hid.s, us->display, us->head,
+                                IGNORE_ERRORS);
     }
 }
 
diff --git a/hw/usb/dev-network.c b/hw/usb/dev-network.c
index 85fc81bf43..4c2536ed8c 100644
--- a/hw/usb/dev-network.c
+++ b/hw/usb/dev-network.c
@@ -1379,7 +1379,7 @@ static void usb_net_instance_init(Object *obj)
 
     device_add_bootindex_property(obj, &s->conf.bootindex,
                                   "bootindex", "/ethernet-phy@0",
-                                  &dev->qdev, NULL);
+                                  &dev->qdev, IGNORE_ERRORS);
 }
 
 static USBDevice *usb_net_init(USBBus *bus, const char *cmdline)
diff --git a/hw/usb/dev-storage.c b/hw/usb/dev-storage.c
index 8a61ec94c8..b3173553c5 100644
--- a/hw/usb/dev-storage.c
+++ b/hw/usb/dev-storage.c
@@ -683,7 +683,7 @@ static USBDevice *usb_msd_init(USBBus *bus, const char *filename)
     /* parse -usbdevice disk: syntax into drive opts */
     do {
         snprintf(id, sizeof(id), "usb%d", nr++);
-        opts = qemu_opts_create(qemu_find_opts("drive"), id, 1, NULL);
+        opts = qemu_opts_create(qemu_find_opts("drive"), id, 1, IGNORE_ERRORS);
     } while (!opts);
 
     p1 = strchr(filename, ':');
@@ -827,8 +827,8 @@ static void usb_msd_instance_init(Object *obj)
 {
     object_property_add(obj, "bootindex", "int32",
                         usb_msd_get_bootindex,
-                        usb_msd_set_bootindex, NULL, NULL, NULL);
-    object_property_set_int(obj, -1, "bootindex", NULL);
+                        usb_msd_set_bootindex, NULL, NULL, IGNORE_ERRORS);
+    object_property_set_int(obj, -1, "bootindex", IGNORE_ERRORS);
 }
 
 static void usb_msd_class_initfn_bot(ObjectClass *klass, void *data)
diff --git a/hw/usb/hcd-ehci-pci.c b/hw/usb/hcd-ehci-pci.c
index 63491111e5..6a19b23ebe 100644
--- a/hw/usb/hcd-ehci-pci.c
+++ b/hw/usb/hcd-ehci-pci.c
@@ -66,7 +66,7 @@ static void usb_ehci_pci_realize(PCIDevice *dev, Error **errp)
     s->irq = pci_allocate_irq(dev);
     s->as = pci_get_address_space(dev);
 
-    usb_ehci_realize(s, DEVICE(dev), NULL);
+    usb_ehci_realize(s, DEVICE(dev), IGNORE_ERRORS);
     pci_register_bar(dev, 0, PCI_BASE_ADDRESS_SPACE_MEMORY, &s->mem);
 }
 
@@ -103,7 +103,7 @@ static void usb_ehci_pci_exit(PCIDevice *dev)
     EHCIPCIState *i = PCI_EHCI(dev);
     EHCIState *s = &i->ehci;
 
-    usb_ehci_unrealize(s, DEVICE(dev), NULL);
+    usb_ehci_unrealize(s, DEVICE(dev), IGNORE_ERRORS);
 
     g_free(s->irq);
     s->irq = NULL;
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index a0c7960a7b..05364b6955 100644
--- a/hw/usb/hcd-xhci.c
+++ b/hw/usb/hcd-xhci.c
@@ -3425,7 +3425,7 @@ static void usb_xhci_realize(struct PCIDevice *dev, Error **errp)
         msix_init(dev, xhci->numintrs,
                   &xhci->mem, 0, OFF_MSIX_TABLE,
                   &xhci->mem, 0, OFF_MSIX_PBA,
-                  0x90, NULL);
+                  0x90, IGNORE_ERRORS);
     }
 }
 
diff --git a/hw/usb/host-libusb.c b/hw/usb/host-libusb.c
index f9c8eafe06..c32ee8864c 100644
--- a/hw/usb/host-libusb.c
+++ b/hw/usb/host-libusb.c
@@ -1065,7 +1065,7 @@ static void usb_host_instance_init(Object *obj)
 
     device_add_bootindex_property(obj, &s->bootindex,
                                   "bootindex", NULL,
-                                  &udev->qdev, NULL);
+                                  &udev->qdev, IGNORE_ERRORS);
 }
 
 static void usb_host_unrealize(USBDevice *udev, Error **errp)
diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c
index aa22d69216..d50239e588 100644
--- a/hw/usb/redirect.c
+++ b/hw/usb/redirect.c
@@ -2521,7 +2521,7 @@ static void usbredir_instance_init(Object *obj)
 
     device_add_bootindex_property(obj, &dev->bootindex,
                                   "bootindex", NULL,
-                                  &udev->qdev, NULL);
+                                  &udev->qdev, IGNORE_ERRORS);
 }
 
 static const TypeInfo usbredir_dev_info = {
diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
index 32aca77701..2d3bad68fc 100644
--- a/hw/vfio/pci.c
+++ b/hw/vfio/pci.c
@@ -2936,7 +2936,7 @@ static void vfio_instance_init(Object *obj)
 
     device_add_bootindex_property(obj, &vdev->bootindex,
                                   "bootindex", NULL,
-                                  &pci_dev->qdev, NULL);
+                                  &pci_dev->qdev, IGNORE_ERRORS);
     vdev->host.domain = ~0U;
     vdev->host.bus = ~0U;
     vdev->host.slot = ~0U;
diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c
index f9939baa45..c2ba3f991b 100644
--- a/hw/virtio/virtio-balloon.c
+++ b/hw/virtio/virtio-balloon.c
@@ -485,12 +485,12 @@ static void virtio_balloon_instance_init(Object *obj)
     VirtIOBalloon *s = VIRTIO_BALLOON(obj);
 
     object_property_add(obj, "guest-stats", "guest statistics",
-                        balloon_stats_get_all, NULL, NULL, s, NULL);
+                        balloon_stats_get_all, NULL, NULL, s, IGNORE_ERRORS);
 
     object_property_add(obj, "guest-stats-polling-interval", "int",
                         balloon_stats_get_poll_interval,
                         balloon_stats_set_poll_interval,
-                        NULL, s, NULL);
+                        NULL, s, IGNORE_ERRORS);
 }
 
 static const VMStateDescription vmstate_virtio_balloon = {
diff --git a/hw/virtio/virtio-crypto-pci.c b/hw/virtio/virtio-crypto-pci.c
index 422aca3a98..fe66425540 100644
--- a/hw/virtio/virtio-crypto-pci.c
+++ b/hw/virtio/virtio-crypto-pci.c
@@ -41,7 +41,7 @@ static void virtio_crypto_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
     object_property_set_bool(OBJECT(vdev), true, "realized", errp);
     object_property_set_link(OBJECT(vcrypto),
                  OBJECT(vcrypto->vdev.conf.cryptodev), "cryptodev",
-                 NULL);
+                 IGNORE_ERRORS);
 }
 
 static void virtio_crypto_pci_class_init(ObjectClass *klass, void *data)
diff --git a/hw/virtio/virtio-crypto.c b/hw/virtio/virtio-crypto.c
index 0353eb6d5d..a4714af54a 100644
--- a/hw/virtio/virtio-crypto.c
+++ b/hw/virtio/virtio-crypto.c
@@ -916,7 +916,7 @@ static void virtio_crypto_instance_init(Object *obj)
                              TYPE_CRYPTODEV_BACKEND,
                              (Object **)&vcrypto->conf.cryptodev,
                              virtio_crypto_check_cryptodev_is_used,
-                             OBJ_PROP_LINK_UNREF_ON_RELEASE, NULL);
+                             OBJ_PROP_LINK_UNREF_ON_RELEASE, IGNORE_ERRORS);
 }
 
 static const TypeInfo virtio_crypto_info = {
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index f9b7244808..20b2fef683 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -1686,7 +1686,7 @@ static void virtio_pci_device_plugged(DeviceState *d, Error **errp)
 
     if (proxy->nvectors) {
         int err = msix_init_exclusive_bar(&proxy->pci_dev, proxy->nvectors,
-                                          proxy->msix_bar_idx, NULL);
+                                          proxy->msix_bar_idx, IGNORE_ERRORS);
         if (err) {
             /* Notice when a system that supports MSIx can't initialize it */
             if (err != -ENOTSUP) {
@@ -2384,7 +2384,7 @@ static void virtio_rng_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
 
     object_property_set_link(OBJECT(vrng),
                              OBJECT(vrng->vdev.conf.rng), "rng",
-                             NULL);
+                             IGNORE_ERRORS);
 }
 
 static void virtio_rng_pci_class_init(ObjectClass *klass, void *data)
diff --git a/hw/virtio/virtio-rng.c b/hw/virtio/virtio-rng.c
index a6ee501051..e564e3b291 100644
--- a/hw/virtio/virtio-rng.c
+++ b/hw/virtio/virtio-rng.c
@@ -189,14 +189,14 @@ static void virtio_rng_device_realize(DeviceState *dev, Error **errp)
         object_property_add_child(OBJECT(dev),
                                   "default-backend",
                                   OBJECT(vrng->conf.default_backend),
-                                  NULL);
+                                  IGNORE_ERRORS);
 
         /* The child property took a reference, we can safely drop ours now */
         object_unref(OBJECT(vrng->conf.default_backend));
 
         object_property_set_link(OBJECT(dev),
                                  OBJECT(vrng->conf.default_backend),
-                                 "rng", NULL);
+                                 "rng", IGNORE_ERRORS);
     }
 
     vrng->rng = vrng->conf.rng;
@@ -269,7 +269,7 @@ static void virtio_rng_initfn(Object *obj)
     object_property_add_link(obj, "rng", TYPE_RNG_BACKEND,
                              (Object **)&vrng->conf.rng,
                              qdev_prop_allow_set_link_before_realize,
-                             OBJ_PROP_LINK_UNREF_ON_RELEASE, NULL);
+                             OBJ_PROP_LINK_UNREF_ON_RELEASE, IGNORE_ERRORS);
 }
 
 static const TypeInfo virtio_rng_info = {
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index 464947f76d..fd16ff7d9d 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -2223,7 +2223,8 @@ void virtio_instance_init_common(Object *proxy_obj, void *data,
     DeviceState *vdev = data;
 
     object_initialize(vdev, vdev_size, vdev_name);
-    object_property_add_child(proxy_obj, "virtio-backend", OBJECT(vdev), NULL);
+    object_property_add_child(proxy_obj, "virtio-backend", OBJECT(vdev),
+                              IGNORE_ERRORS);
     object_unref(OBJECT(vdev));
     qdev_alias_all_properties(vdev, proxy_obj);
 }
diff --git a/hw/xen/xen_pvdev.c b/hw/xen/xen_pvdev.c
index 5048430177..56e5a49923 100644
--- a/hw/xen/xen_pvdev.c
+++ b/hw/xen/xen_pvdev.c
@@ -310,7 +310,7 @@ void xen_pv_del_xendev(struct XenDevice *xendev)
 
     QTAILQ_REMOVE(&xendevs, xendev, next);
 
-    qdev_unplug(&xendev->qdev, NULL);
+    qdev_unplug(&xendev->qdev, IGNORE_ERRORS);
 }
 
 void xen_pv_insert_xendev(struct XenDevice *xendev)
diff --git a/io/channel-command.c b/io/channel-command.c
index 319c5ed50c..2eea0135b0 100644
--- a/io/channel-command.c
+++ b/io/channel-command.c
@@ -218,7 +218,7 @@ static void qio_channel_command_finalize(Object *obj)
     ioc->writefd = ioc->readfd = -1;
     if (ioc->pid > 0) {
 #ifndef WIN32
-        qio_channel_command_abort(ioc, NULL);
+        qio_channel_command_abort(ioc, IGNORE_ERRORS);
 #endif
     }
 }
diff --git a/io/channel-tls.c b/io/channel-tls.c
index 6182702dab..6350f5b25f 100644
--- a/io/channel-tls.c
+++ b/io/channel-tls.c
@@ -31,7 +31,7 @@ static ssize_t qio_channel_tls_write_handler(const char *buf,
     QIOChannelTLS *tioc = QIO_CHANNEL_TLS(opaque);
     ssize_t ret;
 
-    ret = qio_channel_write(tioc->master, buf, len, NULL);
+    ret = qio_channel_write(tioc->master, buf, len, IGNORE_ERRORS);
     if (ret == QIO_CHANNEL_ERR_BLOCK) {
         errno = EAGAIN;
         return -1;
@@ -49,7 +49,7 @@ static ssize_t qio_channel_tls_read_handler(char *buf,
     QIOChannelTLS *tioc = QIO_CHANNEL_TLS(opaque);
     ssize_t ret;
 
-    ret = qio_channel_read(tioc->master, buf, len, NULL);
+    ret = qio_channel_read(tioc->master, buf, len, IGNORE_ERRORS);
     if (ret == QIO_CHANNEL_ERR_BLOCK) {
         errno = EAGAIN;
         return -1;
diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index b54bdffd8c..f46bd88274 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -119,7 +119,8 @@ typedef abi_int         target_pid_t;
 static const char *get_elf_platform(void)
 {
     static char elf_platform[] = "i386";
-    int family = object_property_get_int(OBJECT(thread_cpu), "family", NULL);
+    int family = object_property_get_int(OBJECT(thread_cpu), "family",
+                                         IGNORE_ERRORS);
     if (family > 6)
         family = 6;
     if (family >= 3)
diff --git a/linux-user/uname.c b/linux-user/uname.c
index 5199380d85..7c13669a32 100644
--- a/linux-user/uname.c
+++ b/linux-user/uname.c
@@ -56,7 +56,7 @@ const char *cpu_to_uname_machine(void *cpu_env)
 #elif defined(TARGET_I386) && !defined(TARGET_X86_64)
     /* see arch/x86/kernel/cpu/bugs.c: check_bugs(), 386, 486, 586, 686 */
     CPUState *cpu = ENV_GET_CPU((CPUX86State *)cpu_env);
-    int family = object_property_get_int(OBJECT(cpu), "family", NULL);
+    int family = object_property_get_int(OBJECT(cpu), "family", IGNORE_ERRORS);
     if (family == 4) {
         return "i486";
     }
diff --git a/migration/block.c b/migration/block.c
index 114cedbfd0..31ea6ec7c1 100644
--- a/migration/block.c
+++ b/migration/block.c
@@ -348,7 +348,8 @@ static int set_dirty_tracking(void)
     QSIMPLEQ_FOREACH(bmds, &block_mig_state.bmds_list, entry) {
         aio_context_acquire(blk_get_aio_context(bmds->blk));
         bmds->dirty_bitmap = bdrv_create_dirty_bitmap(blk_bs(bmds->blk),
-                                                      BLOCK_SIZE, NULL, NULL);
+                                                      BLOCK_SIZE, NULL,
+                                                      IGNORE_ERRORS);
         aio_context_release(blk_get_aio_context(bmds->blk));
         if (!bmds->dirty_bitmap) {
             ret = -errno;
diff --git a/migration/colo.c b/migration/colo.c
index 111b715546..d623d801e7 100644
--- a/migration/colo.c
+++ b/migration/colo.c
@@ -330,7 +330,7 @@ static int colo_do_checkpoint_transaction(MigrationState *s,
         goto out;
     }
     /* Reset channel-buffer directly */
-    qio_channel_io_seek(QIO_CHANNEL(bioc), 0, 0, NULL);
+    qio_channel_io_seek(QIO_CHANNEL(bioc), 0, 0, IGNORE_ERRORS);
     bioc->usage = 0;
 
     qemu_mutex_lock_iothread();
@@ -618,7 +618,7 @@ void *colo_process_incoming_thread(void *opaque)
             goto out;
         }
         bioc->usage = total_size;
-        qio_channel_io_seek(QIO_CHANNEL(bioc), 0, 0, NULL);
+        qio_channel_io_seek(QIO_CHANNEL(bioc), 0, 0, IGNORE_ERRORS);
 
         colo_send_message(mis->to_src_file, COLO_MESSAGE_VMSTATE_RECEIVED,
                      &local_err);
diff --git a/migration/qemu-file-channel.c b/migration/qemu-file-channel.c
index a597c5f948..63b96c82c2 100644
--- a/migration/qemu-file-channel.c
+++ b/migration/qemu-file-channel.c
@@ -48,7 +48,7 @@ static ssize_t channel_writev_buffer(void *opaque,
 
     while (nlocal_iov > 0) {
         ssize_t len;
-        len = qio_channel_writev(ioc, local_iov, nlocal_iov, NULL);
+        len = qio_channel_writev(ioc, local_iov, nlocal_iov, IGNORE_ERRORS);
         if (len == QIO_CHANNEL_ERR_BLOCK) {
             qio_channel_wait(ioc, G_IO_OUT);
             continue;
@@ -78,7 +78,7 @@ static ssize_t channel_get_buffer(void *opaque,
     ssize_t ret;
 
     do {
-        ret = qio_channel_read(ioc, (char *)buf, size, NULL);
+        ret = qio_channel_read(ioc, (char *)buf, size, IGNORE_ERRORS);
         if (ret < 0) {
             if (ret == QIO_CHANNEL_ERR_BLOCK) {
                 qio_channel_yield(ioc, G_IO_IN);
@@ -96,7 +96,7 @@ static ssize_t channel_get_buffer(void *opaque,
 static int channel_close(void *opaque)
 {
     QIOChannel *ioc = QIO_CHANNEL(opaque);
-    qio_channel_close(ioc, NULL);
+    qio_channel_close(ioc, IGNORE_ERRORS);
     object_unref(OBJECT(ioc));
     return 0;
 }
@@ -118,7 +118,7 @@ static int channel_shutdown(void *opaque,
         } else {
             mode = QIO_CHANNEL_SHUTDOWN_WRITE;
         }
-        if (qio_channel_shutdown(ioc, mode, NULL) < 0) {
+        if (qio_channel_shutdown(ioc, mode, IGNORE_ERRORS) < 0) {
             /* XXX handler Error * object */
             return -EIO;
         }
@@ -132,7 +132,7 @@ static int channel_set_blocking(void *opaque,
 {
     QIOChannel *ioc = QIO_CHANNEL(opaque);
 
-    if (qio_channel_set_blocking(ioc, enabled, NULL) < 0) {
+    if (qio_channel_set_blocking(ioc, enabled, IGNORE_ERRORS) < 0) {
         return -1;
     }
     return 0;
diff --git a/migration/ram.c b/migration/ram.c
index b2ca242a3a..e210263f41 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -661,7 +661,8 @@ static void migration_bitmap_sync(RAMState *rs)
         rs->bytes_xfer_prev = bytes_xfer_now;
     }
     if (migrate_use_events()) {
-        qapi_event_send_migration_pass(ram_counters.dirty_sync_count, NULL);
+        qapi_event_send_migration_pass(ram_counters.dirty_sync_count,
+                                       IGNORE_ERRORS);
     }
 }
 
diff --git a/migration/socket.c b/migration/socket.c
index 85bfdccae1..018e1d1191 100644
--- a/migration/socket.c
+++ b/migration/socket.c
@@ -154,7 +154,7 @@ static gboolean socket_accept_incoming_migration(QIOChannel *ioc,
 
 out:
     /* Close listening socket as its no longer needed */
-    qio_channel_close(ioc, NULL);
+    qio_channel_close(ioc, IGNORE_ERRORS);
     return FALSE; /* unregister */
 }
 
diff --git a/monitor.c b/monitor.c
index 1e63ace2d4..c262311fdd 100644
--- a/monitor.c
+++ b/monitor.c
@@ -3211,7 +3211,7 @@ void chardev_add_completion(ReadLineState *rs, int nb_args, const char *str)
     len = strlen(str);
     readline_set_completion_index(rs, len);
 
-    start = list = qmp_query_chardev_backends(NULL);
+    start = list = qmp_query_chardev_backends(IGNORE_ERRORS);
     while (list) {
         const char *chr_name = list->value->name;
 
@@ -3322,7 +3322,7 @@ void chardev_remove_completion(ReadLineState *rs, int nb_args, const char *str)
     len = strlen(str);
     readline_set_completion_index(rs, len);
 
-    start = list = qmp_query_chardev(NULL);
+    start = list = qmp_query_chardev(IGNORE_ERRORS);
     while (list) {
         ChardevInfo *chr = list->value;
 
@@ -3342,7 +3342,7 @@ static void ringbuf_completion(ReadLineState *rs, const char *str)
     len = strlen(str);
     readline_set_completion_index(rs, len);
 
-    start = list = qmp_query_chardev(NULL);
+    start = list = qmp_query_chardev(IGNORE_ERRORS);
     while (list) {
         ChardevInfo *chr_info = list->value;
 
@@ -3389,7 +3389,7 @@ void object_del_completion(ReadLineState *rs, int nb_args, const char *str)
     len = strlen(str);
     readline_set_completion_index(rs, len);
 
-    start = list = qmp_qom_list("/objects", NULL);
+    start = list = qmp_qom_list("/objects", IGNORE_ERRORS);
     while (list) {
         ObjectPropertyInfo *info = list->value;
 
@@ -3921,7 +3921,7 @@ static QObject *get_qmp_greeting(void)
 {
     QObject *ver = NULL;
 
-    qmp_marshal_query_version(NULL, &ver, NULL);
+    qmp_marshal_query_version(NULL, &ver, IGNORE_ERRORS);
 
     return qobject_from_jsonf("{'QMP': {'version': %p, 'capabilities': []}}",
                               ver);
diff --git a/nbd/client.c b/nbd/client.c
index 595d99ed30..8541e109a7 100644
--- a/nbd/client.c
+++ b/nbd/client.c
@@ -157,7 +157,7 @@ static void nbd_send_opt_abort(QIOChannel *ioc)
      * to disconnect without waiting for the server reply, so we don't
      * even care if the request makes it to the server, let alone
      * waiting around for whether the server replies. */
-    nbd_send_option_request(ioc, NBD_OPT_ABORT, 0, NULL, NULL);
+    nbd_send_option_request(ioc, NBD_OPT_ABORT, 0, NULL, IGNORE_ERRORS);
 }
 
 
@@ -759,7 +759,7 @@ ssize_t nbd_send_request(QIOChannel *ioc, NBDRequest *request)
     stq_be_p(buf + 16, request->from);
     stl_be_p(buf + 24, request->len);
 
-    return write_sync(ioc, buf, sizeof(buf), NULL);
+    return write_sync(ioc, buf, sizeof(buf), IGNORE_ERRORS);
 }
 
 ssize_t nbd_receive_reply(QIOChannel *ioc, NBDReply *reply, Error **errp)
diff --git a/nbd/server.c b/nbd/server.c
index 49b55f6ede..8631fa55a3 100644
--- a/nbd/server.c
+++ b/nbd/server.c
@@ -124,7 +124,7 @@ static int nbd_negotiate_read(QIOChannel *ioc, void *buffer, size_t size)
                                   nbd_negotiate_continue,
                                   qemu_coroutine_self(),
                                   NULL);
-    ret = read_sync(ioc, buffer, size, NULL);
+    ret = read_sync(ioc, buffer, size, IGNORE_ERRORS);
     g_source_remove(watch);
     return ret;
 
@@ -142,7 +142,7 @@ static int nbd_negotiate_write(QIOChannel *ioc, const void *buffer, size_t size)
                                   nbd_negotiate_continue,
                                   qemu_coroutine_self(),
                                   NULL);
-    ret = write_sync(ioc, buffer, size, NULL);
+    ret = write_sync(ioc, buffer, size, IGNORE_ERRORS);
     g_source_remove(watch);
     return ret;
 }
@@ -632,7 +632,7 @@ static coroutine_fn int nbd_negotiate(NBDClientNewData *data)
         [28 .. 151]   reserved     (0, omit if no_zeroes)
      */
 
-    qio_channel_set_blocking(client->ioc, false, NULL);
+    qio_channel_set_blocking(client->ioc, false, IGNORE_ERRORS);
     rc = -EINVAL;
 
     TRACE("Beginning negotiation.");
@@ -694,7 +694,7 @@ static ssize_t nbd_receive_request(QIOChannel *ioc, NBDRequest *request)
     uint32_t magic;
     ssize_t ret;
 
-    ret = read_sync(ioc, buf, sizeof(buf), NULL);
+    ret = read_sync(ioc, buf, sizeof(buf), IGNORE_ERRORS);
     if (ret < 0) {
         return ret;
     }
@@ -745,7 +745,7 @@ static ssize_t nbd_send_reply(QIOChannel *ioc, NBDReply *reply)
     stl_be_p(buf + 4, reply->error);
     stq_be_p(buf + 8, reply->handle);
 
-    return write_sync(ioc, buf, sizeof(buf), NULL);
+    return write_sync(ioc, buf, sizeof(buf), IGNORE_ERRORS);
 }
 
 #define MAX_NBD_REQUESTS 16
@@ -790,7 +790,7 @@ static void client_close(NBDClient *client)
      * then we'll close the socket and free the NBDClient.
      */
     qio_channel_shutdown(client->ioc, QIO_CHANNEL_SHUTDOWN_BOTH,
-                         NULL);
+                         IGNORE_ERRORS);
 
     /* Also tell the client, so that they release their reference.  */
     if (client->close) {
@@ -920,7 +920,7 @@ NBDExport *nbd_export_new(BlockDriverState *bs, off_t dev_offset, off_t size,
      * access since the export could be available before migration handover.
      */
     aio_context_acquire(exp->ctx);
-    blk_invalidate_cache(blk, NULL);
+    blk_invalidate_cache(blk, IGNORE_ERRORS);
     aio_context_release(exp->ctx);
     return exp;
 
@@ -1048,7 +1048,7 @@ static ssize_t nbd_co_send_reply(NBDRequestData *req, NBDReply *reply,
         qio_channel_set_cork(client->ioc, true);
         rc = nbd_send_reply(client->ioc, reply);
         if (rc >= 0) {
-            ret = write_sync(client->ioc, req->data, len, NULL);
+            ret = write_sync(client->ioc, req->data, len, IGNORE_ERRORS);
             if (ret < 0) {
                 rc = -EIO;
             }
@@ -1123,7 +1123,7 @@ static ssize_t nbd_co_receive_request(NBDRequestData *req,
     if (request->type == NBD_CMD_WRITE) {
         TRACE("Reading %" PRIu32 " byte(s)", request->len);
 
-        if (read_sync(client->ioc, req->data, request->len, NULL) < 0) {
+        if (read_sync(client->ioc, req->data, request->len, IGNORE_ERRORS) < 0) {
             LOG("reading from socket failed");
             rc = -EIO;
             goto out;
diff --git a/net/colo-compare.c b/net/colo-compare.c
index 6d500e1dc4..16e46c3a6c 100644
--- a/net/colo-compare.c
+++ b/net/colo-compare.c
@@ -788,13 +788,13 @@ static void colo_compare_init(Object *obj)
 {
     object_property_add_str(obj, "primary_in",
                             compare_get_pri_indev, compare_set_pri_indev,
-                            NULL);
+                            IGNORE_ERRORS);
     object_property_add_str(obj, "secondary_in",
                             compare_get_sec_indev, compare_set_sec_indev,
-                            NULL);
+                            IGNORE_ERRORS);
     object_property_add_str(obj, "outdev",
                             compare_get_outdev, compare_set_outdev,
-                            NULL);
+                            IGNORE_ERRORS);
 }
 
 static void colo_compare_finalize(Object *obj)
diff --git a/net/dump.c b/net/dump.c
index 442eb532f9..b66d56e06c 100644
--- a/net/dump.c
+++ b/net/dump.c
@@ -329,9 +329,9 @@ static void filter_dump_instance_init(Object *obj)
     nfds->maxlen = 65536;
 
     object_property_add(obj, "maxlen", "int", filter_dump_get_maxlen,
-                        filter_dump_set_maxlen, NULL, NULL, NULL);
+                        filter_dump_set_maxlen, NULL, NULL, IGNORE_ERRORS);
     object_property_add_str(obj, "file", file_dump_get_filename,
-                            file_dump_set_filename, NULL);
+                            file_dump_set_filename, IGNORE_ERRORS);
 }
 
 static void filter_dump_instance_finalize(Object *obj)
diff --git a/net/filter-buffer.c b/net/filter-buffer.c
index cc6bd94445..0a9c12aa1a 100644
--- a/net/filter-buffer.c
+++ b/net/filter-buffer.c
@@ -193,7 +193,7 @@ static void filter_buffer_init(Object *obj)
 {
     object_property_add(obj, "interval", "int",
                         filter_buffer_get_interval,
-                        filter_buffer_set_interval, NULL, NULL, NULL);
+                        filter_buffer_set_interval, NULL, NULL, IGNORE_ERRORS);
 }
 
 static const TypeInfo filter_buffer_info = {
diff --git a/net/filter-mirror.c b/net/filter-mirror.c
index 52d978fce2..c86d355c93 100644
--- a/net/filter-mirror.c
+++ b/net/filter-mirror.c
@@ -338,15 +338,15 @@ static void filter_redirector_set_outdev(Object *obj,
 static void filter_mirror_init(Object *obj)
 {
     object_property_add_str(obj, "outdev", filter_mirror_get_outdev,
-                            filter_mirror_set_outdev, NULL);
+                            filter_mirror_set_outdev, IGNORE_ERRORS);
 }
 
 static void filter_redirector_init(Object *obj)
 {
     object_property_add_str(obj, "indev", filter_redirector_get_indev,
-                            filter_redirector_set_indev, NULL);
+                            filter_redirector_set_indev, IGNORE_ERRORS);
     object_property_add_str(obj, "outdev", filter_redirector_get_outdev,
-                            filter_redirector_set_outdev, NULL);
+                            filter_redirector_set_outdev, IGNORE_ERRORS);
 }
 
 static void filter_mirror_fini(Object *obj)
diff --git a/net/filter.c b/net/filter.c
index 1dfd2caa23..ee7ab8e443 100644
--- a/net/filter.c
+++ b/net/filter.c
@@ -177,14 +177,14 @@ static void netfilter_init(Object *obj)
 
     object_property_add_str(obj, "netdev",
                             netfilter_get_netdev_id, netfilter_set_netdev_id,
-                            NULL);
+                            IGNORE_ERRORS);
     object_property_add_enum(obj, "queue", "NetFilterDirection",
                              NetFilterDirection_lookup,
                              netfilter_get_direction, netfilter_set_direction,
-                             NULL);
+                             IGNORE_ERRORS);
     object_property_add_str(obj, "status",
                             netfilter_get_status, netfilter_set_status,
-                            NULL);
+                            IGNORE_ERRORS);
 }
 
 static void netfilter_complete(UserCreatable *uc, Error **errp)
diff --git a/net/net.c b/net/net.c
index 6235aabed8..9d0f1119cc 100644
--- a/net/net.c
+++ b/net/net.c
@@ -1272,7 +1272,7 @@ static void netfilter_print_info(Monitor *mon, NetFilterState *nf)
             continue;
         }
         v = string_output_visitor_new(false, &str);
-        object_property_get(OBJECT(nf), v, prop->name, NULL);
+        object_property_get(OBJECT(nf), v, prop->name, IGNORE_ERRORS);
         visit_complete(v, &str);
         visit_free(v);
         monitor_printf(mon, ",%s=%s", prop->name, str);
@@ -1538,11 +1538,11 @@ int net_init_clients(void)
     QTAILQ_INIT(&net_clients);
 
     if (qemu_opts_foreach(qemu_find_opts("netdev"),
-                          net_init_netdev, NULL, NULL)) {
+                          net_init_netdev, NULL, IGNORE_ERRORS)) {
         return -1;
     }
 
-    if (qemu_opts_foreach(net, net_init_client, NULL, NULL)) {
+    if (qemu_opts_foreach(net, net_init_client, NULL, IGNORE_ERRORS)) {
         return -1;
     }
 
diff --git a/numa.c b/numa.c
index 2b5cb7b5c7..7886d31e09 100644
--- a/numa.c
+++ b/numa.c
@@ -217,7 +217,8 @@ static void parse_numa_node(MachineState *ms, NumaNodeOptions *node,
         }
 
         object_ref(o);
-        numa_info[nodenr].node_mem = object_property_get_int(o, "size", NULL);
+        numa_info[nodenr].node_mem = object_property_get_int(o, "size",
+                                                             IGNORE_ERRORS);
         numa_info[nodenr].node_memdev = MEMORY_BACKEND(o);
     }
     numa_info[nodenr].present = true;
@@ -429,7 +430,7 @@ void parse_numa_opts(MachineState *ms)
     int i;
     MachineClass *mc = MACHINE_GET_CLASS(ms);
 
-    if (qemu_opts_foreach(qemu_find_opts("numa"), parse_numa, ms, NULL)) {
+    if (qemu_opts_foreach(qemu_find_opts("numa"), parse_numa, ms, IGNORE_ERRORS)) {
         exit(1);
     }
 
@@ -639,7 +640,7 @@ static int query_memdev(Object *obj, void *opaque)
 
         m->value = g_malloc0(sizeof(*m->value));
 
-        m->value->id = object_property_get_str(obj, "id", NULL);
+        m->value->id = object_property_get_str(obj, "id", IGNORE_ERRORS);
         m->value->has_id = !!m->value->id;
 
         m->value->size = object_property_get_int(obj, "size",
diff --git a/qdev-monitor.c b/qdev-monitor.c
index 3ecbf0bd25..37302305c5 100644
--- a/qdev-monitor.c
+++ b/qdev-monitor.c
@@ -549,12 +549,12 @@ void qdev_set_id(DeviceState *dev, const char *id)
 
     if (dev->id) {
         object_property_add_child(qdev_get_peripheral(), dev->id,
-                                  OBJECT(dev), NULL);
+                                  OBJECT(dev), IGNORE_ERRORS);
     } else {
         static int anon_count;
         gchar *name = g_strdup_printf("device[%d]", anon_count++);
         object_property_add_child(qdev_get_peripheral_anon(), name,
-                                  OBJECT(dev), NULL);
+                                  OBJECT(dev), IGNORE_ERRORS);
         g_free(name);
     }
 }
@@ -651,7 +651,7 @@ static void qdev_print_props(Monitor *mon, DeviceState *dev, Property *props,
         Error *err = NULL;
         char *value;
         char *legacy_name = g_strdup_printf("legacy-%s", props->name);
-        if (object_property_get_type(OBJECT(dev), legacy_name, NULL)) {
+        if (object_property_get_type(OBJECT(dev), legacy_name, IGNORE_ERRORS)) {
             value = object_property_get_str(OBJECT(dev), legacy_name, &err);
         } else {
             value = object_property_print(OBJECT(dev), props->name, true, &err);
diff --git a/qemu-img.c b/qemu-img.c
index 0ad698d7f1..d0ab3af44b 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -537,7 +537,7 @@ static int img_create(int argc, char **argv)
 
     if (qemu_opts_foreach(&qemu_object_opts,
                           user_creatable_add_opts_foreach,
-                          NULL, NULL)) {
+                          NULL, IGNORE_ERRORS)) {
         goto fail;
     }
 
@@ -787,7 +787,7 @@ static int img_check(int argc, char **argv)
 
     if (qemu_opts_foreach(&qemu_object_opts,
                           user_creatable_add_opts_foreach,
-                          NULL, NULL)) {
+                          NULL, IGNORE_ERRORS)) {
         return 1;
     }
 
@@ -990,7 +990,7 @@ static int img_commit(int argc, char **argv)
 
     if (qemu_opts_foreach(&qemu_object_opts,
                           user_creatable_add_opts_foreach,
-                          NULL, NULL)) {
+                          NULL, IGNORE_ERRORS)) {
         return 1;
     }
 
@@ -1337,7 +1337,7 @@ static int img_compare(int argc, char **argv)
 
     if (qemu_opts_foreach(&qemu_object_opts,
                           user_creatable_add_opts_foreach,
-                          NULL, NULL)) {
+                          NULL, IGNORE_ERRORS)) {
         ret = 2;
         goto out4;
     }
@@ -2109,7 +2109,7 @@ static int img_convert(int argc, char **argv)
 
     if (qemu_opts_foreach(&qemu_object_opts,
                           user_creatable_add_opts_foreach,
-                          NULL, NULL)) {
+                          NULL, IGNORE_ERRORS)) {
         goto fail_getopt;
     }
 
@@ -2626,7 +2626,7 @@ static int img_info(int argc, char **argv)
 
     if (qemu_opts_foreach(&qemu_object_opts,
                           user_creatable_add_opts_foreach,
-                          NULL, NULL)) {
+                          NULL, IGNORE_ERRORS)) {
         return 1;
     }
 
@@ -2845,7 +2845,7 @@ static int img_map(int argc, char **argv)
 
     if (qemu_opts_foreach(&qemu_object_opts,
                           user_creatable_add_opts_foreach,
-                          NULL, NULL)) {
+                          NULL, IGNORE_ERRORS)) {
         return 1;
     }
 
@@ -2998,7 +2998,7 @@ static int img_snapshot(int argc, char **argv)
 
     if (qemu_opts_foreach(&qemu_object_opts,
                           user_creatable_add_opts_foreach,
-                          NULL, NULL)) {
+                          NULL, IGNORE_ERRORS)) {
         return 1;
     }
 
@@ -3158,7 +3158,7 @@ static int img_rebase(int argc, char **argv)
 
     if (qemu_opts_foreach(&qemu_object_opts,
                           user_creatable_add_opts_foreach,
-                          NULL, NULL)) {
+                          NULL, IGNORE_ERRORS)) {
         return 1;
     }
 
@@ -3512,7 +3512,7 @@ static int img_resize(int argc, char **argv)
 
     if (qemu_opts_foreach(&qemu_object_opts,
                           user_creatable_add_opts_foreach,
-                          NULL, NULL)) {
+                          NULL, IGNORE_ERRORS)) {
         return 1;
     }
 
@@ -3668,7 +3668,7 @@ static int img_amend(int argc, char **argv)
 
     if (qemu_opts_foreach(&qemu_object_opts,
                           user_creatable_add_opts_foreach,
-                          NULL, NULL)) {
+                          NULL, IGNORE_ERRORS)) {
         ret = -1;
         goto out_no_progress;
     }
@@ -4305,7 +4305,7 @@ static int img_dd(int argc, char **argv)
 
     if (qemu_opts_foreach(&qemu_object_opts,
                           user_creatable_add_opts_foreach,
-                          NULL, NULL)) {
+                          NULL, IGNORE_ERRORS)) {
         ret = -1;
         goto out;
     }
diff --git a/qemu-io.c b/qemu-io.c
index 8e38b288b7..2a98cd0d1f 100644
--- a/qemu-io.c
+++ b/qemu-io.c
@@ -583,7 +583,7 @@ int main(int argc, char **argv)
 
     if (qemu_opts_foreach(&qemu_object_opts,
                           user_creatable_add_opts_foreach,
-                          NULL, NULL)) {
+                          NULL, IGNORE_ERRORS)) {
         exit(1);
     }
 
diff --git a/qemu-nbd.c b/qemu-nbd.c
index 651f85ecc1..6ff0b0c070 100644
--- a/qemu-nbd.c
+++ b/qemu-nbd.c
@@ -351,7 +351,7 @@ static gboolean nbd_accept(QIOChannel *ioc, GIOCondition cond, gpointer opaque)
     QIOChannelSocket *cioc;
 
     cioc = qio_channel_socket_accept(QIO_CHANNEL_SOCKET(ioc),
-                                     NULL);
+                                     IGNORE_ERRORS);
     if (!cioc) {
         return TRUE;
     }
@@ -780,7 +780,7 @@ int main(int argc, char **argv)
 
     if (qemu_opts_foreach(&qemu_object_opts,
                           user_creatable_add_opts_foreach,
-                          NULL, NULL)) {
+                          NULL, IGNORE_ERRORS)) {
         exit(EXIT_FAILURE);
     }
 
diff --git a/qga/commands-posix.c b/qga/commands-posix.c
index d8e412275e..220a50ad7c 100644
--- a/qga/commands-posix.c
+++ b/qga/commands-posix.c
@@ -1273,7 +1273,7 @@ int64_t qmp_guest_fsfreeze_freeze_list(bool has_mountpoints,
 
 error:
     free_fs_mount_list(&mounts);
-    qmp_guest_fsfreeze_thaw(NULL);
+    qmp_guest_fsfreeze_thaw(IGNORE_ERRORS);
     return 0;
 }
 
diff --git a/qga/main.c b/qga/main.c
index cc58d2b53d..00b064d1e0 100644
--- a/qga/main.c
+++ b/qga/main.c
@@ -1386,7 +1386,7 @@ int main(int argc, char **argv)
         config->method = NULL;
         config->channel_path = NULL;
 
-        addr = socket_local_address(FIRST_SOCKET_ACTIVATION_FD, NULL);
+        addr = socket_local_address(FIRST_SOCKET_ACTIVATION_FD, IGNORE_ERRORS);
         if (addr) {
             if (addr->type == SOCKET_ADDRESS_TYPE_UNIX) {
                 config->method = g_strdup("unix-listen");
diff --git a/qobject/json-parser.c b/qobject/json-parser.c
index c18e48ab94..506514100c 100644
--- a/qobject/json-parser.c
+++ b/qobject/json-parser.c
@@ -553,7 +553,7 @@ static QObject *parse_value(JSONParserContext *ctxt, va_list *ap)
 
 QObject *json_parser_parse(GQueue *tokens, va_list *ap)
 {
-    return json_parser_parse_err(tokens, ap, NULL);
+    return json_parser_parse_err(tokens, ap, IGNORE_ERRORS);
 }
 
 QObject *json_parser_parse_err(GQueue *tokens, va_list *ap, Error **errp)
diff --git a/qom/container.c b/qom/container.c
index 2dbabd15ab..6cf53d9be7 100644
--- a/qom/container.c
+++ b/qom/container.c
@@ -40,7 +40,7 @@ Object *container_get(Object *root, const char *path)
         child = object_resolve_path_component(obj, parts[i]);
         if (!child) {
             child = object_new("container");
-            object_property_add_child(obj, parts[i], child, NULL);
+            object_property_add_child(obj, parts[i], child, IGNORE_ERRORS);
             object_unref(child);
         }
     }
diff --git a/qom/object.c b/qom/object.c
index eb4bc924ff..8b2f2ef8ac 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -444,7 +444,7 @@ static void object_property_del_child(Object *obj, Object *child, Error **errp)
 void object_unparent(Object *obj)
 {
     if (obj->parent) {
-        object_property_del_child(obj->parent, obj, NULL);
+        object_property_del_child(obj->parent, obj, IGNORE_ERRORS);
     }
 }
 
@@ -924,7 +924,7 @@ object_property_add(Object *obj, const char *name, const char *type,
             char *full_name = g_strdup_printf("%s[%d]", name_no_array, i);
 
             ret = object_property_add(obj, full_name, type, get, set,
-                                      release, opaque, NULL);
+                                      release, opaque, IGNORE_ERRORS);
             g_free(full_name);
             if (ret) {
                 break;
@@ -934,7 +934,7 @@ object_property_add(Object *obj, const char *name, const char *type,
         return ret;
     }
 
-    if (object_property_find(obj, name, NULL) != NULL) {
+    if (object_property_find(obj, name, IGNORE_ERRORS) != NULL) {
         error_setg(errp, "attempt to add duplicate property '%s'"
                    " to object (type '%s')", name,
                    object_get_typename(obj));
@@ -967,7 +967,7 @@ object_class_property_add(ObjectClass *klass,
 {
     ObjectProperty *prop;
 
-    if (object_class_property_find(klass, name, NULL) != NULL) {
+    if (object_class_property_find(klass, name, IGNORE_ERRORS) != NULL) {
         error_setg(errp, "attempt to add duplicate property '%s'"
                    " to object (type '%s')", name,
                    object_class_get_name(klass));
@@ -995,7 +995,7 @@ ObjectProperty *object_property_find(Object *obj, const char *name,
     ObjectProperty *prop;
     ObjectClass *klass = object_get_class(obj);
 
-    prop = object_class_property_find(klass, name, NULL);
+    prop = object_class_property_find(klass, name, IGNORE_ERRORS);
     if (prop) {
         return prop;
     }
@@ -1037,7 +1037,7 @@ ObjectProperty *object_class_property_find(ObjectClass *klass, const char *name,
 
     parent_klass = object_class_get_parent(klass);
     if (parent_klass) {
-        prop = object_class_property_find(parent_klass, name, NULL);
+        prop = object_class_property_find(parent_klass, name, IGNORE_ERRORS);
         if (prop) {
             return prop;
         }
@@ -1449,7 +1449,7 @@ static Object *object_resolve_link(Object *obj, const char *name,
     Object *target;
 
     /* Go from link<FOO> to FOO.  */
-    type = object_property_get_type(obj, name, NULL);
+    type = object_property_get_type(obj, name, IGNORE_ERRORS);
     target_type = g_strndup(&type[5], strlen(type) - 6);
     target = object_resolve_path_type(path, target_type, &ambiguous);
 
@@ -1627,7 +1627,7 @@ gchar *object_get_canonical_path(Object *obj)
 
 Object *object_resolve_path_component(Object *parent, const gchar *part)
 {
-    ObjectProperty *prop = object_property_find(parent, part, NULL);
+    ObjectProperty *prop = object_property_find(parent, part, IGNORE_ERRORS);
     if (prop == NULL) {
         return NULL;
     }
@@ -2301,7 +2301,7 @@ void object_class_property_set_description(ObjectClass *klass,
 
 static void object_instance_init(Object *obj)
 {
-    object_property_add_str(obj, "type", qdev_get_type, NULL, NULL);
+    object_property_add_str(obj, "type", qdev_get_type, NULL, IGNORE_ERRORS);
 }
 
 static void register_types(void)
diff --git a/qom/object_interfaces.c b/qom/object_interfaces.c
index ff27e0669e..e8f0fa9b8d 100644
--- a/qom/object_interfaces.c
+++ b/qom/object_interfaces.c
@@ -63,7 +63,7 @@ Object *user_creatable_add_type(const char *type, const char *id,
 
     assert(qdict);
     obj = object_new(type);
-    if (object_property_find(obj, "id", NULL)) {
+    if (object_property_find(obj, "id", IGNORE_ERRORS)) {
         object_property_set_str(obj, id, "id", &local_err);
         if (local_err) {
             goto out;
diff --git a/target/alpha/cpu.c b/target/alpha/cpu.c
index 8186c9d379..a863a1bf4d 100644
--- a/target/alpha/cpu.c
+++ b/target/alpha/cpu.c
@@ -170,7 +170,7 @@ AlphaCPU *cpu_alpha_init(const char *cpu_model)
     }
     cpu = ALPHA_CPU(object_new(object_class_get_name(cpu_class)));
 
-    object_property_set_bool(OBJECT(cpu), true, "realized", NULL);
+    object_property_set_bool(OBJECT(cpu), true, "realized", IGNORE_ERRORS);
 
     return cpu;
 }
diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c
index 670c07ab6e..7d6055bb63 100644
--- a/target/arm/cpu64.c
+++ b/target/arm/cpu64.c
@@ -277,11 +277,11 @@ static void aarch64_cpu_set_aarch64(Object *obj, bool value, Error **errp)
 static void aarch64_cpu_initfn(Object *obj)
 {
     object_property_add_bool(obj, "aarch64", aarch64_cpu_get_aarch64,
-                             aarch64_cpu_set_aarch64, NULL);
+                             aarch64_cpu_set_aarch64, IGNORE_ERRORS);
     object_property_set_description(obj, "aarch64",
                                     "Set on/off to enable/disable aarch64 "
                                     "execution state ",
-                                    NULL);
+                                    IGNORE_ERRORS);
 }
 
 static void aarch64_cpu_finalizefn(Object *obj)
diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c
index 30299e990d..6a05445e0e 100644
--- a/target/hppa/cpu.c
+++ b/target/hppa/cpu.c
@@ -118,7 +118,7 @@ HPPACPU *cpu_hppa_init(const char *cpu_model)
 
     cpu = HPPA_CPU(object_new(TYPE_HPPA_CPU));
 
-    object_property_set_bool(OBJECT(cpu), true, "realized", NULL);
+    object_property_set_bool(OBJECT(cpu), true, "realized", IGNORE_ERRORS);
 
     return cpu;
 }
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index b2b1d20cee..ae7abdade5 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -3768,7 +3768,7 @@ static void x86_cpu_register_bit_prop(X86CPU *cpu,
     ObjectProperty *op;
     uint32_t mask = (1UL << bitnr);
 
-    op = object_property_find(OBJECT(cpu), prop_name, NULL);
+    op = object_property_find(OBJECT(cpu), prop_name, IGNORE_ERRORS);
     if (op) {
         fp = op->opaque;
         assert(fp->w == w);
@@ -3862,31 +3862,36 @@ static void x86_cpu_initfn(Object *obj)
 
     object_property_add(obj, "family", "int",
                         x86_cpuid_version_get_family,
-                        x86_cpuid_version_set_family, NULL, NULL, NULL);
+                        x86_cpuid_version_set_family, NULL, NULL,
+                        IGNORE_ERRORS);
     object_property_add(obj, "model", "int",
                         x86_cpuid_version_get_model,
-                        x86_cpuid_version_set_model, NULL, NULL, NULL);
+                        x86_cpuid_version_set_model, NULL, NULL,
+                        IGNORE_ERRORS);
     object_property_add(obj, "stepping", "int",
                         x86_cpuid_version_get_stepping,
-                        x86_cpuid_version_set_stepping, NULL, NULL, NULL);
+                        x86_cpuid_version_set_stepping, NULL, NULL,
+                        IGNORE_ERRORS);
     object_property_add_str(obj, "vendor",
                             x86_cpuid_get_vendor,
-                            x86_cpuid_set_vendor, NULL);
+                            x86_cpuid_set_vendor, IGNORE_ERRORS);
     object_property_add_str(obj, "model-id",
                             x86_cpuid_get_model_id,
-                            x86_cpuid_set_model_id, NULL);
+                            x86_cpuid_set_model_id, IGNORE_ERRORS);
     object_property_add(obj, "tsc-frequency", "int",
                         x86_cpuid_get_tsc_freq,
-                        x86_cpuid_set_tsc_freq, NULL, NULL, NULL);
+                        x86_cpuid_set_tsc_freq, NULL, NULL, IGNORE_ERRORS);
     object_property_add(obj, "feature-words", "X86CPUFeatureWordInfo",
                         x86_cpu_get_feature_words,
-                        NULL, NULL, (void *)env->features, NULL);
+                        NULL, NULL, (void *)env->features, IGNORE_ERRORS);
     object_property_add(obj, "filtered-features", "X86CPUFeatureWordInfo",
                         x86_cpu_get_feature_words,
-                        NULL, NULL, (void *)cpu->filtered_features, NULL);
+                        NULL, NULL, (void *)cpu->filtered_features,
+                        IGNORE_ERRORS);
 
     object_property_add(obj, "crash-information", "GuestPanicInformation",
-                        x86_cpu_get_crash_info_qom, NULL, NULL, NULL, NULL);
+                        x86_cpu_get_crash_info_qom, NULL, NULL, NULL,
+                        IGNORE_ERRORS);
 
     cpu->hyperv_spinlock_attempts = HYPERV_SPINLOCK_NEVER_RETRY;
 
diff --git a/target/m68k/helper.c b/target/m68k/helper.c
index ea1872cae5..c0a36e61b3 100644
--- a/target/m68k/helper.c
+++ b/target/m68k/helper.c
@@ -116,7 +116,7 @@ M68kCPU *cpu_m68k_init(const char *cpu_model)
 
     register_m68k_insns(env);
 
-    object_property_set_bool(OBJECT(cpu), true, "realized", NULL);
+    object_property_set_bool(OBJECT(cpu), true, "realized", IGNORE_ERRORS);
 
     return cpu;
 }
diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c
index 83f6d96a71..9174818c0a 100644
--- a/target/microblaze/translate.c
+++ b/target/microblaze/translate.c
@@ -1821,7 +1821,7 @@ MicroBlazeCPU *cpu_mb_init(const char *cpu_model)
 
     cpu = MICROBLAZE_CPU(object_new(TYPE_MICROBLAZE_CPU));
 
-    object_property_set_bool(OBJECT(cpu), true, "realized", NULL);
+    object_property_set_bool(OBJECT(cpu), true, "realized", IGNORE_ERRORS);
 
     return cpu;
 }
diff --git a/target/mips/translate.c b/target/mips/translate.c
index 7dedfd6632..b752c0faed 100644
--- a/target/mips/translate.c
+++ b/target/mips/translate.c
@@ -20212,7 +20212,7 @@ MIPSCPU *cpu_mips_init(const char *cpu_model)
     fpu_init(env, def);
     mvp_init(env, def);
 
-    object_property_set_bool(OBJECT(cpu), true, "realized", NULL);
+    object_property_set_bool(OBJECT(cpu), true, "realized", IGNORE_ERRORS);
 
     return cpu;
 }
diff --git a/target/nios2/cpu.c b/target/nios2/cpu.c
index d56bb7245a..7015cdefe6 100644
--- a/target/nios2/cpu.c
+++ b/target/nios2/cpu.c
@@ -87,7 +87,7 @@ Nios2CPU *cpu_nios2_init(const char *cpu_model)
 {
     Nios2CPU *cpu = NIOS2_CPU(object_new(TYPE_NIOS2_CPU));
 
-    object_property_set_bool(OBJECT(cpu), true, "realized", NULL);
+    object_property_set_bool(OBJECT(cpu), true, "realized", IGNORE_ERRORS);
 
     return cpu;
 }
diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c
index 670edde79e..bfa6b47b51 100644
--- a/target/ppc/kvm.c
+++ b/target/ppc/kvm.c
@@ -482,7 +482,8 @@ static void kvm_fixup_page_sizes(PowerPCCPU *cpu)
 bool kvmppc_is_mem_backend_page_size_ok(char *obj_path)
 {
     Object *mem_obj = object_resolve_path(obj_path, NULL);
-    char *mempath = object_property_get_str(mem_obj, "mem-path", NULL);
+    char *mempath = object_property_get_str(mem_obj, "mem-path",
+                                            IGNORE_ERRORS);
     long pagesize;
 
     if (mempath) {
diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c
index accef03234..75e5966749 100644
--- a/target/s390x/cpu.c
+++ b/target/s390x/cpu.c
@@ -287,7 +287,7 @@ static void s390_cpu_initfn(Object *obj)
     cs->halted = 1;
     cs->exception_index = EXCP_HLT;
     object_property_add(OBJECT(cpu), "id", "int64_t", s390x_cpu_get_id,
-                        s390x_cpu_set_id, NULL, NULL, NULL);
+                        s390x_cpu_set_id, NULL, NULL, IGNORE_ERRORS);
     s390_cpu_model_register_props(obj);
 #if !defined(CONFIG_USER_ONLY)
     qemu_get_timedate(&tm, 0);
diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c
index fc3cb25cc3..5206a10134 100644
--- a/target/s390x/cpu_models.c
+++ b/target/s390x/cpu_models.c
@@ -899,14 +899,17 @@ void s390_cpu_model_register_props(Object *obj)
     for (feat = 0; feat < S390_FEAT_MAX; feat++) {
         const S390FeatDef *def = s390_feat_def(feat);
         object_property_add(obj, def->name, "bool", get_feature,
-                            set_feature, NULL, (void *) feat, NULL);
-        object_property_set_description(obj, def->name, def->desc , NULL);
+                            set_feature, NULL, (void *) feat, IGNORE_ERRORS);
+        object_property_set_description(obj, def->name, def->desc ,
+                                        IGNORE_ERRORS);
     }
     for (group = 0; group < S390_FEAT_GROUP_MAX; group++) {
         const S390FeatGroupDef *def = s390_feat_group_def(group);
         object_property_add(obj, def->name, "bool", get_feature_group,
-                            set_feature_group, NULL, (void *) group, NULL);
-        object_property_set_description(obj, def->name, def->desc , NULL);
+                            set_feature_group, NULL, (void *) group,
+                            IGNORE_ERRORS);
+        object_property_set_description(obj, def->name, def->desc ,
+                                        IGNORE_ERRORS);
     }
 }
 
@@ -990,11 +993,11 @@ static char *get_description(Object *obj, Error **errp)
 void s390_cpu_model_class_register_props(ObjectClass *oc)
 {
     object_class_property_add_bool(oc, "migration-safe", get_is_migration_safe,
-                                   NULL, NULL);
+                                   NULL, IGNORE_ERRORS);
     object_class_property_add_bool(oc, "static", get_is_static,
-                                   NULL, NULL);
+                                   NULL, IGNORE_ERRORS);
     object_class_property_add_str(oc, "description", get_description, NULL,
-                                  NULL);
+                                  IGNORE_ERRORS);
 }
 
 #ifdef CONFIG_KVM
diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c
index 3383c49039..0979c1fc27 100644
--- a/target/s390x/kvm.c
+++ b/target/s390x/kvm.c
@@ -238,7 +238,7 @@ static void kvm_s390_init_aes_kw(void)
     uint64_t attr = KVM_S390_VM_CRYPTO_DISABLE_AES_KW;
 
     if (object_property_get_bool(OBJECT(qdev_get_machine()), "aes-key-wrap",
-                                 NULL)) {
+                                 IGNORE_ERRORS)) {
             attr = KVM_S390_VM_CRYPTO_ENABLE_AES_KW;
     }
 
@@ -252,7 +252,7 @@ static void kvm_s390_init_dea_kw(void)
     uint64_t attr = KVM_S390_VM_CRYPTO_DISABLE_DEA_KW;
 
     if (object_property_get_bool(OBJECT(qdev_get_machine()), "dea-key-wrap",
-                                 NULL)) {
+                                 IGNORE_ERRORS)) {
             attr = KVM_S390_VM_CRYPTO_ENABLE_DEA_KW;
     }
 
diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c
index d606eb53f4..4d6f0c4f66 100644
--- a/target/sparc/cpu.c
+++ b/target/sparc/cpu.c
@@ -157,7 +157,7 @@ SPARCCPU *cpu_sparc_init(const char *cpu_model)
         return NULL;
     }
 
-    object_property_set_bool(OBJECT(cpu), true, "realized", NULL);
+    object_property_set_bool(OBJECT(cpu), true, "realized", IGNORE_ERRORS);
 
     return cpu;
 }
diff --git a/target/tilegx/cpu.c b/target/tilegx/cpu.c
index 45326398cc..f8c479e1d7 100644
--- a/target/tilegx/cpu.c
+++ b/target/tilegx/cpu.c
@@ -58,7 +58,7 @@ TileGXCPU *cpu_tilegx_init(const char *cpu_model)
 
     cpu = TILEGX_CPU(object_new(TYPE_TILEGX_CPU));
 
-    object_property_set_bool(OBJECT(cpu), true, "realized", NULL);
+    object_property_set_bool(OBJECT(cpu), true, "realized", IGNORE_ERRORS);
 
     return cpu;
 }
diff --git a/target/xtensa/helper.c b/target/xtensa/helper.c
index 263990d621..ff7a3df05b 100644
--- a/target/xtensa/helper.c
+++ b/target/xtensa/helper.c
@@ -130,7 +130,7 @@ XtensaCPU *cpu_xtensa_init(const char *cpu_model)
 
     xtensa_irq_init(env);
 
-    object_property_set_bool(OBJECT(cpu), true, "realized", NULL);
+    object_property_set_bool(OBJECT(cpu), true, "realized", IGNORE_ERRORS);
 
     return cpu;
 }
diff --git a/tests/check-qom-proplist.c b/tests/check-qom-proplist.c
index 8e432e9ab6..6145fcbab6 100644
--- a/tests/check-qom-proplist.c
+++ b/tests/check-qom-proplist.c
@@ -126,7 +126,7 @@ static void dummy_init(Object *obj)
     object_property_add_bool(obj, "bv",
                              dummy_get_bv,
                              dummy_set_bv,
-                             NULL);
+                             IGNORE_ERRORS);
 }
 
 
@@ -135,17 +135,17 @@ static void dummy_class_init(ObjectClass *cls, void *data)
     object_class_property_add_bool(cls, "bv",
                                    dummy_get_bv,
                                    dummy_set_bv,
-                                   NULL);
+                                   IGNORE_ERRORS);
     object_class_property_add_str(cls, "sv",
                                   dummy_get_sv,
                                   dummy_set_sv,
-                                  NULL);
+                                  IGNORE_ERRORS);
     object_class_property_add_enum(cls, "av",
                                    "DummyAnimal",
                                    dummy_animal_map,
                                    dummy_get_av,
                                    dummy_set_av,
-                                   NULL);
+                                   IGNORE_ERRORS);
 }
 
 
@@ -250,13 +250,14 @@ static void dummy_dev_init(Object *obj)
     DummyBus *bus = DUMMY_BUS(object_new(TYPE_DUMMY_BUS));
     DummyBackend *backend = DUMMY_BACKEND(object_new(TYPE_DUMMY_BACKEND));
 
-    object_property_add_child(obj, "bus", OBJECT(bus), NULL);
+    object_property_add_child(obj, "bus", OBJECT(bus), IGNORE_ERRORS);
     dev->bus = bus;
-    object_property_add_child(OBJECT(bus), "backend", OBJECT(backend), NULL);
+    object_property_add_child(OBJECT(bus), "backend", OBJECT(backend),
+                              IGNORE_ERRORS);
     bus->backend = backend;
 
     object_property_add_link(obj, "backend", TYPE_DUMMY_BACKEND,
-                             (Object **)&bus->backend, NULL, 0, NULL);
+                             (Object **)&bus->backend, NULL, 0, IGNORE_ERRORS);
 }
 
 static void dummy_dev_unparent(Object *obj)
@@ -285,7 +286,7 @@ static void dummy_bus_init(Object *obj)
 static void dummy_bus_unparent(Object *obj)
 {
     DummyBus *bus = DUMMY_BUS(obj);
-    object_property_del(obj->parent, "backend", NULL);
+    object_property_del(obj->parent, "backend", IGNORE_ERRORS);
     object_unparent(OBJECT(bus->backend));
 }
 
diff --git a/tests/io-channel-helpers.c b/tests/io-channel-helpers.c
index 05e5579cf8..ccab10bfa9 100644
--- a/tests/io-channel-helpers.c
+++ b/tests/io-channel-helpers.c
@@ -80,7 +80,7 @@ static gpointer test_io_thread_writer(gpointer opaque)
     size_t niov = data->niov;
     struct iovec old = { 0 };
 
-    qio_channel_set_blocking(data->src, data->blocking, NULL);
+    qio_channel_set_blocking(data->src, data->blocking, IGNORE_ERRORS);
 
     while (niov) {
         ssize_t ret;
@@ -121,7 +121,7 @@ static gpointer test_io_thread_reader(gpointer opaque)
     size_t niov = data->niov;
     struct iovec old = { 0 };
 
-    qio_channel_set_blocking(data->dst, data->blocking, NULL);
+    qio_channel_set_blocking(data->dst, data->blocking, IGNORE_ERRORS);
 
     while (niov) {
         ssize_t ret;
diff --git a/tests/test-char.c b/tests/test-char.c
index dfe856cb85..5a9804bd92 100644
--- a/tests/test-char.c
+++ b/tests/test-char.c
@@ -245,7 +245,7 @@ static gboolean char_socket_test_idle(gpointer user_data)
 {
     SocketIdleData *data = user_data;
 
-    if (object_property_get_bool(OBJECT(data->chr), "connected", NULL)
+    if (object_property_get_bool(OBJECT(data->chr), "connected", IGNORE_ERRORS)
         == data->conn_expected) {
         quit = true;
         return FALSE;
diff --git a/tests/test-crypto-hash.c b/tests/test-crypto-hash.c
index f58eeb4409..7a163e5714 100644
--- a/tests/test-crypto-hash.c
+++ b/tests/test-crypto-hash.c
@@ -177,7 +177,7 @@ static void test_hash_iov(void)
                                   iov, 3,
                                   &result,
                                   &resultlen,
-                                  NULL);
+                                  IGNORE_ERRORS);
         g_assert(ret == 0);
         g_assert(resultlen == expected_lens[i]);
         for (j = 0; j < resultlen; j++) {
diff --git a/tests/test-io-channel-socket.c b/tests/test-io-channel-socket.c
index d357cd2a8e..25c9487656 100644
--- a/tests/test-io-channel-socket.c
+++ b/tests/test-io-channel-socket.c
@@ -160,7 +160,7 @@ static void test_io_channel_complete(QIOTask *task,
                                      gpointer opaque)
 {
     struct TestIOChannelData *data = opaque;
-    data->err = qio_task_propagate_error(task, NULL);
+    data->err = qio_task_propagate_error(task, IGNORE_ERRORS);
     g_main_loop_quit(data->loop);
 }
 
diff --git a/tests/test-io-channel-tls.c b/tests/test-io-channel-tls.c
index b55f5c81ff..fae2906060 100644
--- a/tests/test-io-channel-tls.c
+++ b/tests/test-io-channel-tls.c
@@ -60,7 +60,7 @@ static void test_tls_handshake_done(QIOTask *task,
     struct QIOChannelTLSHandshakeData *data = opaque;
 
     data->finished = true;
-    data->failed = qio_task_propagate_error(task, NULL);
+    data->failed = qio_task_propagate_error(task, IGNORE_ERRORS);
 }
 
 
@@ -187,8 +187,10 @@ static void test_io_channel_tls(const void *opaque)
      * thread, so we need these non-blocking to avoid deadlock
      * of ourselves
      */
-    qio_channel_set_blocking(QIO_CHANNEL(clientChanSock), false, NULL);
-    qio_channel_set_blocking(QIO_CHANNEL(serverChanSock), false, NULL);
+    qio_channel_set_blocking(QIO_CHANNEL(clientChanSock), false,
+                             IGNORE_ERRORS);
+    qio_channel_set_blocking(QIO_CHANNEL(serverChanSock), false,
+                             IGNORE_ERRORS);
 
     /* Now the real part of the test, setup the sessions */
     clientChanTLS = qio_channel_tls_new_client(
diff --git a/tests/test-qdev-global-props.c b/tests/test-qdev-global-props.c
index d5bfcac37d..91ea932869 100644
--- a/tests/test-qdev-global-props.c
+++ b/tests/test-qdev-global-props.c
@@ -135,9 +135,9 @@ static void prop2_accessor(Object *obj, Visitor *v, const char *name,
 static void dynamic_instance_init(Object *obj)
 {
     object_property_add(obj, "prop1", "uint32", prop1_accessor, prop1_accessor,
-                        NULL, NULL, NULL);
+                        NULL, NULL, IGNORE_ERRORS);
     object_property_add(obj, "prop2", "uint32", prop2_accessor, prop2_accessor,
-                        NULL, NULL, NULL);
+                        NULL, NULL, IGNORE_ERRORS);
 }
 
 static void dynamic_class_init(ObjectClass *oc, void *data)
diff --git a/tests/test-qemu-opts.c b/tests/test-qemu-opts.c
index cc1bb1afdf..5a596a6e7b 100644
--- a/tests/test-qemu-opts.c
+++ b/tests/test-qemu-opts.c
@@ -335,7 +335,7 @@ static void test_qemu_opt_unset(void)
     int ret;
 
     /* dynamically initialized (parsed) opts */
-    opts = qemu_opts_parse(&opts_list_03, "key=value", false, NULL);
+    opts = qemu_opts_parse(&opts_list_03, "key=value", false, IGNORE_ERRORS);
     g_assert(opts != NULL);
 
     /* check default/parsed value */
@@ -445,7 +445,7 @@ static size_t opts_count(QemuOpts *opts)
 {
     size_t n = 0;
 
-    qemu_opt_foreach(opts, opts_count_iter, &n, NULL);
+    qemu_opt_foreach(opts, opts_count_iter, &n, IGNORE_ERRORS);
     return n;
 }
 
diff --git a/tests/test-string-input-visitor.c b/tests/test-string-input-visitor.c
index 79313a7f7a..f44bfee8aa 100644
--- a/tests/test-string-input-visitor.c
+++ b/tests/test-string-input-visitor.c
@@ -318,25 +318,25 @@ static void test_visitor_in_fuzz(TestInputVisitorData *data,
         }
 
         v = visitor_input_test_init(data, buf);
-        visit_type_int(v, NULL, &ires, NULL);
+        visit_type_int(v, NULL, &ires, IGNORE_ERRORS);
 
         v = visitor_input_test_init(data, buf);
-        visit_type_intList(v, NULL, &ilres, NULL);
+        visit_type_intList(v, NULL, &ilres, IGNORE_ERRORS);
         qapi_free_intList(ilres);
 
         v = visitor_input_test_init(data, buf);
-        visit_type_bool(v, NULL, &bres, NULL);
+        visit_type_bool(v, NULL, &bres, IGNORE_ERRORS);
 
         v = visitor_input_test_init(data, buf);
-        visit_type_number(v, NULL, &nres, NULL);
+        visit_type_number(v, NULL, &nres, IGNORE_ERRORS);
 
         v = visitor_input_test_init(data, buf);
         sres = NULL;
-        visit_type_str(v, NULL, &sres, NULL);
+        visit_type_str(v, NULL, &sres, IGNORE_ERRORS);
         g_free(sres);
 
         v = visitor_input_test_init(data, buf);
-        visit_type_EnumOne(v, NULL, &eres, NULL);
+        visit_type_EnumOne(v, NULL, &eres, IGNORE_ERRORS);
     }
 }
 
diff --git a/tpm.c b/tpm.c
index 9a7c7114d3..d89b1e6cd6 100644
--- a/tpm.c
+++ b/tpm.c
@@ -208,7 +208,7 @@ void tpm_cleanup(void)
 int tpm_init(void)
 {
     if (qemu_opts_foreach(qemu_find_opts("tpmdev"),
-                          tpm_init_tpmdev, NULL, NULL)) {
+                          tpm_init_tpmdev, NULL, IGNORE_ERRORS)) {
         return -1;
     }
 
diff --git a/ui/gtk.c b/ui/gtk.c
index 18c325f8d4..49921fa5a5 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -738,7 +738,7 @@ static gboolean gd_window_close(GtkWidget *widget, GdkEvent *event,
             }
             unregister_displaychangelistener(&s->vc[i].gfx.dcl);
         }
-        qmp_quit(NULL);
+        qmp_quit(IGNORE_ERRORS);
         return FALSE;
     }
 
@@ -1175,25 +1175,25 @@ static void gd_menu_pause(GtkMenuItem *item, void *opaque)
         return;
     }
     if (runstate_is_running()) {
-        qmp_stop(NULL);
+        qmp_stop(IGNORE_ERRORS);
     } else {
-        qmp_cont(NULL);
+        qmp_cont(IGNORE_ERRORS);
     }
 }
 
 static void gd_menu_reset(GtkMenuItem *item, void *opaque)
 {
-    qmp_system_reset(NULL);
+    qmp_system_reset(IGNORE_ERRORS);
 }
 
 static void gd_menu_powerdown(GtkMenuItem *item, void *opaque)
 {
-    qmp_system_powerdown(NULL);
+    qmp_system_powerdown(IGNORE_ERRORS);
 }
 
 static void gd_menu_quit(GtkMenuItem *item, void *opaque)
 {
-    qmp_quit(NULL);
+    qmp_quit(IGNORE_ERRORS);
 }
 
 static void gd_menu_switch_vc(GtkMenuItem *item, void *opaque)
diff --git a/ui/input-linux.c b/ui/input-linux.c
index 49d52a69cc..6783ac1e5d 100644
--- a/ui/input-linux.c
+++ b/ui/input-linux.c
@@ -527,13 +527,13 @@ static void input_linux_instance_init(Object *obj)
 {
     object_property_add_str(obj, "evdev",
                             input_linux_get_evdev,
-                            input_linux_set_evdev, NULL);
+                            input_linux_set_evdev, IGNORE_ERRORS);
     object_property_add_bool(obj, "grab_all",
                              input_linux_get_grab_all,
-                             input_linux_set_grab_all, NULL);
+                             input_linux_set_grab_all, IGNORE_ERRORS);
     object_property_add_bool(obj, "repeat",
                              input_linux_get_repeat,
-                             input_linux_set_repeat, NULL);
+                             input_linux_set_repeat, IGNORE_ERRORS);
 }
 
 static void input_linux_class_init(ObjectClass *oc, void *data)
diff --git a/ui/spice-core.c b/ui/spice-core.c
index 801e5c864a..88d6d16faf 100644
--- a/ui/spice-core.c
+++ b/ui/spice-core.c
@@ -803,7 +803,7 @@ void qemu_spice_init(void)
     spice_server_set_playback_compression
         (spice_server, qemu_opt_get_bool(opts, "playback-compression", 1));
 
-    qemu_opt_foreach(opts, add_channel, &tls_port, NULL);
+    qemu_opt_foreach(opts, add_channel, &tls_port, IGNORE_ERRORS);
 
     spice_server_set_name(spice_server, qemu_name);
     spice_server_set_uuid(spice_server, (unsigned char *)&qemu_uuid);
diff --git a/ui/vnc-auth-sasl.c b/ui/vnc-auth-sasl.c
index 3ade4a4918..4b6f0e5d5a 100644
--- a/ui/vnc-auth-sasl.c
+++ b/ui/vnc-auth-sasl.c
@@ -530,12 +530,12 @@ void start_auth_sasl(VncState *vs)
     VNC_DEBUG("Initialize SASL auth %p\n", vs->ioc);
 
     /* Get local & remote client addresses in form  IPADDR;PORT */
-    localAddr = vnc_socket_ip_addr_string(vs->sioc, true, NULL);
+    localAddr = vnc_socket_ip_addr_string(vs->sioc, true, IGNORE_ERRORS);
     if (!localAddr) {
         goto authabort;
     }
 
-    remoteAddr = vnc_socket_ip_addr_string(vs->sioc, false, NULL);
+    remoteAddr = vnc_socket_ip_addr_string(vs->sioc, false, IGNORE_ERRORS);
     if (!remoteAddr) {
         g_free(localAddr);
         goto authabort;
diff --git a/ui/vnc.c b/ui/vnc.c
index cb55554210..7acd3fe225 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -568,7 +568,7 @@ VncInfo2List *qmp_query_vnc_servers(Error **errp)
                        &info->vencrypt, &info->has_vencrypt);
         if (vd->dcl.con) {
             dev = DEVICE(object_property_get_link(OBJECT(vd->dcl.con),
-                                                  "device", NULL));
+                                                  "device", IGNORE_ERRORS));
             info->has_display = true;
             info->display = g_strdup(dev->id);
         }
@@ -1123,7 +1123,7 @@ static void vnc_disconnect_start(VncState *vs)
     if (vs->ioc_tag) {
         g_source_remove(vs->ioc_tag);
     }
-    qio_channel_close(vs->ioc, NULL);
+    qio_channel_close(vs->ioc, IGNORE_ERRORS);
     vs->disconnecting = TRUE;
 }
 
@@ -2937,7 +2937,7 @@ static void vnc_connect(VncDisplay *vd, QIOChannelSocket *sioc,
 
     VNC_DEBUG("New client on socket %p\n", vs->sioc);
     update_displaychangelistener(&vd->dcl, VNC_REFRESH_INTERVAL_BASE);
-    qio_channel_set_blocking(vs->ioc, false, NULL);
+    qio_channel_set_blocking(vs->ioc, false, IGNORE_ERRORS);
     if (websocket) {
         vs->websocket = 1;
         if (vd->tlscreds) {
@@ -4022,7 +4022,7 @@ void vnc_display_add_client(const char *id, int csock, bool skipauth)
         return;
     }
 
-    sioc = qio_channel_socket_new_fd(csock, NULL);
+    sioc = qio_channel_socket_new_fd(csock, IGNORE_ERRORS);
     if (sioc) {
         qio_channel_set_name(QIO_CHANNEL(sioc), "vnc-server");
         vnc_connect(vd, sioc, skipauth, false);
diff --git a/util/qemu-config.c b/util/qemu-config.c
index c74f15c42d..be9ffb5872 100644
--- a/util/qemu-config.c
+++ b/util/qemu-config.c
@@ -368,7 +368,7 @@ static int config_write_opts(void *opaque, QemuOpts *opts, Error **errp)
     } else {
         fprintf(data->fp, "[%s]\n", data->list->name);
     }
-    qemu_opt_foreach(opts, config_write_opt, data, NULL);
+    qemu_opt_foreach(opts, config_write_opt, data, IGNORE_ERRORS);
     fprintf(data->fp, "\n");
     return 0;
 }
@@ -382,7 +382,7 @@ void qemu_config_write(FILE *fp)
     fprintf(fp, "# qemu config file\n\n");
     for (i = 0; lists[i] != NULL; i++) {
         data.list = lists[i];
-        qemu_opts_foreach(data.list, config_write_opts, &data, NULL);
+        qemu_opts_foreach(data.list, config_write_opts, &data, IGNORE_ERRORS);
     }
 }
 
@@ -413,7 +413,7 @@ int qemu_config_parse(FILE *fp, QemuOptsList **lists, const char *fname)
                 error_report_err(local_err);
                 goto out;
             }
-            opts = qemu_opts_create(list, id, 1, NULL);
+            opts = qemu_opts_create(list, id, 1, IGNORE_ERRORS);
             continue;
         }
         if (sscanf(line, "[%63[^]]]", group) == 1) {
diff --git a/util/qemu-option.c b/util/qemu-option.c
index 5977bfc3e9..a7e62593b1 100644
--- a/util/qemu-option.c
+++ b/util/qemu-option.c
@@ -929,7 +929,7 @@ void qemu_opts_set_defaults(QemuOptsList *list, const char *params,
 {
     QemuOpts *opts;
 
-    opts = opts_parse(list, params, permit_abbrev, true, NULL);
+    opts = opts_parse(list, params, permit_abbrev, true, IGNORE_ERRORS);
     assert(opts);
 }
 
diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c
index 82290cb687..d2ea5377dc 100644
--- a/util/qemu-sockets.c
+++ b/util/qemu-sockets.c
@@ -306,7 +306,8 @@ static void wait_for_connect(void *opaque)
     if (s->current_addr) {
         while (s->current_addr->ai_next != NULL && s->fd < 0) {
             s->current_addr = s->current_addr->ai_next;
-            s->fd = inet_connect_addr(s->current_addr, &in_progress, s, NULL);
+            s->fd = inet_connect_addr(s->current_addr, &in_progress, s,
+                                      IGNORE_ERRORS);
             if (s->fd < 0) {
                 error_free(err);
                 err = NULL;
diff --git a/vl.c b/vl.c
index be4dcf25ba..a7ad0cbd0c 100644
--- a/vl.c
+++ b/vl.c
@@ -2566,7 +2566,7 @@ static int sclp_parse(const char *devname)
 
     assert(arch_type == QEMU_ARCH_S390X);
 
-    dev_opts = qemu_opts_create(device, NULL, 0, NULL);
+    dev_opts = qemu_opts_create(device, NULL, 0, IGNORE_ERRORS);
     qemu_opt_set(dev_opts, "driver", "sclpconsole", &error_abort);
 
     snprintf(label, sizeof(label), "sclpcon%d", index);
@@ -2589,7 +2589,8 @@ static int debugcon_parse(const char *devname)
     if (!qemu_chr_new("debugcon", devname)) {
         exit(1);
     }
-    opts = qemu_opts_create(qemu_find_opts("device"), "debugcon", 1, NULL);
+    opts = qemu_opts_create(qemu_find_opts("device"), "debugcon", 1,
+                            IGNORE_ERRORS);
     if (!opts) {
         error_report("already have a debugcon device");
         exit(1);
--
2.11.0.259.g40922b1


Reply | Threaded
Open this post in threaded view
|

[RFC 05/15] qapi: Use IGNORE_ERRORS instead of NULL on generated code

Eduardo Habkost-2
In reply to this post by Eduardo Habkost-2
Signed-off-by: Eduardo Habkost <[hidden email]>
---
 scripts/qapi-commands.py | 6 +++---
 scripts/qapi-types.py    | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/scripts/qapi-commands.py b/scripts/qapi-commands.py
index 1943de4852..afa58915ba 100644
--- a/scripts/qapi-commands.py
+++ b/scripts/qapi-commands.py
@@ -75,7 +75,7 @@ static void qmp_marshal_output_%(c_name)s(%(c_type)s ret_in, QObject **ret_out,
     error_propagate(errp, err);
     visit_free(v);
     v = qapi_dealloc_visitor_new();
-    visit_type_%(c_name)s(v, "unused", &ret_in, NULL);
+    visit_type_%(c_name)s(v, "unused", &ret_in, IGNORE_ERRORS);
     visit_free(v);
 }
 ''',
@@ -162,7 +162,7 @@ out:
 ''')
 
     if have_args:
-        visit_members = ('visit_type_%s_members(v, &arg, NULL);'
+        visit_members = ('visit_type_%s_members(v, &arg, IGNORE_ERRORS);'
                          % arg_type.c_name())
     else:
         visit_members = ''
@@ -173,7 +173,7 @@ out:
 
     ret += mcgen('''
     v = qapi_dealloc_visitor_new();
-    visit_start_struct(v, NULL, NULL, 0, NULL);
+    visit_start_struct(v, NULL, NULL, 0, IGNORE_ERRORS);
     %(visit_members)s
     visit_end_struct(v, NULL);
     visit_free(v);
diff --git a/scripts/qapi-types.py b/scripts/qapi-types.py
index 814ac672be..ab78fa56e9 100644
--- a/scripts/qapi-types.py
+++ b/scripts/qapi-types.py
@@ -157,7 +157,7 @@ void qapi_free_%(c_name)s(%(c_name)s *obj)
     }
 
     v = qapi_dealloc_visitor_new();
-    visit_type_%(c_name)s(v, NULL, &obj, NULL);
+    visit_type_%(c_name)s(v, NULL, &obj, IGNORE_ERRORS);
     visit_free(v);
 }
 ''',
--
2.11.0.259.g40922b1


Reply | Threaded
Open this post in threaded view
|

[RFC 06/15] test-qapi-util: Use IGNORE_ERRORS instead of NULL

Eduardo Habkost-2
In reply to this post by Eduardo Habkost-2
Signed-off-by: Eduardo Habkost <[hidden email]>
---
 tests/test-qapi-util.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/tests/test-qapi-util.c b/tests/test-qapi-util.c
index 3695034c32..374fa30078 100644
--- a/tests/test-qapi-util.c
+++ b/tests/test-qapi-util.c
@@ -25,7 +25,7 @@ static void test_qapi_enum_parse(void)
     g_assert_cmpint(ret, ==, QTYPE_NONE);
 
     ret = qapi_enum_parse(QType_lookup, "junk", QTYPE__MAX, -1,
-                          NULL);
+                          IGNORE_ERRORS);
     g_assert_cmpint(ret, ==, -1);
 
     ret = qapi_enum_parse(QType_lookup, "junk", QTYPE__MAX, -1,
@@ -137,14 +137,14 @@ static void test_error_api(void)
 {
     Error *err = NULL;
 
-    successfn(NULL);
-    test_propagate(successfn, NULL);
+    successfn(IGNORE_ERRORS);
+    test_propagate(successfn, IGNORE_ERRORS);
 
-    fail1(NULL);
-    test_propagate(fail1, NULL);
+    fail1(IGNORE_ERRORS);
+    test_propagate(fail1, IGNORE_ERRORS);
 
-    multifn(NULL);
-    test_propagate(multifn, NULL);
+    multifn(IGNORE_ERRORS);
+    test_propagate(multifn, IGNORE_ERRORS);
 
     successfn(&err);
     g_assert(!err);
--
2.11.0.259.g40922b1


Reply | Threaded
Open this post in threaded view
|

[RFC 07/15] Manual changes to use IGNORE_ERRORS instead of NULL

Eduardo Habkost-2
In reply to this post by Eduardo Habkost-2
These cases were missed by the Coccinelle script for some, reason, so I
fixed them manually.

Signed-off-by: Eduardo Habkost <[hidden email]>
---
 block/crypto.c         |  4 ++--
 block/qcow2.c          |  2 +-
 block/snapshot.c       |  2 +-
 hw/acpi/cpu.c          |  2 +-
 hw/core/qdev.c         |  8 ++++----
 hw/isa/lpc_ich9.c      |  2 +-
 hw/ppc/spapr_drc.c     |  6 +++---
 hw/s390x/css.c         |  2 +-
 hw/vfio/ccw.c          |  2 +-
 hw/watchdog/watchdog.c |  2 +-
 hw/xen/xen_backend.c   |  4 ++--
 migration/colo.c       |  4 ++--
 migration/rdma.c       |  2 +-
 monitor.c              |  4 ++--
 nbd/server.c           |  2 +-
 net/net.c              |  2 +-
 qapi/opts-visitor.c    |  2 +-
 vl.c                   | 50 +++++++++++++++++++++++++-------------------------
 18 files changed, 51 insertions(+), 51 deletions(-)

diff --git a/block/crypto.c b/block/crypto.c
index f317eda83f..5c2687d271 100644
--- a/block/crypto.c
+++ b/block/crypto.c
@@ -449,7 +449,7 @@ block_crypto_co_readv(BlockDriverState *bs, int64_t sector_num,
         if (qcrypto_block_decrypt(crypto->block,
                                   sector_num,
                                   cipher_data, cur_nr_sectors * 512,
-                                  NULL) < 0) {
+                                  IGNORE_ERRORS) < 0) {
             ret = -EIO;
             goto cleanup;
         }
@@ -510,7 +510,7 @@ block_crypto_co_writev(BlockDriverState *bs, int64_t sector_num,
         if (qcrypto_block_encrypt(crypto->block,
                                   sector_num,
                                   cipher_data, cur_nr_sectors * 512,
-                                  NULL) < 0) {
+                                  IGNORE_ERRORS) < 0) {
             ret = -EIO;
             goto cleanup;
         }
diff --git a/block/qcow2.c b/block/qcow2.c
index aa0dc46162..53920a83b5 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -2602,7 +2602,7 @@ qcow2_co_pwritev_compressed(BlockDriverState *bs, uint64_t offset,
         /* align end of file to a sector boundary to ease reading with
            sector based I/Os */
         cluster_offset = bdrv_getlength(bs->file->bs);
-        return bdrv_truncate(bs->file, cluster_offset, NULL);
+        return bdrv_truncate(bs->file, cluster_offset, IGNORE_ERRORS);
     }
 
     buf = qemu_blockalign(bs, s->cluster_size);
diff --git a/block/snapshot.c b/block/snapshot.c
index a46564e7b7..244fdc2bb6 100644
--- a/block/snapshot.c
+++ b/block/snapshot.c
@@ -207,7 +207,7 @@ int bdrv_snapshot_goto(BlockDriverState *bs,
         bs->file = NULL;
 
         ret = bdrv_snapshot_goto(file, snapshot_id);
-        open_ret = drv->bdrv_open(bs, options, bs->open_flags, NULL);
+        open_ret = drv->bdrv_open(bs, options, bs->open_flags, IGNORE_ERRORS);
         QDECREF(options);
         if (open_ret < 0) {
             bdrv_unref(file);
diff --git a/hw/acpi/cpu.c b/hw/acpi/cpu.c
index a233fe17cf..6dc138db89 100644
--- a/hw/acpi/cpu.c
+++ b/hw/acpi/cpu.c
@@ -125,7 +125,7 @@ static void cpu_hotplug_wr(void *opaque, hwaddr addr, uint64_t data,
             trace_cpuhp_acpi_ejecting_cpu(cpu_st->selector);
             dev = DEVICE(cdev->cpu);
             hotplug_ctrl = qdev_get_hotplug_handler(dev);
-            hotplug_handler_unplug(hotplug_ctrl, dev, NULL);
+            hotplug_handler_unplug(hotplug_ctrl, dev, IGNORE_ERRORS);
         }
         break;
     case ACPI_CPU_CMD_OFFSET_WR:
diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index faa4af0dc3..163e827e01 100644
--- a/hw/core/qdev.c
+++ b/hw/core/qdev.c
@@ -952,9 +952,9 @@ static void device_set_realized(Object *obj, bool value, Error **errp)
         }
         dev->pending_deleted_event = false;
     } else if (!value && dev->realized) {
-        Error **local_errp = NULL;
+        Error **local_errp = IGNORE_ERRORS;
         QLIST_FOREACH(bus, &dev->child_bus, sibling) {
-            local_errp = local_err ? NULL : &local_err;
+            local_errp = local_err ? IGNORE_ERRORS : &local_err;
             object_property_set_bool(OBJECT(bus), false, "realized",
                                      local_errp);
         }
@@ -962,7 +962,7 @@ static void device_set_realized(Object *obj, bool value, Error **errp)
             vmstate_unregister(dev, qdev_get_vmsd(dev), dev);
         }
         if (dc->unrealize) {
-            local_errp = local_err ? NULL : &local_err;
+            local_errp = local_err ? IGNORE_ERRORS : &local_err;
             dc->unrealize(dev, local_errp);
         }
         dev->pending_deleted_event = true;
@@ -988,7 +988,7 @@ child_realize_fail:
 
 post_realize_fail:
     if (dc->unrealize) {
-        dc->unrealize(dev, NULL);
+        dc->unrealize(dev, IGNORE_ERRORS);
     }
 
 fail:
diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c
index 99a136d05a..ffa8f3ba03 100644
--- a/hw/isa/lpc_ich9.c
+++ b/hw/isa/lpc_ich9.c
@@ -659,7 +659,7 @@ static void ich9_lpc_add_properties(ICH9LPCState *lpc)
     object_property_add_uint8_ptr(OBJECT(lpc), ACPI_PM_PROP_ACPI_DISABLE_CMD,
                                   &acpi_disable_cmd, IGNORE_ERRORS);
 
-    ich9_pm_add_properties(OBJECT(lpc), &lpc->pm, NULL);
+    ich9_pm_add_properties(OBJECT(lpc), &lpc->pm, IGNORE_ERRORS);
 }
 
 static void ich9_lpc_initfn(Object *obj)
diff --git a/hw/ppc/spapr_drc.c b/hw/ppc/spapr_drc.c
index d7d0c0ee8e..1b0a7546fb 100644
--- a/hw/ppc/spapr_drc.c
+++ b/hw/ppc/spapr_drc.c
@@ -105,7 +105,7 @@ static uint32_t set_isolation_state(sPAPRDRConnector *drc,
             uint32_t drc_index = spapr_drc_index(drc);
             if (drc->configured) {
                 trace_spapr_drc_set_isolation_state_finalizing(drc_index);
-                drck->detach(drc, DEVICE(drc->dev), NULL);
+                drck->detach(drc, DEVICE(drc->dev), IGNORE_ERRORS);
             } else {
                 trace_spapr_drc_set_isolation_state_deferring(drc_index);
             }
@@ -159,7 +159,7 @@ static uint32_t set_allocation_state(sPAPRDRConnector *drc,
             drc->allocation_state == SPAPR_DR_ALLOCATION_STATE_UNUSABLE) {
             uint32_t drc_index = spapr_drc_index(drc);
             trace_spapr_drc_set_allocation_state_finalizing(drc_index);
-            drck->detach(drc, DEVICE(drc->dev), NULL);
+            drck->detach(drc, DEVICE(drc->dev), IGNORE_ERRORS);
         } else if (drc->allocation_state == SPAPR_DR_ALLOCATION_STATE_USABLE) {
             drc->awaiting_allocation = false;
         }
@@ -467,7 +467,7 @@ static void reset(DeviceState *d)
          * force removal if we are
          */
         if (drc->awaiting_release) {
-            drck->detach(drc, DEVICE(drc->dev), NULL);
+            drck->detach(drc, DEVICE(drc->dev), IGNORE_ERRORS);
         }
 
         /* non-PCI devices may be awaiting a transition to UNUSABLE */
diff --git a/hw/s390x/css.c b/hw/s390x/css.c
index 1e2f26b65a..c39e65f206 100644
--- a/hw/s390x/css.c
+++ b/hw/s390x/css.c
@@ -2070,7 +2070,7 @@ SubchDev *css_create_sch(CssDevId bus_id, bool is_virtual, bool squash_mcss,
 
             if   (css_find_free_subch_and_devno(bus_id.cssid, &bus_id.ssid,
                                                 &bus_id.devid, &schid,
-                                                NULL)) {
+                                                IGNORE_ERRORS)) {
                 break;
             }
             if (bus_id.cssid == MAX_CSSID) {
diff --git a/hw/vfio/ccw.c b/hw/vfio/ccw.c
index 12d0262336..d8dfbe321a 100644
--- a/hw/vfio/ccw.c
+++ b/hw/vfio/ccw.c
@@ -370,7 +370,7 @@ out_device_err:
     vfio_put_group(group);
 out_group_err:
     if (cdc->unrealize) {
-        cdc->unrealize(cdev, NULL);
+        cdc->unrealize(cdev, IGNORE_ERRORS);
     }
 out_err_propagate:
     error_propagate(errp, err);
diff --git a/hw/watchdog/watchdog.c b/hw/watchdog/watchdog.c
index 2c3b2bb418..60ad3fe113 100644
--- a/hw/watchdog/watchdog.c
+++ b/hw/watchdog/watchdog.c
@@ -144,7 +144,7 @@ void watchdog_perform_action(void)
     case WDT_NMI:
         qapi_event_send_watchdog(WATCHDOG_EXPIRATION_ACTION_INJECT_NMI,
                                  &error_abort);
-        nmi_monitor_handle(0, NULL);
+        nmi_monitor_handle(0, IGNORE_ERRORS);
         break;
     }
 }
diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c
index c46cbb0759..b3450e01e0 100644
--- a/hw/xen/xen_backend.c
+++ b/hw/xen/xen_backend.c
@@ -143,7 +143,7 @@ static struct XenDevice *xen_be_get_xendev(const char *type, int dom, int dev,
     xendev->evtchndev = xenevtchn_open(NULL, 0);
     if (xendev->evtchndev == NULL) {
         xen_pv_printf(NULL, 0, "can't open evtchn device\n");
-        qdev_unplug(DEVICE(xendev), NULL);
+        qdev_unplug(DEVICE(xendev), IGNORE_ERRORS);
         return NULL;
     }
     qemu_set_cloexec(xenevtchn_fd(xendev->evtchndev));
@@ -153,7 +153,7 @@ static struct XenDevice *xen_be_get_xendev(const char *type, int dom, int dev,
         if (xendev->gnttabdev == NULL) {
             xen_pv_printf(NULL, 0, "can't open gnttab device\n");
             xenevtchn_close(xendev->evtchndev);
-            qdev_unplug(DEVICE(xendev), NULL);
+            qdev_unplug(DEVICE(xendev), IGNORE_ERRORS);
             return NULL;
         }
     } else {
diff --git a/migration/colo.c b/migration/colo.c
index d623d801e7..a68e6e9cdf 100644
--- a/migration/colo.c
+++ b/migration/colo.c
@@ -175,7 +175,7 @@ void qmp_xen_set_replication(bool enable, bool primary,
         if (!has_failover) {
             failover = NULL;
         }
-        replication_stop_all(failover, failover ? NULL : errp);
+        replication_stop_all(failover, failover ? IGNORE_ERRORS : errp);
     }
 #else
     abort();
@@ -641,7 +641,7 @@ void *colo_process_incoming_thread(void *opaque)
         if (failover_get_state() == FAILOVER_STATUS_RELAUNCH) {
             failover_set_state(FAILOVER_STATUS_RELAUNCH,
                             FAILOVER_STATUS_NONE);
-            failover_request_active(NULL);
+            failover_request_active(IGNORE_ERRORS);
             goto out;
         }
 
diff --git a/migration/rdma.c b/migration/rdma.c
index e446c6fd6a..a33edbf29b 100644
--- a/migration/rdma.c
+++ b/migration/rdma.c
@@ -2509,7 +2509,7 @@ static void *qemu_rdma_data_init(const char *host_port, Error **errp)
         rdma->current_chunk = -1;
 
         addr = g_new(InetSocketAddress, 1);
-        if (!inet_parse(addr, host_port, NULL)) {
+        if (!inet_parse(addr, host_port, IGNORE_ERRORS)) {
             rdma->port = atoi(addr->port);
             rdma->host = g_strdup(addr->host);
         } else {
diff --git a/monitor.c b/monitor.c
index c262311fdd..7c4327a175 100644
--- a/monitor.c
+++ b/monitor.c
@@ -3467,7 +3467,7 @@ void netdev_del_completion(ReadLineState *rs, int nb_args, const char *str)
         if (strncmp(str, name, len)) {
             continue;
         }
-        opts = qemu_opts_find(qemu_find_opts_err("netdev", NULL), name);
+        opts = qemu_opts_find(qemu_find_opts_err("netdev", IGNORE_ERRORS), name);
         if (opts) {
             readline_add_completion(rs, name);
         }
@@ -3642,7 +3642,7 @@ static void vm_completion(ReadLineState *rs, const char *str)
 
         aio_context_acquire(ctx);
         if (bdrv_can_snapshot(bs)) {
-            ok = bdrv_query_snapshot_info_list(bs, &snapshots, NULL) == 0;
+            ok = bdrv_query_snapshot_info_list(bs, &snapshots, IGNORE_ERRORS) == 0;
         }
         aio_context_release(ctx);
         if (!ok) {
diff --git a/nbd/server.c b/nbd/server.c
index 8631fa55a3..b617ad5a4b 100644
--- a/nbd/server.c
+++ b/nbd/server.c
@@ -388,7 +388,7 @@ static QIOChannel *nbd_negotiate_handle_starttls(NBDClient *client,
     tioc = qio_channel_tls_new_server(ioc,
                                       client->tlscreds,
                                       client->tlsaclname,
-                                      NULL);
+                                      IGNORE_ERRORS);
     if (!tioc) {
         return NULL;
     }
diff --git a/net/net.c b/net/net.c
index 9d0f1119cc..b7f5459b33 100644
--- a/net/net.c
+++ b/net/net.c
@@ -1248,7 +1248,7 @@ void qmp_netdev_del(const char *id, Error **errp)
         return;
     }
 
-    opts = qemu_opts_find(qemu_find_opts_err("netdev", NULL), id);
+    opts = qemu_opts_find(qemu_find_opts_err("netdev", IGNORE_ERRORS), id);
     if (!opts) {
         error_setg(errp, "Device '%s' is not a netdev", id);
         return;
diff --git a/qapi/opts-visitor.c b/qapi/opts-visitor.c
index 324b197495..3e408e4bf0 100644
--- a/qapi/opts-visitor.c
+++ b/qapi/opts-visitor.c
@@ -516,7 +516,7 @@ opts_optional(Visitor *v, const char *name, bool *present)
 
     /* we only support a single mandatory scalar field in a list node */
     assert(ov->list_mode == LM_NONE);
-    *present = (lookup_distinct(ov, name, NULL) != NULL);
+    *present = (lookup_distinct(ov, name, IGNORE_ERRORS) != NULL);
 }
 
 
diff --git a/vl.c b/vl.c
index a7ad0cbd0c..32068db274 100644
--- a/vl.c
+++ b/vl.c
@@ -1176,7 +1176,7 @@ static void default_drive(int enable, int snapshot, BlockInterfaceType type,
 
     opts = drive_add(type, index, NULL, optstr);
     if (snapshot) {
-        drive_enable_snapshot(NULL, opts, NULL);
+        drive_enable_snapshot(NULL, opts, IGNORE_ERRORS);
     }
 
     dinfo = drive_new(opts, type);
@@ -1352,12 +1352,12 @@ static inline void semihosting_arg_fallback(const char *file, const char *cmd)
     char *cmd_token;
 
     /* argv[0] */
-    add_semihosting_arg(&semihosting, "arg", file, NULL);
+    add_semihosting_arg(&semihosting, "arg", file, IGNORE_ERRORS);
 
     /* split -append and initialize argv[1..n] */
     cmd_token = strtok(g_strdup(cmd), " ");
     while (cmd_token) {
-        add_semihosting_arg(&semihosting, "arg", cmd_token, NULL);
+        add_semihosting_arg(&semihosting, "arg", cmd_token, IGNORE_ERRORS);
         cmd_token = strtok(NULL, " ");
     }
 }
@@ -3556,7 +3556,7 @@ int main(int argc, char **argv, char **envp)
                 fsdev = qemu_opts_create(qemu_find_opts("fsdev"),
                                          qemu_opts_id(opts) ?:
                                          qemu_opt_get(opts, "mount_tag"),
-                                         1, NULL);
+                                         1, IGNORE_ERRORS);
                 if (!fsdev) {
                     error_report("duplicate or invalid fsdev id: %s",
                                  qemu_opt_get(opts, "mount_tag"));
@@ -3606,7 +3606,7 @@ int main(int argc, char **argv, char **envp)
                 QemuOpts *device;
 
                 fsdev = qemu_opts_create(qemu_find_opts("fsdev"), "v_synth",
-                                         1, NULL);
+                                         1, IGNORE_ERRORS);
                 if (!fsdev) {
                     error_report("duplicate option: %s", "virtfs_synth");
                     exit(1);
@@ -3875,7 +3875,7 @@ int main(int argc, char **argv, char **envp)
                     }
                     /* Set semihosting argument count and vector */
                     qemu_opt_foreach(opts, add_semihosting_arg,
-                                     &semihosting, NULL);
+                                     &semihosting, IGNORE_ERRORS);
                 } else {
                     error_report("unsupported semihosting-config %s", optarg);
                     exit(1);
@@ -4107,23 +4107,23 @@ int main(int argc, char **argv, char **envp)
     }
 
     if (qemu_opts_foreach(qemu_find_opts("sandbox"),
-                          parse_sandbox, NULL, NULL)) {
+                          parse_sandbox, NULL, IGNORE_ERRORS)) {
         exit(1);
     }
 
     if (qemu_opts_foreach(qemu_find_opts("name"),
-                          parse_name, NULL, NULL)) {
+                          parse_name, NULL, IGNORE_ERRORS)) {
         exit(1);
     }
 
 #ifndef _WIN32
     if (qemu_opts_foreach(qemu_find_opts("add-fd"),
-                          parse_add_fd, NULL, NULL)) {
+                          parse_add_fd, NULL, IGNORE_ERRORS)) {
         exit(1);
     }
 
     if (qemu_opts_foreach(qemu_find_opts("add-fd"),
-                          cleanup_add_fd, NULL, NULL)) {
+                          cleanup_add_fd, NULL, IGNORE_ERRORS)) {
         exit(1);
     }
 #endif
@@ -4220,9 +4220,9 @@ int main(int argc, char **argv, char **envp)
     }
 
     qemu_opts_foreach(qemu_find_opts("device"),
-                      default_driver_check, NULL, NULL);
+                      default_driver_check, NULL, IGNORE_ERRORS);
     qemu_opts_foreach(qemu_find_opts("global"),
-                      default_driver_check, NULL, NULL);
+                      default_driver_check, NULL, IGNORE_ERRORS);
 
     if (!vga_model && !default_vga) {
         vga_interface_type = VGA_DEVICE;
@@ -4364,30 +4364,30 @@ int main(int argc, char **argv, char **envp)
 
     if (qemu_opts_foreach(qemu_find_opts("object"),
                           user_creatable_add_opts_foreach,
-                          object_create_initial, NULL)) {
+                          object_create_initial, IGNORE_ERRORS)) {
         exit(1);
     }
 
     if (qemu_opts_foreach(qemu_find_opts("chardev"),
-                          chardev_init_func, NULL, NULL)) {
+                          chardev_init_func, NULL, IGNORE_ERRORS)) {
         exit(1);
     }
 
 #ifdef CONFIG_VIRTFS
     if (qemu_opts_foreach(qemu_find_opts("fsdev"),
-                          fsdev_init_func, NULL, NULL)) {
+                          fsdev_init_func, NULL, IGNORE_ERRORS)) {
         exit(1);
     }
 #endif
 
     if (qemu_opts_foreach(qemu_find_opts("device"),
-                          device_help_func, NULL, NULL)) {
+                          device_help_func, NULL, IGNORE_ERRORS)) {
         exit(0);
     }
 
     machine_opts = qemu_get_machine_opts();
     if (qemu_opt_foreach(machine_opts, machine_set_property, current_machine,
-                         NULL)) {
+                         IGNORE_ERRORS)) {
         object_unref(OBJECT(current_machine));
         exit(1);
     }
@@ -4479,7 +4479,7 @@ int main(int argc, char **argv, char **envp)
 
     if (qemu_opts_foreach(qemu_find_opts("object"),
                           user_creatable_add_opts_foreach,
-                          object_create_delayed, NULL)) {
+                          object_create_delayed, IGNORE_ERRORS)) {
         exit(1);
     }
 
@@ -4524,10 +4524,10 @@ int main(int argc, char **argv, char **envp)
     }
     if (snapshot || replay_mode != REPLAY_MODE_NONE) {
         qemu_opts_foreach(qemu_find_opts("drive"), drive_enable_snapshot,
-                          NULL, NULL);
+                          NULL, IGNORE_ERRORS);
     }
     if (qemu_opts_foreach(qemu_find_opts("drive"), drive_init_func,
-                          &machine_class->block_default_type, NULL)) {
+                          &machine_class->block_default_type, IGNORE_ERRORS)) {
         exit(1);
     }
 
@@ -4539,7 +4539,7 @@ int main(int argc, char **argv, char **envp)
     parse_numa_opts(current_machine);
 
     if (qemu_opts_foreach(qemu_find_opts("mon"),
-                          mon_init_func, NULL, NULL)) {
+                          mon_init_func, NULL, IGNORE_ERRORS)) {
         exit(1);
     }
 
@@ -4578,7 +4578,7 @@ int main(int argc, char **argv, char **envp)
     machine_register_compat_props(current_machine);
 
     qemu_opts_foreach(qemu_find_opts("global"),
-                      global_init_func, NULL, NULL);
+                      global_init_func, NULL, IGNORE_ERRORS);
 
     /* This checkpoint is required by replay to separate prior clock
        reading from the other reads, because timer polling functions query
@@ -4603,7 +4603,7 @@ int main(int argc, char **argv, char **envp)
     }
 
     if (qemu_opts_foreach(qemu_find_opts("fw_cfg"),
-                          parse_fw_cfg, fw_cfg_find(), NULL) != 0) {
+                          parse_fw_cfg, fw_cfg_find(), IGNORE_ERRORS) != 0) {
         exit(1);
     }
 
@@ -4619,7 +4619,7 @@ int main(int argc, char **argv, char **envp)
     /* init generic devices */
     rom_set_order_override(FW_CFG_ORDER_OVERRIDE_DEVICE);
     if (qemu_opts_foreach(qemu_find_opts("device"),
-                          device_init_func, NULL, NULL)) {
+                          device_init_func, NULL, IGNORE_ERRORS)) {
         exit(1);
     }
 
@@ -4683,7 +4683,7 @@ int main(int argc, char **argv, char **envp)
     /* init remote displays */
 #ifdef CONFIG_VNC
     qemu_opts_foreach(qemu_find_opts("vnc"),
-                      vnc_init_func, NULL, NULL);
+                      vnc_init_func, NULL, IGNORE_ERRORS);
 #endif
 
     if (using_spice) {
--
2.11.0.259.g40922b1


Reply | Threaded
Open this post in threaded view
|

[RFC 08/15] error: New ERR_IS_* macros for checking Error** values

Eduardo Habkost-2
In reply to this post by Eduardo Habkost-2
Define new macros that should be used when checking errp values.
Existing methods will still work by now, but will break once we
implement IGNORE_ERRORS in a different way later.  Other patches will
convert existing code to use the new macros.

TODO: write more detailed API documentation

Signed-off-by: Eduardo Habkost <[hidden email]>
---
 include/qapi/error.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/qapi/error.h b/include/qapi/error.h
index 38f7afba2e..1000853051 100644
--- a/include/qapi/error.h
+++ b/include/qapi/error.h
@@ -119,6 +119,9 @@
 
 #define IGNORE_ERRORS (NULL)
 
+#define ERR_IS_SET(e) (!!*(e))
+#define ERR_IS_IGNORED(e) (!(e))
+
 /*
  * Overall category of an error.
  * Based on the qapi type QapiErrorClass, but reproduced here for nicer
--
2.11.0.259.g40922b1


Reply | Threaded
Open this post in threaded view
|

[RFC 09/15] [coccinelle] Use ERR_IS_* macros

Eduardo Habkost-2
In reply to this post by Eduardo Habkost-2
Generated by the following Coccinelle patch:

  @@
  typedef Error;
  idexpression Error ** errp;
  statement ST;
  @@
  -if (*errp)
  +if (ERR_IS_SET(errp))
       ST

  @@
  typedef Error;
  idexpression Error ** errp;
  statement ST;
  @@
  -if (!*errp)
  +if (!ERR_IS_SET(errp))
       ST

  @@
  typedef Error;
  idexpression Error ** errp;
  @@
  -assert(!*errp)
  +assert(!ERR_IS_SET(errp))

  @@
  typedef Error;
  idexpression Error ** errp;
  @@
  -    assert(errp && *errp);
  +    assert(!ERR_IS_IGNORED(errp) && ERR_IS_SET(errp));

  @@
  typedef Error;
  idexpression Error ** errp;
  @@
  -    assert(errp && !*errp);
  +    assert(!ERR_IS_IGNORED(errp) && !ERR_IS_SET(errp));

  @@
  typedef Error;
  idexpression Error ** errp;
  @@
  -    assert(!errp || !*errp);
  +    assert(!ERR_IS_IGNORED(errp) || !ERR_IS_SET(errp));

  @@
  typedef Error;
  idexpression Error ** errp;
  statement ST;
  @@
  -if (errp)
  +if (!ERR_IS_IGNORED(errp))
       ST

  @@
  typedef Error;
  idexpression Error ** errp;
  statement ST;
  @@
  -if (!errp)
  +if (ERR_IS_IGNORED(errp))
       ST

  @@
  typedef Error;
  idexpression Error ** errp;
  statement ST;
  @@
  -if (errp && *errp)
  +if (!ERR_IS_IGNORED(errp) && ERR_IS_SET(errp))
       ST

  @@
  typedef Error;
  idexpression Error ** errp;
  statement ST;
  @@
  -if (errp && *errp != NULL)
  +if (!ERR_IS_IGNORED(errp) && ERR_IS_SET(errp))
       ST

  @@
  typedef Error;
  idexpression Error ** errp;
  statement ST;
  @@
  -if (errp && !*errp)
  +if (!ERR_IS_IGNORED(errp) && !ERR_IS_SET(errp))
       ST

  @@
  typedef Error;
  idexpression Error ** errp;
  statement ST;
  @@
  -if (errp && *errp == NULL)
  +if (!ERR_IS_IGNORED(errp) && !ERR_IS_SET(errp))
       ST

Signed-off-by: Eduardo Habkost <[hidden email]>
---
 block.c                          |  2 +-
 hw/acpi/cpu_hotplug.c            |  2 +-
 hw/ipmi/isa_ipmi_bt.c            |  2 +-
 hw/mem/pc-dimm.c                 |  2 +-
 hw/ppc/spapr.c                   |  2 +-
 hw/ppc/spapr_pci.c               |  2 +-
 hw/s390x/event-facility.c        |  2 +-
 net/net.c                        |  2 +-
 qapi/qobject-input-visitor.c     |  2 +-
 qga/commands-posix.c             |  2 +-
 target/s390x/cpu_models.c        | 30 +++++++++++++++---------------
 target/s390x/helper.c            |  2 +-
 tests/test-crypto-tlscredsx509.c |  2 +-
 tests/test-io-channel-tls.c      |  2 +-
 util/error.c                     | 12 ++++++------
 15 files changed, 34 insertions(+), 34 deletions(-)

diff --git a/block.c b/block.c
index ecb5be9a32..b08d95a62a 100644
--- a/block.c
+++ b/block.c
@@ -1383,7 +1383,7 @@ static QDict *parse_json_filename(const char *filename, Error **errp)
     options_obj = qobject_from_json(filename, errp);
     if (!options_obj) {
         /* Work around qobject_from_json() lossage TODO fix that */
-        if (errp && !*errp) {
+        if (!ERR_IS_IGNORED(errp) && !ERR_IS_SET(errp)) {
             error_setg(errp, "Could not parse the JSON options");
             return NULL;
         }
diff --git a/hw/acpi/cpu_hotplug.c b/hw/acpi/cpu_hotplug.c
index 5243918125..c72a748bb3 100644
--- a/hw/acpi/cpu_hotplug.c
+++ b/hw/acpi/cpu_hotplug.c
@@ -76,7 +76,7 @@ void legacy_acpi_cpu_plug_cb(HotplugHandler *hotplug_dev,
                              AcpiCpuHotplug *g, DeviceState *dev, Error **errp)
 {
     acpi_set_cpu_present_bit(g, CPU(dev), errp);
-    if (*errp != NULL) {
+    if (ERR_IS_SET(errp)) {
         return;
     }
     acpi_send_event(DEVICE(hotplug_dev), ACPI_CPU_HOTPLUG_STATUS);
diff --git a/hw/ipmi/isa_ipmi_bt.c b/hw/ipmi/isa_ipmi_bt.c
index 2fcc3d2e7c..c7480f5f78 100644
--- a/hw/ipmi/isa_ipmi_bt.c
+++ b/hw/ipmi/isa_ipmi_bt.c
@@ -438,7 +438,7 @@ static void isa_ipmi_bt_realize(DeviceState *dev, Error **errp)
     iib->bt.bmc->intf = ii;
 
     iic->init(ii, errp);
-    if (*errp)
+    if (ERR_IS_SET(errp))
         return;
 
     if (iib->isairq > 0) {
diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc-dimm.c
index 92fb48255a..4e5e2c9339 100644
--- a/hw/mem/pc-dimm.c
+++ b/hw/mem/pc-dimm.c
@@ -316,7 +316,7 @@ uint64_t pc_dimm_get_free_addr(uint64_t address_space_start,
         uint64_t dimm_size = object_property_get_int(OBJECT(dimm),
                                                      PC_DIMM_SIZE_PROP,
                                                      errp);
-        if (errp && *errp) {
+        if (!ERR_IS_IGNORED(errp) && ERR_IS_SET(errp)) {
             goto out;
         }
 
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index e07fd88a55..af33297e0f 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -2983,7 +2983,7 @@ static void spapr_machine_device_plug(HotplugHandler *hotplug_dev,
             return;
         }
         node = object_property_get_int(OBJECT(dev), PC_DIMM_NODE_PROP, errp);
-        if (*errp) {
+        if (ERR_IS_SET(errp)) {
             return;
         }
         if (node < 0 || node >= MAX_NODES) {
diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
index b0c58ad3f1..5b3660b674 100644
--- a/hw/ppc/spapr_pci.c
+++ b/hw/ppc/spapr_pci.c
@@ -1364,7 +1364,7 @@ static void spapr_phb_add_pci_device(sPAPRDRConnector *drc,
     drck->attach(drc, DEVICE(pdev),
                  fdt, fdt_start_offset, !dev->hotplugged, errp);
 out:
-    if (*errp) {
+    if (ERR_IS_SET(errp)) {
         g_free(fdt);
     }
 }
diff --git a/hw/s390x/event-facility.c b/hw/s390x/event-facility.c
index 2f2bf8b45d..6eac626212 100644
--- a/hw/s390x/event-facility.c
+++ b/hw/s390x/event-facility.c
@@ -296,7 +296,7 @@ static void sclp_events_bus_realize(BusState *bus, Error **errp)
         DeviceState *dev = kid->child;
 
         object_property_set_bool(OBJECT(dev), true, "realized", errp);
-        if (*errp) {
+        if (ERR_IS_SET(errp)) {
             return;
         }
     }
diff --git a/net/net.c b/net/net.c
index b7f5459b33..5c09301692 100644
--- a/net/net.c
+++ b/net/net.c
@@ -1061,7 +1061,7 @@ static int net_client_init1(const void *object, bool is_netdev, Error **errp)
 
     if (net_client_init_fun[netdev->type](netdev, name, peer, errp) < 0) {
         /* FIXME drop when all init functions store an Error */
-        if (errp && !*errp) {
+        if (!ERR_IS_IGNORED(errp) && !ERR_IS_SET(errp)) {
             error_setg(errp, QERR_DEVICE_INIT_FAILED,
                        NetClientDriver_lookup[netdev->type]);
         }
diff --git a/qapi/qobject-input-visitor.c b/qapi/qobject-input-visitor.c
index eac40f618a..7da822b3a2 100644
--- a/qapi/qobject-input-visitor.c
+++ b/qapi/qobject-input-visitor.c
@@ -723,7 +723,7 @@ Visitor *qobject_input_visitor_new_str(const char *str,
         obj = qobject_from_json(str, errp);
         if (!obj) {
             /* Work around qobject_from_json() lossage TODO fix that */
-            if (errp && !*errp) {
+            if (!ERR_IS_IGNORED(errp) && !ERR_IS_SET(errp)) {
                 error_setg(errp, "JSON parse error");
                 return NULL;
             }
diff --git a/qga/commands-posix.c b/qga/commands-posix.c
index 220a50ad7c..623a32a7d8 100644
--- a/qga/commands-posix.c
+++ b/qga/commands-posix.c
@@ -1025,7 +1025,7 @@ static void build_guest_fsinfo_for_virtual_device(char const *syspath,
             build_guest_fsinfo_for_device(path, fs, errp);
             g_free(path);
 
-            if (*errp) {
+            if (ERR_IS_SET(errp)) {
                 break;
             }
         }
diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c
index 5206a10134..4fde8f41fd 100644
--- a/target/s390x/cpu_models.c
+++ b/target/s390x/cpu_models.c
@@ -348,22 +348,22 @@ static void cpu_model_from_info(S390CPUModel *model, const CpuModelInfo *info,
     if (qdict) {
         visitor = qobject_input_visitor_new(info->props);
         visit_start_struct(visitor, NULL, NULL, 0, errp);
-        if (*errp) {
+        if (ERR_IS_SET(errp)) {
             object_unref(obj);
             return;
         }
         for (e = qdict_first(qdict); e; e = qdict_next(qdict, e)) {
             object_property_set(obj, visitor, e->key, errp);
-            if (*errp) {
+            if (ERR_IS_SET(errp)) {
                 break;
             }
         }
-        if (!*errp) {
+        if (!ERR_IS_SET(errp)) {
             visit_check_struct(visitor, errp);
         }
         visit_end_struct(visitor, NULL);
         visit_free(visitor);
-        if (*errp) {
+        if (ERR_IS_SET(errp)) {
             object_unref(obj);
             return;
         }
@@ -434,7 +434,7 @@ CpuModelExpansionInfo *arch_query_cpu_model_expansion(CpuModelExpansionType type
 
     /* convert it to our internal representation */
     cpu_model_from_info(&s390_model, model, errp);
-    if (*errp) {
+    if (ERR_IS_SET(errp)) {
         return NULL;
     }
 
@@ -474,11 +474,11 @@ CpuModelCompareInfo *arch_query_cpu_model_comparison(CpuModelInfo *infoa,
 
     /* convert both models to our internal representation */
     cpu_model_from_info(&modela, infoa, errp);
-    if (*errp) {
+    if (ERR_IS_SET(errp)) {
         return NULL;
     }
     cpu_model_from_info(&modelb, infob, errp);
-    if (*errp) {
+    if (ERR_IS_SET(errp)) {
         return NULL;
     }
     compare_info = g_malloc0(sizeof(*compare_info));
@@ -548,12 +548,12 @@ CpuModelBaselineInfo *arch_query_cpu_model_baseline(CpuModelInfo *infoa,
 
     /* convert both models to our internal representation */
     cpu_model_from_info(&modela, infoa, errp);
-    if (*errp) {
+    if (ERR_IS_SET(errp)) {
         return NULL;
     }
 
     cpu_model_from_info(&modelb, infob, errp);
-    if (*errp) {
+    if (ERR_IS_SET(errp)) {
         return NULL;
     }
 
@@ -702,7 +702,7 @@ static S390CPUModel *get_max_cpu_model(Error **errp)
                     S390_FEAT_MAX);
         add_qemu_cpu_model_features(max_model.features);
     }
-    if (!*errp) {
+    if (!ERR_IS_SET(errp)) {
         cached = true;
         return &max_model;
     }
@@ -732,7 +732,7 @@ static inline void apply_cpu_model(const S390CPUModel *model, Error **errp)
         /* FIXME TCG - use data for stdip/stfl */
     }
 
-    if (!*errp) {
+    if (!ERR_IS_SET(errp)) {
         applied = true;
         if (model) {
             applied_model = *model;
@@ -759,7 +759,7 @@ void s390_realize_cpu_model(CPUState *cs, Error **errp)
     }
 
     max_model = get_max_cpu_model(errp);
-    if (*errp) {
+    if (ERR_IS_SET(errp)) {
         error_prepend(errp, "CPU models are not available: ");
         return;
     }
@@ -771,7 +771,7 @@ void s390_realize_cpu_model(CPUState *cs, Error **errp)
 
     check_consistency(cpu->model);
     check_compatibility(max_model, cpu->model, errp);
-    if (*errp) {
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
@@ -814,7 +814,7 @@ static void set_feature(Object *obj, Visitor *v, const char *name,
     }
 
     visit_type_bool(v, name, &value, errp);
-    if (*errp) {
+    if (ERR_IS_SET(errp)) {
         return;
     }
     if (value) {
@@ -871,7 +871,7 @@ static void set_feature_group(Object *obj, Visitor *v, const char *name,
     }
 
     visit_type_bool(v, name, &value, errp);
-    if (*errp) {
+    if (ERR_IS_SET(errp)) {
         return;
     }
     if (value) {
diff --git a/target/s390x/helper.c b/target/s390x/helper.c
index a8d20c51fa..1408ce2b4a 100644
--- a/target/s390x/helper.c
+++ b/target/s390x/helper.c
@@ -98,7 +98,7 @@ S390CPU *cpu_s390x_create(const char *cpu_model, Error **errp)
     }
     g_free(name);
 
-    if (*errp) {
+    if (ERR_IS_SET(errp)) {
         return NULL;
     }
     return S390_CPU(CPU(object_new(typename)));
diff --git a/tests/test-crypto-tlscredsx509.c b/tests/test-crypto-tlscredsx509.c
index af2f80e89c..a14b4b1cad 100644
--- a/tests/test-crypto-tlscredsx509.c
+++ b/tests/test-crypto-tlscredsx509.c
@@ -54,7 +54,7 @@ static QCryptoTLSCreds *test_tls_creds_create(QCryptoTLSCredsEndpoint endpoint,
         "sanity-check", "yes",
         NULL);
 
-    if (*errp) {
+    if (ERR_IS_SET(errp)) {
         return NULL;
     }
     return QCRYPTO_TLS_CREDS(creds);
diff --git a/tests/test-io-channel-tls.c b/tests/test-io-channel-tls.c
index fae2906060..6509ab1045 100644
--- a/tests/test-io-channel-tls.c
+++ b/tests/test-io-channel-tls.c
@@ -89,7 +89,7 @@ static QCryptoTLSCreds *test_tls_creds_create(QCryptoTLSCredsEndpoint endpoint,
         NULL
         );
 
-    if (*errp) {
+    if (ERR_IS_SET(errp)) {
         return NULL;
     }
     return QCRYPTO_TLS_CREDS(creds);
diff --git a/util/error.c b/util/error.c
index 020b86b9f0..a1d998646a 100644
--- a/util/error.c
+++ b/util/error.c
@@ -51,10 +51,10 @@ static void error_setv(Error **errp,
     Error *err;
     int saved_errno = errno;
 
-    if (errp == NULL) {
+    if (ERR_IS_IGNORED(errp)) {
         return;
     }
-    assert(*errp == NULL);
+    assert(!ERR_IS_SET(errp));
 
     err = g_malloc0(sizeof(*err));
     err->msg = g_strdup_vprintf(fmt, ap);
@@ -103,7 +103,7 @@ void error_setg_errno_internal(Error **errp,
     va_list ap;
     int saved_errno = errno;
 
-    if (errp == NULL) {
+    if (ERR_IS_IGNORED(errp)) {
         return;
     }
 
@@ -127,7 +127,7 @@ void error_vprepend(Error **errp, const char *fmt, va_list ap)
 {
     GString *newmsg;
 
-    if (!errp) {
+    if (ERR_IS_IGNORED(errp)) {
         return;
     }
 
@@ -153,7 +153,7 @@ void error_append_hint(Error **errp, const char *fmt, ...)
     int saved_errno = errno;
     Error *err;
 
-    if (!errp) {
+    if (ERR_IS_IGNORED(errp)) {
         return;
     }
     err = *errp;
@@ -178,7 +178,7 @@ void error_setg_win32_internal(Error **errp,
     va_list ap;
     char *suffix = NULL;
 
-    if (errp == NULL) {
+    if (ERR_IS_IGNORED(errp)) {
         return;
     }
 
--
2.11.0.259.g40922b1


Reply | Threaded
Open this post in threaded view
|

[RFC 10/15] test-qapi-util: Use ERR_IS_* macros

Eduardo Habkost-2
In reply to this post by Eduardo Habkost-2
Signed-off-by: Eduardo Habkost <[hidden email]>
---
 tests/test-qapi-util.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/tests/test-qapi-util.c b/tests/test-qapi-util.c
index 374fa30078..fe232ef9ed 100644
--- a/tests/test-qapi-util.c
+++ b/tests/test-qapi-util.c
@@ -77,25 +77,25 @@ static void test_parse_qapi_name(void)
 
 static void successfn(Error **errp)
 {
-    g_assert(!errp || !*errp);
+    g_assert(ERR_IS_IGNORED(errp) || !ERR_IS_SET(errp));
 }
 
 static void fail1(Error **errp)
 {
-    g_assert(!errp || !*errp);
+    g_assert(ERR_IS_IGNORED(errp) || !ERR_IS_SET(errp));
 
     error_setg(errp, "error1");
 
-    g_assert(!errp || *errp);
+    g_assert(ERR_IS_IGNORED(errp) || ERR_IS_SET(errp));
 }
 
 static void fail2(Error **errp)
 {
-    g_assert(!errp || !*errp);
+    g_assert(ERR_IS_IGNORED(errp) || !ERR_IS_SET(errp));
 
     error_setg(errp, "error2");
 
-    g_assert(!errp || *errp);
+    g_assert(ERR_IS_IGNORED(errp) || ERR_IS_SET(errp));
 }
 
 static void multifn(Error **errp)
@@ -124,13 +124,13 @@ static void test_propagate(void (*fn)(Error **), Error **errp)
     bool failed;
     Error *local_err = NULL;
 
-    g_assert(!errp || !*errp);
+    g_assert(ERR_IS_IGNORED(errp) || !ERR_IS_SET(errp));
 
     fn(&local_err);
     failed = !!local_err;
     error_propagate(errp, local_err);
 
-    g_assert(!errp || (failed == !!*errp));
+    g_assert(ERR_IS_IGNORED(errp) || (failed == !!ERR_IS_SET(errp)));
 }
 
 static void test_error_api(void)
--
2.11.0.259.g40922b1


Reply | Threaded
Open this post in threaded view
|

[RFC 11/15] Manual changes to use ERR_IS_* macros

Eduardo Habkost-2
In reply to this post by Eduardo Habkost-2
Change code that was missed by the Coccinelle patch for some reason.

Signed-off-by: Eduardo Habkost <[hidden email]>
---
 hw/core/qdev-properties.c | 2 +-
 hw/mem/pc-dimm.c          | 2 +-
 migration/rdma.c          | 2 +-
 util/error.c              | 4 ++--
 util/qemu-option.c        | 6 +++---
 5 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c
index 9f1a497322..65ba36f4fb 100644
--- a/hw/core/qdev-properties.c
+++ b/hw/core/qdev-properties.c
@@ -1107,7 +1107,7 @@ static void qdev_prop_set_globals_for_type(DeviceState *dev,
         if (err != NULL) {
             error_prepend(&err, "can't apply global %s.%s=%s: ",
                           prop->driver, prop->property, prop->value);
-            if (!dev->hotplugged && prop->errp) {
+            if (!dev->hotplugged && !ERR_IS_IGNORED(prop->errp)) {
                 error_propagate(prop->errp, err);
             } else {
                 assert(prop->user_provided);
diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc-dimm.c
index 4e5e2c9339..13f43ab658 100644
--- a/hw/mem/pc-dimm.c
+++ b/hw/mem/pc-dimm.c
@@ -139,7 +139,7 @@ static int pc_existing_dimms_capacity_internal(Object *obj, void *opaque)
                 cap->errp);
         }
 
-        if (cap->errp && *cap->errp) {
+        if (!ERR_IS_IGNORED(cap->errp) && ERR_IS_SET(cap->errp)) {
             return 1;
         }
     }
diff --git a/migration/rdma.c b/migration/rdma.c
index a33edbf29b..c6078bf51b 100644
--- a/migration/rdma.c
+++ b/migration/rdma.c
@@ -39,7 +39,7 @@
 #define ERROR(errp, fmt, ...) \
     do { \
         fprintf(stderr, "RDMA ERROR: " fmt "\n", ## __VA_ARGS__); \
-        if (errp && (*(errp) == NULL)) { \
+        if (!ERR_IS_IGNORED(errp) && !ERR_IS_SET(errp)) { \
             error_setg(errp, "RDMA ERROR: " fmt, ## __VA_ARGS__); \
         } \
     } while (0)
diff --git a/util/error.c b/util/error.c
index a1d998646a..4e804287eb 100644
--- a/util/error.c
+++ b/util/error.c
@@ -255,7 +255,7 @@ void error_free(Error *err)
 
 void error_free_or_abort(Error **errp)
 {
-    assert(errp && *errp);
+    assert(!ERR_IS_IGNORED(errp) && ERR_IS_SET(errp));
     error_free(*errp);
     *errp = NULL;
 }
@@ -266,7 +266,7 @@ void error_propagate(Error **dst_errp, Error *local_err)
         return;
     }
     error_handle_fatal(dst_errp, local_err);
-    if (dst_errp && !*dst_errp) {
+    if (!ERR_IS_IGNORED(dst_errp) && !ERR_IS_SET(dst_errp)) {
         *dst_errp = local_err;
     } else {
         error_free(local_err);
diff --git a/util/qemu-option.c b/util/qemu-option.c
index a7e62593b1..5f1c7af1c6 100644
--- a/util/qemu-option.c
+++ b/util/qemu-option.c
@@ -617,7 +617,7 @@ int qemu_opt_foreach(QemuOpts *opts, qemu_opt_loopfunc func, void *opaque,
         if (rc) {
             return rc;
         }
-        assert(!errp || !*errp);
+        assert(!ERR_IS_SET(errp));
     }
     return 0;
 }
@@ -945,7 +945,7 @@ static void qemu_opts_from_qdict_1(const char *key, QObject *obj, void *opaque)
     const char *value;
     int n;
 
-    if (!strcmp(key, "id") || *state->errp) {
+    if (!strcmp(key, "id") || ERR_IS_SET(state->errp)) {
         return;
     }
 
@@ -1113,7 +1113,7 @@ int qemu_opts_foreach(QemuOptsList *list, qemu_opts_loopfunc func,
         if (rc) {
             break;
         }
-        assert(!errp || !*errp);
+        assert(!ERR_IS_SET(errp));
     }
     loc_pop(&loc);
     return rc;
--
2.11.0.259.g40922b1


Reply | Threaded
Open this post in threaded view
|

[RFC 12/15] error: Make IGNORED_ERRORS not a NULL pointer

Eduardo Habkost-2
In reply to this post by Eduardo Habkost-2
Use a trick to make we have a non-NULL errp if IGNORED_ERRORS is used:
instead of passing NULL, pass an existing pointer that points to a
special &error_ignored_unset value.  This will let the error API to flag
error state on *errp but won't require error_free() to be called later.

This will allow us to simplify the documented method to propagate errors
from:

    Error *err = NULL;
    foo(arg, &err);
    if (err) {
        handle the error...
        error_propagate(errp, err);
    }

to:

    foo(arg, errp);
    if (ERR_IS_SET(errp)) {
        handle the error...
    }

This will allow us to stop using local_err variables and
error_propagate() on hundreds of cases.

* TODO: API documentation needs to be updated.
* TODO: probably we should add assert(errp) lines to the ERR_IS_* macros,
        as err_set*() will now break if errp is NULL.

Signed-off-by: Eduardo Habkost <[hidden email]>
---
 include/qapi/error.h   | 20 +++++++++++++++++---
 tests/test-qapi-util.c | 14 +++++++-------
 util/error.c           | 13 ++++++++++++-
 3 files changed, 36 insertions(+), 11 deletions(-)

diff --git a/include/qapi/error.h b/include/qapi/error.h
index 1000853051..d1378396dd 100644
--- a/include/qapi/error.h
+++ b/include/qapi/error.h
@@ -117,10 +117,24 @@
 
 #include "qapi-types.h"
 
-#define IGNORE_ERRORS (NULL)
 
-#define ERR_IS_SET(e) (!!*(e))
-#define ERR_IS_IGNORED(e) (!(e))
+/*
+ * Special error value to indicate errors will be ignored, and no
+ * error was set.
+ */
+extern Error ignored_error_unset;
+
+/*
+ * Special error destination to indicate errors will be ignored,
+ * but an error value was set.
+ */
+extern Error ignored_error_set;
+
+
+#define IGNORE_ERRORS (& (Error *) { &ignored_error_unset })
+
+#define ERR_IS_SET(e) (*(e) && *(e) != &ignored_error_unset)
+#define ERR_IS_IGNORED(e) (!(e) || *(e) == &ignored_error_unset || *(e) == &ignored_error_set)
 
 /*
  * Overall category of an error.
diff --git a/tests/test-qapi-util.c b/tests/test-qapi-util.c
index fe232ef9ed..0305b9201b 100644
--- a/tests/test-qapi-util.c
+++ b/tests/test-qapi-util.c
@@ -77,25 +77,25 @@ static void test_parse_qapi_name(void)
 
 static void successfn(Error **errp)
 {
-    g_assert(ERR_IS_IGNORED(errp) || !ERR_IS_SET(errp));
+    g_assert(!ERR_IS_SET(errp));
 }
 
 static void fail1(Error **errp)
 {
-    g_assert(ERR_IS_IGNORED(errp) || !ERR_IS_SET(errp));
+    g_assert(!ERR_IS_SET(errp));
 
     error_setg(errp, "error1");
 
-    g_assert(ERR_IS_IGNORED(errp) || ERR_IS_SET(errp));
+    g_assert(ERR_IS_SET(errp));
 }
 
 static void fail2(Error **errp)
 {
-    g_assert(ERR_IS_IGNORED(errp) || !ERR_IS_SET(errp));
+    g_assert(!ERR_IS_SET(errp));
 
     error_setg(errp, "error2");
 
-    g_assert(ERR_IS_IGNORED(errp) || ERR_IS_SET(errp));
+    g_assert(ERR_IS_SET(errp));
 }
 
 static void multifn(Error **errp)
@@ -124,13 +124,13 @@ static void test_propagate(void (*fn)(Error **), Error **errp)
     bool failed;
     Error *local_err = NULL;
 
-    g_assert(ERR_IS_IGNORED(errp) || !ERR_IS_SET(errp));
+    g_assert(!ERR_IS_SET(errp));
 
     fn(&local_err);
     failed = !!local_err;
     error_propagate(errp, local_err);
 
-    g_assert(ERR_IS_IGNORED(errp) || (failed == !!ERR_IS_SET(errp)));
+    g_assert((failed == !!ERR_IS_SET(errp)));
 }
 
 static void test_error_api(void)
diff --git a/util/error.c b/util/error.c
index 4e804287eb..2e16ad371c 100644
--- a/util/error.c
+++ b/util/error.c
@@ -28,6 +28,8 @@ struct Error
 
 Error *error_abort;
 Error *error_fatal;
+Error ignored_error_unset;
+Error ignored_error_set;
 
 static void error_handle_fatal(Error **errp, Error *err)
 {
@@ -52,6 +54,7 @@ static void error_setv(Error **errp,
     int saved_errno = errno;
 
     if (ERR_IS_IGNORED(errp)) {
+        *errp = &ignored_error_set;
         return;
     }
     assert(!ERR_IS_SET(errp));
@@ -104,6 +107,7 @@ void error_setg_errno_internal(Error **errp,
     int saved_errno = errno;
 
     if (ERR_IS_IGNORED(errp)) {
+        *errp = &ignored_error_set;
         return;
     }
 
@@ -127,6 +131,8 @@ void error_vprepend(Error **errp, const char *fmt, va_list ap)
 {
     GString *newmsg;
 
+    assert(ERR_IS_SET(errp));
+
     if (ERR_IS_IGNORED(errp)) {
         return;
     }
@@ -153,6 +159,8 @@ void error_append_hint(Error **errp, const char *fmt, ...)
     int saved_errno = errno;
     Error *err;
 
+    assert(ERR_IS_SET(errp));
+
     if (ERR_IS_IGNORED(errp)) {
         return;
     }
@@ -179,6 +187,7 @@ void error_setg_win32_internal(Error **errp,
     char *suffix = NULL;
 
     if (ERR_IS_IGNORED(errp)) {
+        *errp = &ignored_error_set;
         return;
     }
 
@@ -266,7 +275,9 @@ void error_propagate(Error **dst_errp, Error *local_err)
         return;
     }
     error_handle_fatal(dst_errp, local_err);
-    if (!ERR_IS_IGNORED(dst_errp) && !ERR_IS_SET(dst_errp)) {
+    if (ERR_IS_IGNORED(dst_errp)) {
+        *dst_errp = &ignored_error_set;
+    } else if (!ERR_IS_SET(dst_errp)) {
         *dst_errp = local_err;
     } else {
         error_free(local_err);
--
2.11.0.259.g40922b1


Reply | Threaded
Open this post in threaded view
|

[RFC 13/15] rdma: Simplify var declaration to avoid confusing Coccinelle

Eduardo Habkost-2
In reply to this post by Eduardo Habkost-2
For some reason the declaration:

  Error *local_err = NULL, **errp = &local_err;

will be matched by Coccinelle even if we use:

  ... when != local_err
  Error *local_err = NULL;
  ... when != local_err

This moves the declarations to separate lines just to avoid that issue.

Signed-off-by: Eduardo Habkost <[hidden email]>
---
 migration/rdma.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/migration/rdma.c b/migration/rdma.c
index c6078bf51b..5cb9572a5c 100644
--- a/migration/rdma.c
+++ b/migration/rdma.c
@@ -2282,7 +2282,8 @@ static void qemu_rdma_cleanup(RDMAContext *rdma)
 static int qemu_rdma_source_init(RDMAContext *rdma, bool pin_all, Error **errp)
 {
     int ret, idx;
-    Error *local_err = NULL, **temp = &local_err;
+    Error *local_err = NULL;
+    Error **temp = &local_err;
 
     /*
      * Will be validated against destination's actual capabilities
@@ -3433,7 +3434,8 @@ static int qemu_rdma_registration_start(QEMUFile *f, void *opaque,
 static int qemu_rdma_registration_stop(QEMUFile *f, void *opaque,
                                        uint64_t flags, void *data)
 {
-    Error *local_err = NULL, **errp = &local_err;
+    Error *local_err = NULL;
+    Error **errp = &local_err;
     QIOChannelRDMA *rioc = QIO_CHANNEL_RDMA(opaque);
     RDMAContext *rdma = rioc->rdma;
     RDMAControlHeader head = { .len = 0, .repeat = 1 };
@@ -3606,7 +3608,8 @@ static void rdma_accept_incoming_migration(void *opaque)
     RDMAContext *rdma = opaque;
     int ret;
     QEMUFile *f;
-    Error *local_err = NULL, **errp = &local_err;
+    Error *local_err = NULL;
+    Error **errp = &local_err;
 
     trace_qemu_rdma_accept_incoming_migration();
     ret = qemu_rdma_accept(rdma);
--
2.11.0.259.g40922b1


Reply | Threaded
Open this post in threaded view
|

[RFC 14/15] [coccinelle] Eliminate unnecessary local_err/error_propagate() usage

Eduardo Habkost-2
In reply to this post by Eduardo Habkost-2
Now we can check for errors on errp using the ERR_IS_SET() macro, even
if errors are being ignored.

Replace common local_err/error_propagate() usage using the following
Coccinelle script:

  @ simple_propagate @
  typedef Error;
  type T;
  identifier FN;
  expression some_func;
  identifier errp;
  identifier local_err;
  @@
   T FN(..., Error **errp)
   {
       ...
  -    Error *local_err = NULL;
       <... when != local_err
  (
       some_func(...,
  -        &local_err
  +        errp
          );
       ... when != local_err
  (
       error_propagate(errp, local_err);
  |
       if (local_err) {
           ... when != local_err
           error_propagate(errp, local_err);
           ... when != local_err
       }
  )
  |
       if (
  -        local_err
  +        ERR_IS_SET(errp)
          ) {
           ... when != local_err
  -        error_propagate(errp, local_err);
           ... when != local_err
       }
  |
  -    error_propagate(errp, local_err);
  )
       ...>
   }

From the 792 error_propagate() calls in the tree, 346 were automatically
converted by the script.  Probably we can write a more complex script
that catches many of the remaining cases later, or convert them
manually.

Signed-off-by: Eduardo Habkost <[hidden email]>
---
 qapi/qapi-visit-core.c              |   6 +-
 backends/hostmem.c                  |   6 +-
 backends/rng.c                      |   6 +-
 backends/tpm.c                      |   6 +-
 block.c                             |  41 ++++------
 block/blkdebug.c                    |  16 ++--
 block/block-backend.c               |   6 +-
 block/commit.c                      |  16 ++--
 block/crypto.c                      |   6 +-
 block/curl.c                        |   6 +-
 block/file-posix.c                  |   6 +-
 block/gluster.c                     |   6 +-
 block/io.c                          |  11 +--
 block/iscsi.c                       |  27 +++----
 block/mirror.c                      |  12 +--
 block/nbd.c                         |  18 ++---
 block/nfs.c                         |  12 +--
 block/qapi.c                        |   6 +-
 block/qcow2.c                       |  11 +--
 block/raw-format.c                  |   6 +-
 block/rbd.c                         |   6 +-
 block/replication.c                 |  10 +--
 block/sheepdog.c                    |  28 +++----
 block/ssh.c                         |  12 +--
 blockdev.c                          |  45 ++++-------
 blockjob.c                          |  13 +--
 bootdevice.c                        |  13 +--
 chardev/char.c                      |   6 +-
 dump.c                              | 153 +++++++++++-------------------------
 exec.c                              |  18 ++---
 hw/arm/allwinner-a10.c              |  26 +++---
 hw/arm/armv7m.c                     |  26 +++---
 hw/arm/digic.c                      |  21 ++---
 hw/arm/fsl-imx25.c                  |  61 ++++++--------
 hw/arm/fsl-imx31.c                  |  56 ++++++-------
 hw/arm/fsl-imx6.c                   |  76 +++++++-----------
 hw/arm/xlnx-zynqmp.c                |   6 +-
 hw/block/fdc.c                      |  23 ++----
 hw/block/pflash_cfi01.c             |   6 +-
 hw/block/pflash_cfi02.c             |   6 +-
 hw/block/virtio-blk.c               |  16 ++--
 hw/char/debugcon.c                  |   6 +-
 hw/char/serial-pci.c                |  12 +--
 hw/char/virtio-serial-bus.c         |   6 +-
 hw/core/machine.c                   |  12 +--
 hw/core/qdev-properties-system.c    |  24 ++----
 hw/core/qdev-properties.c           |  47 ++++-------
 hw/core/qdev.c                      |   6 +-
 hw/cpu/a15mpcore.c                  |   6 +-
 hw/cpu/a9mpcore.c                   |  26 +++---
 hw/cpu/arm11mpcore.c                |  21 ++---
 hw/cpu/core.c                       |  12 +--
 hw/cpu/realview_mpcore.c            |  11 +--
 hw/display/qxl.c                    |   6 +-
 hw/display/virtio-gpu.c             |   6 +-
 hw/display/virtio-vga.c             |   6 +-
 hw/i386/kvm/pci-assign.c            |   6 +-
 hw/i386/pc.c                        |   6 +-
 hw/input/virtio-input.c             |  12 +--
 hw/intc/apic_common.c               |   6 +-
 hw/intc/arm_gic.c                   |   6 +-
 hw/intc/arm_gic_kvm.c               |  11 +--
 hw/intc/arm_gicv3.c                 |   6 +-
 hw/intc/arm_gicv3_its_kvm.c         |   6 +-
 hw/intc/arm_gicv3_kvm.c             |  11 +--
 hw/intc/armv7m_nvic.c               |   6 +-
 hw/intc/realview_gic.c              |   6 +-
 hw/ipack/ipack.c                    |   4 +-
 hw/misc/ivshmem.c                   |  18 ++---
 hw/misc/macio/macio.c               |  33 +++-----
 hw/misc/tmp105.c                    |   6 +-
 hw/net/dp8393x.c                    |   6 +-
 hw/nvram/fw_cfg.c                   |  12 +--
 hw/pci-bridge/pci_expander_bridge.c |   6 +-
 hw/pci/pci.c                        |  17 ++--
 hw/pci/shpc.c                       |  12 +--
 hw/ppc/e500.c                       |   6 +-
 hw/ppc/pnv.c                        |  32 +++-----
 hw/ppc/pnv_core.c                   |  16 ++--
 hw/ppc/spapr.c                      |  12 +--
 hw/ppc/spapr_drc.c                  |  26 +++---
 hw/ppc/spapr_pci.c                  |  12 +--
 hw/s390x/css-bridge.c               |   6 +-
 hw/s390x/css.c                      |   6 +-
 hw/s390x/virtio-ccw.c               |  16 ++--
 hw/scsi/esp-pci.c                   |   6 +-
 hw/scsi/scsi-bus.c                  |  17 ++--
 hw/scsi/scsi-disk.c                 |  11 +--
 hw/scsi/vhost-scsi.c                |  11 +--
 hw/scsi/virtio-scsi.c               |   6 +-
 hw/usb/bus.c                        |  32 +++-----
 hw/usb/dev-serial.c                 |   6 +-
 hw/usb/hcd-ohci.c                   |  12 +--
 hw/usb/hcd-uhci.c                   |   6 +-
 hw/vfio/pci.c                       |  11 +--
 hw/virtio/virtio-balloon.c          |   6 +-
 hw/virtio/virtio-pci.c              |   6 +-
 hw/virtio/virtio-rng.c              |   6 +-
 hw/virtio/virtio.c                  |  17 ++--
 migration/colo.c                    |  12 +--
 migration/migration.c               |   6 +-
 net/filter.c                        |   6 +-
 net/tap.c                           |   6 +-
 qapi/string-input-visitor.c         |   6 +-
 qdev-monitor.c                      |   6 +-
 qga/commands-posix.c                |  80 ++++++-------------
 qga/commands-win32.c                |  18 ++---
 qmp.c                               |  11 +--
 qom/object.c                        |  84 +++++++-------------
 replication.c                       |  24 ++----
 target/alpha/cpu.c                  |   6 +-
 target/arm/cpu.c                    |   6 +-
 target/cris/cpu.c                   |   6 +-
 target/hppa/cpu.c                   |   6 +-
 target/i386/cpu.c                   |  42 ++++------
 target/lm32/cpu.c                   |   6 +-
 target/m68k/cpu.c                   |   6 +-
 target/microblaze/cpu.c             |   6 +-
 target/mips/cpu.c                   |   6 +-
 target/moxie/cpu.c                  |   6 +-
 target/nios2/cpu.c                  |   6 +-
 target/openrisc/cpu.c               |   6 +-
 target/ppc/translate_init.c         |  23 ++----
 target/s390x/cpu.c                  |   6 +-
 target/sh4/cpu.c                    |   6 +-
 target/sparc/cpu.c                  |   6 +-
 target/tilegx/cpu.c                 |   6 +-
 target/tricore/cpu.c                |   6 +-
 target/unicore32/cpu.c              |   6 +-
 target/xtensa/cpu.c                 |   6 +-
 util/qemu-config.c                  |   6 +-
 util/qemu-option.c                  |  18 ++---
 132 files changed, 691 insertions(+), 1310 deletions(-)

diff --git a/qapi/qapi-visit-core.c b/qapi/qapi-visit-core.c
index 43a09d147d..e4700d3ff9 100644
--- a/qapi/qapi-visit-core.c
+++ b/qapi/qapi-visit-core.c
@@ -351,13 +351,11 @@ static void output_type_enum(Visitor *v, const char *name, int *obj,
 static void input_type_enum(Visitor *v, const char *name, int *obj,
                             const char *const strings[], Error **errp)
 {
-    Error *local_err = NULL;
     int64_t value = 0;
     char *enum_str;
 
-    visit_type_str(v, name, &enum_str, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    visit_type_str(v, name, &enum_str, errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
diff --git a/backends/hostmem.c b/backends/hostmem.c
index 4606b73849..8fcc5d68c9 100644
--- a/backends/hostmem.c
+++ b/backends/hostmem.c
@@ -197,7 +197,6 @@ static bool host_memory_backend_get_prealloc(Object *obj, Error **errp)
 static void host_memory_backend_set_prealloc(Object *obj, bool value,
                                              Error **errp)
 {
-    Error *local_err = NULL;
     HostMemoryBackend *backend = MEMORY_BACKEND(obj);
 
     if (backend->force_prealloc) {
@@ -218,9 +217,8 @@ static void host_memory_backend_set_prealloc(Object *obj, bool value,
         void *ptr = memory_region_get_ram_ptr(&backend->mr);
         uint64_t sz = memory_region_size(&backend->mr);
 
-        os_mem_prealloc(fd, ptr, sz, smp_cpus, &local_err);
-        if (local_err) {
-            error_propagate(errp, local_err);
+        os_mem_prealloc(fd, ptr, sz, smp_cpus, errp);
+        if (ERR_IS_SET(errp)) {
             return;
         }
         backend->prealloc = true;
diff --git a/backends/rng.c b/backends/rng.c
index 59b7503efb..c5f4f01642 100644
--- a/backends/rng.c
+++ b/backends/rng.c
@@ -54,7 +54,6 @@ static void rng_backend_prop_set_opened(Object *obj, bool value, Error **errp)
 {
     RngBackend *s = RNG_BACKEND(obj);
     RngBackendClass *k = RNG_BACKEND_GET_CLASS(s);
-    Error *local_err = NULL;
 
     if (value == s->opened) {
         return;
@@ -66,9 +65,8 @@ static void rng_backend_prop_set_opened(Object *obj, bool value, Error **errp)
     }
 
     if (k->opened) {
-        k->opened(s, &local_err);
-        if (local_err) {
-            error_propagate(errp, local_err);
+        k->opened(s, errp);
+        if (ERR_IS_SET(errp)) {
             return;
         }
     }
diff --git a/backends/tpm.c b/backends/tpm.c
index ef3e20a3cb..5b9788faf4 100644
--- a/backends/tpm.c
+++ b/backends/tpm.c
@@ -128,7 +128,6 @@ static void tpm_backend_prop_set_opened(Object *obj, bool value, Error **errp)
 {
     TPMBackend *s = TPM_BACKEND(obj);
     TPMBackendClass *k = TPM_BACKEND_GET_CLASS(s);
-    Error *local_err = NULL;
 
     if (value == s->opened) {
         return;
@@ -140,9 +139,8 @@ static void tpm_backend_prop_set_opened(Object *obj, bool value, Error **errp)
     }
 
     if (k->opened) {
-        k->opened(s, &local_err);
-        if (local_err) {
-            error_propagate(errp, local_err);
+        k->opened(s, errp);
+        if (ERR_IS_SET(errp)) {
             return;
         }
     }
diff --git a/block.c b/block.c
index b08d95a62a..1a6776447a 100644
--- a/block.c
+++ b/block.c
@@ -1440,7 +1440,6 @@ static int bdrv_fill_options(QDict **options, const char *filename,
     bool protocol = *flags & BDRV_O_PROTOCOL;
     bool parse_filename = false;
     BlockDriver *drv = NULL;
-    Error *local_err = NULL;
 
     /*
      * Caution: while qdict_get_try_str() is fine, getting non-string
@@ -1505,9 +1504,8 @@ static int bdrv_fill_options(QDict **options, const char *filename,
 
     /* Driver-specific filename parsing */
     if (drv && drv->bdrv_parse_filename && parse_filename) {
-        drv->bdrv_parse_filename(filename, *options, &local_err);
-        if (local_err) {
-            error_propagate(errp, local_err);
+        drv->bdrv_parse_filename(filename, *options, errp);
+        if (ERR_IS_SET(errp)) {
             return -EINVAL;
         }
 
@@ -2119,7 +2117,6 @@ int bdrv_open_backing_file(BlockDriverState *bs, QDict *parent_options,
     BlockDriverState *backing_hd;
     QDict *options;
     QDict *tmp_parent_options = NULL;
-    Error *local_err = NULL;
 
     if (bs->backing != NULL) {
         goto free_exit;
@@ -2152,10 +2149,9 @@ int bdrv_open_backing_file(BlockDriverState *bs, QDict *parent_options,
         goto free_exit;
     } else {
         bdrv_get_full_backing_filename(bs, backing_filename, PATH_MAX,
-                                       &local_err);
-        if (local_err) {
+                                       errp);
+        if (ERR_IS_SET(errp)) {
             ret = -EINVAL;
-            error_propagate(errp, local_err);
             QDECREF(options);
             goto free_exit;
         }
@@ -2184,10 +2180,9 @@ int bdrv_open_backing_file(BlockDriverState *bs, QDict *parent_options,
 
     /* Hook up the backing file link; drop our reference, bs owns the
      * backing_hd reference now */
-    bdrv_set_backing_hd(bs, backing_hd, &local_err);
+    bdrv_set_backing_hd(bs, backing_hd, errp);
     bdrv_unref(backing_hd);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (ERR_IS_SET(errp)) {
         ret = -EINVAL;
         goto free_exit;
     }
@@ -2292,7 +2287,6 @@ static BlockDriverState *bdrv_append_temp_snapshot(BlockDriverState *bs,
     int64_t total_size;
     QemuOpts *opts = NULL;
     BlockDriverState *bs_snapshot = NULL;
-    Error *local_err = NULL;
     int ret;
 
     /* if snapshot, we create a temporary backing file and open it
@@ -2339,9 +2333,8 @@ static BlockDriverState *bdrv_append_temp_snapshot(BlockDriverState *bs,
      * order to be able to return one, we have to increase
      * bs_snapshot's refcount here */
     bdrv_ref(bs_snapshot);
-    bdrv_append(bs_snapshot, bs, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    bdrv_append(bs_snapshot, bs, errp);
+    if (ERR_IS_SET(errp)) {
         bs_snapshot = NULL;
         goto out;
     }
@@ -3196,17 +3189,13 @@ out:
 void bdrv_append(BlockDriverState *bs_new, BlockDriverState *bs_top,
                  Error **errp)
 {
-    Error *local_err = NULL;
-
-    bdrv_set_backing_hd(bs_new, bs_top, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    bdrv_set_backing_hd(bs_new, bs_top, errp);
+    if (ERR_IS_SET(errp)) {
         goto out;
     }
 
-    bdrv_replace_node(bs_top, bs_new, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    bdrv_replace_node(bs_top, bs_new, errp);
+    if (ERR_IS_SET(errp)) {
         bdrv_set_backing_hd(bs_new, NULL, &error_abort);
         goto out;
     }
@@ -4074,17 +4063,15 @@ void bdrv_invalidate_cache(BlockDriverState *bs, Error **errp)
 void bdrv_invalidate_cache_all(Error **errp)
 {
     BlockDriverState *bs;
-    Error *local_err = NULL;
     BdrvNextIterator it;
 
     for (bs = bdrv_first(&it); bs; bs = bdrv_next(&it)) {
         AioContext *aio_context = bdrv_get_aio_context(bs);
 
         aio_context_acquire(aio_context);
-        bdrv_invalidate_cache(bs, &local_err);
+        bdrv_invalidate_cache(bs, errp);
         aio_context_release(aio_context);
-        if (local_err) {
-            error_propagate(errp, local_err);
+        if (ERR_IS_SET(errp)) {
             return;
         }
     }
diff --git a/block/blkdebug.c b/block/blkdebug.c
index a5196e889d..57cd23d94a 100644
--- a/block/blkdebug.c
+++ b/block/blkdebug.c
@@ -246,7 +246,6 @@ static int read_config(BDRVBlkdebugState *s, const char *filename,
     FILE *f = NULL;
     int ret;
     struct add_rule_data d;
-    Error *local_err = NULL;
 
     if (filename) {
         f = fopen(filename, "r");
@@ -263,26 +262,23 @@ static int read_config(BDRVBlkdebugState *s, const char *filename,
         }
     }
 
-    qemu_config_parse_qdict(options, config_groups, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    qemu_config_parse_qdict(options, config_groups, errp);
+    if (ERR_IS_SET(errp)) {
         ret = -EINVAL;
         goto fail;
     }
 
     d.s = s;
     d.action = ACTION_INJECT_ERROR;
-    qemu_opts_foreach(&inject_error_opts, add_rule, &d, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    qemu_opts_foreach(&inject_error_opts, add_rule, &d, errp);
+    if (ERR_IS_SET(errp)) {
         ret = -EINVAL;
         goto fail;
     }
 
     d.action = ACTION_SET_STATE;
-    qemu_opts_foreach(&set_state_opts, add_rule, &d, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    qemu_opts_foreach(&set_state_opts, add_rule, &d, errp);
+    if (ERR_IS_SET(errp)) {
         ret = -EINVAL;
         goto fail;
     }
diff --git a/block/block-backend.c b/block/block-backend.c
index 9b9ca2eb35..0725cd84a4 100644
--- a/block/block-backend.c
+++ b/block/block-backend.c
@@ -141,7 +141,6 @@ static const char *blk_root_get_name(BdrvChild *child)
 static void blk_root_activate(BdrvChild *child, Error **errp)
 {
     BlockBackend *blk = child->opaque;
-    Error *local_err = NULL;
 
     if (!blk->disable_perm) {
         return;
@@ -149,9 +148,8 @@ static void blk_root_activate(BdrvChild *child, Error **errp)
 
     blk->disable_perm = false;
 
-    blk_set_perm(blk, blk->perm, blk->shared_perm, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    blk_set_perm(blk, blk->perm, blk->shared_perm, errp);
+    if (ERR_IS_SET(errp)) {
         blk->disable_perm = true;
         return;
     }
diff --git a/block/commit.c b/block/commit.c
index 264495177e..08ab3ce7de 100644
--- a/block/commit.c
+++ b/block/commit.c
@@ -293,7 +293,6 @@ void commit_start(const char *job_id, BlockDriverState *bs,
     BlockDriverState *iter;
     BlockDriverState *overlay_bs;
     BlockDriverState *commit_top_bs = NULL;
-    Error *local_err = NULL;
     int ret;
 
     assert(top != bs);
@@ -328,9 +327,8 @@ void commit_start(const char *job_id, BlockDriverState *bs,
                                          orig_overlay_flags | BDRV_O_RDWR);
     }
     if (reopen_queue) {
-        bdrv_reopen_multiple(bdrv_get_aio_context(bs), reopen_queue, &local_err);
-        if (local_err != NULL) {
-            error_propagate(errp, local_err);
+        bdrv_reopen_multiple(bdrv_get_aio_context(bs), reopen_queue, errp);
+        if (ERR_IS_SET(errp)) {
             goto fail;
         }
     }
@@ -345,18 +343,16 @@ void commit_start(const char *job_id, BlockDriverState *bs,
     commit_top_bs->total_sectors = top->total_sectors;
     bdrv_set_aio_context(commit_top_bs, bdrv_get_aio_context(top));
 
-    bdrv_set_backing_hd(commit_top_bs, top, &local_err);
-    if (local_err) {
+    bdrv_set_backing_hd(commit_top_bs, top, errp);
+    if (ERR_IS_SET(errp)) {
         bdrv_unref(commit_top_bs);
         commit_top_bs = NULL;
-        error_propagate(errp, local_err);
         goto fail;
     }
-    bdrv_set_backing_hd(overlay_bs, commit_top_bs, &local_err);
-    if (local_err) {
+    bdrv_set_backing_hd(overlay_bs, commit_top_bs, errp);
+    if (ERR_IS_SET(errp)) {
         bdrv_unref(commit_top_bs);
         commit_top_bs = NULL;
-        error_propagate(errp, local_err);
         goto fail;
     }
 
diff --git a/block/crypto.c b/block/crypto.c
index 5c2687d271..d98ae60c48 100644
--- a/block/crypto.c
+++ b/block/crypto.c
@@ -295,7 +295,6 @@ static int block_crypto_open_generic(QCryptoBlockFormat format,
 {
     BlockCrypto *crypto = bs->opaque;
     QemuOpts *opts = NULL;
-    Error *local_err = NULL;
     int ret = -EINVAL;
     QCryptoBlockOpenOptions *open_opts = NULL;
     unsigned int cflags = 0;
@@ -307,9 +306,8 @@ static int block_crypto_open_generic(QCryptoBlockFormat format,
     }
 
     opts = qemu_opts_create(opts_spec, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    qemu_opts_absorb_qdict(opts, options, errp);
+    if (ERR_IS_SET(errp)) {
         goto cleanup;
     }
 
diff --git a/block/curl.c b/block/curl.c
index 2a244e2439..05ed2e82c6 100644
--- a/block/curl.c
+++ b/block/curl.c
@@ -679,7 +679,6 @@ static int curl_open(BlockDriverState *bs, QDict *options, int flags,
     BDRVCURLState *s = bs->opaque;
     CURLState *state = NULL;
     QemuOpts *opts;
-    Error *local_err = NULL;
     const char *file;
     const char *cookie;
     const char *cookie_secret;
@@ -696,9 +695,8 @@ static int curl_open(BlockDriverState *bs, QDict *options, int flags,
 
     qemu_mutex_init(&s->mutex);
     opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    qemu_opts_absorb_qdict(opts, options, errp);
+    if (ERR_IS_SET(errp)) {
         goto out_noclean;
     }
 
diff --git a/block/file-posix.c b/block/file-posix.c
index 5e30164be3..ba49f0b528 100644
--- a/block/file-posix.c
+++ b/block/file-posix.c
@@ -756,7 +756,6 @@ static int raw_reopen_prepare(BDRVReopenState *state,
     BDRVRawState *s;
     BDRVRawReopenState *rs;
     int ret = 0;
-    Error *local_err = NULL;
 
     assert(state != NULL);
     assert(state->bs != NULL);
@@ -819,11 +818,10 @@ static int raw_reopen_prepare(BDRVReopenState *state,
     /* Fail already reopen_prepare() if we can't get a working O_DIRECT
      * alignment with the new fd. */
     if (rs->fd != -1) {
-        raw_probe_alignment(state->bs, rs->fd, &local_err);
-        if (local_err) {
+        raw_probe_alignment(state->bs, rs->fd, errp);
+        if (ERR_IS_SET(errp)) {
             qemu_close(rs->fd);
             rs->fd = -1;
-            error_propagate(errp, local_err);
             ret = -EINVAL;
         }
     }
diff --git a/block/gluster.c b/block/gluster.c
index 6179195620..30ac978a89 100644
--- a/block/gluster.c
+++ b/block/gluster.c
@@ -765,13 +765,11 @@ static int qemu_gluster_open(BlockDriverState *bs,  QDict *options,
     int ret = 0;
     BlockdevOptionsGluster *gconf = NULL;
     QemuOpts *opts;
-    Error *local_err = NULL;
     const char *filename, *logfile;
 
     opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    qemu_opts_absorb_qdict(opts, options, errp);
+    if (ERR_IS_SET(errp)) {
         ret = -EINVAL;
         goto out;
     }
diff --git a/block/io.c b/block/io.c
index ed31810c0a..cc3fd997a7 100644
--- a/block/io.c
+++ b/block/io.c
@@ -81,7 +81,6 @@ static void bdrv_merge_limits(BlockLimits *dst, const BlockLimits *src)
 void bdrv_refresh_limits(BlockDriverState *bs, Error **errp)
 {
     BlockDriver *drv = bs->drv;
-    Error *local_err = NULL;
 
     memset(&bs->bl, 0, sizeof(bs->bl));
 
@@ -94,9 +93,8 @@ void bdrv_refresh_limits(BlockDriverState *bs, Error **errp)
 
     /* Take some limits from the children as a default */
     if (bs->file) {
-        bdrv_refresh_limits(bs->file->bs, &local_err);
-        if (local_err) {
-            error_propagate(errp, local_err);
+        bdrv_refresh_limits(bs->file->bs, errp);
+        if (ERR_IS_SET(errp)) {
             return;
         }
         bdrv_merge_limits(&bs->bl, &bs->file->bs->bl);
@@ -109,9 +107,8 @@ void bdrv_refresh_limits(BlockDriverState *bs, Error **errp)
     }
 
     if (bs->backing) {
-        bdrv_refresh_limits(bs->backing->bs, &local_err);
-        if (local_err) {
-            error_propagate(errp, local_err);
+        bdrv_refresh_limits(bs->backing->bs, errp);
+        if (ERR_IS_SET(errp)) {
             return;
         }
         bdrv_merge_limits(&bs->bl, &bs->backing->bs->bl);
diff --git a/block/iscsi.c b/block/iscsi.c
index 0116fe97ce..6b3939585c 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -1747,7 +1747,6 @@ static int iscsi_open(BlockDriverState *bs, QDict *options, int flags,
     struct scsi_inquiry_supported_pages *inq_vpd;
     char *initiator_name = NULL;
     QemuOpts *opts;
-    Error *local_err = NULL;
     const char *transport_name, *portal, *target;
 #if LIBISCSI_API_VERSION >= (20160603)
     enum iscsi_transport_type transport;
@@ -1755,9 +1754,8 @@ static int iscsi_open(BlockDriverState *bs, QDict *options, int flags,
     int i, ret = 0, timeout = 0, lun;
 
     opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    qemu_opts_absorb_qdict(opts, options, errp);
+    if (ERR_IS_SET(errp)) {
         ret = -EINVAL;
         goto out;
     }
@@ -1811,9 +1809,8 @@ static int iscsi_open(BlockDriverState *bs, QDict *options, int flags,
     }
 
     /* check if we got CHAP username/password via the options */
-    apply_chap(iscsi, opts, &local_err);
-    if (local_err != NULL) {
-        error_propagate(errp, local_err);
+    apply_chap(iscsi, opts, errp);
+    if (ERR_IS_SET(errp)) {
         ret = -EINVAL;
         goto out;
     }
@@ -1825,9 +1822,8 @@ static int iscsi_open(BlockDriverState *bs, QDict *options, int flags,
     }
 
     /* check if we got HEADER_DIGEST via the options */
-    apply_header_digest(iscsi, opts, &local_err);
-    if (local_err != NULL) {
-        error_propagate(errp, local_err);
+    apply_header_digest(iscsi, opts, errp);
+    if (ERR_IS_SET(errp)) {
         ret = -EINVAL;
         goto out;
     }
@@ -1878,9 +1874,8 @@ static int iscsi_open(BlockDriverState *bs, QDict *options, int flags,
         goto out;
     }
 
-    iscsi_readcapacity_sync(iscsilun, &local_err);
-    if (local_err != NULL) {
-        error_propagate(errp, local_err);
+    iscsi_readcapacity_sync(iscsilun, errp);
+    if (ERR_IS_SET(errp)) {
         ret = -EINVAL;
         goto out;
     }
@@ -2063,16 +2058,14 @@ static void iscsi_reopen_commit(BDRVReopenState *reopen_state)
 static int iscsi_truncate(BlockDriverState *bs, int64_t offset, Error **errp)
 {
     IscsiLun *iscsilun = bs->opaque;
-    Error *local_err = NULL;
 
     if (iscsilun->type != TYPE_DISK) {
         error_setg(errp, "Cannot resize non-disk iSCSI devices");
         return -ENOTSUP;
     }
 
-    iscsi_readcapacity_sync(iscsilun, &local_err);
-    if (local_err != NULL) {
-        error_propagate(errp, local_err);
+    iscsi_readcapacity_sync(iscsilun, errp);
+    if (ERR_IS_SET(errp)) {
         return -EIO;
     }
 
diff --git a/block/mirror.c b/block/mirror.c
index 2d5d7dbbc2..addafec0ee 100644
--- a/block/mirror.c
+++ b/block/mirror.c
@@ -1127,7 +1127,6 @@ static void mirror_start_job(const char *job_id, BlockDriverState *bs,
     BlockDriverState *mirror_top_bs;
     bool target_graph_mod;
     bool target_is_backing;
-    Error *local_err = NULL;
     int ret;
 
     if (granularity == 0) {
@@ -1160,12 +1159,11 @@ static void mirror_start_job(const char *job_id, BlockDriverState *bs,
      * it alive until block_job_create() succeeds even if bs has no parent. */
     bdrv_ref(mirror_top_bs);
     bdrv_drained_begin(bs);
-    bdrv_append(mirror_top_bs, bs, &local_err);
+    bdrv_append(mirror_top_bs, bs, errp);
     bdrv_drained_end(bs);
 
-    if (local_err) {
+    if (ERR_IS_SET(errp)) {
         bdrv_unref(mirror_top_bs);
-        error_propagate(errp, local_err);
         return;
     }
 
@@ -1299,7 +1297,6 @@ void commit_active_start(const char *job_id, BlockDriverState *bs,
                          bool auto_complete, Error **errp)
 {
     int orig_base_flags;
-    Error *local_err = NULL;
 
     orig_base_flags = bdrv_get_flags(base);
 
@@ -1311,9 +1308,8 @@ void commit_active_start(const char *job_id, BlockDriverState *bs,
                      MIRROR_LEAVE_BACKING_CHAIN,
                      on_error, on_error, true, cb, opaque,
                      &commit_active_job_driver, false, base, auto_complete,
-                     filter_node_name, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+                     filter_node_name, errp);
+    if (ERR_IS_SET(errp)) {
         goto error_restore_flags;
     }
 
diff --git a/block/nbd.c b/block/nbd.c
index 975faab2c5..6644c0e75f 100644
--- a/block/nbd.c
+++ b/block/nbd.c
@@ -265,7 +265,6 @@ static SocketAddress *nbd_config(BDRVNBDState *s, QDict *options,
     QDict *addr = NULL;
     QObject *crumpled_addr = NULL;
     Visitor *iv = NULL;
-    Error *local_err = NULL;
 
     qdict_extract_subqdict(options, &addr, "server.");
     if (!qdict_size(addr)) {
@@ -287,9 +286,8 @@ static SocketAddress *nbd_config(BDRVNBDState *s, QDict *options,
      * visitor expects the former.
      */
     iv = qobject_input_visitor_new(crumpled_addr);
-    visit_type_SocketAddress(iv, NULL, &saddr, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    visit_type_SocketAddress(iv, NULL, &saddr, errp);
+    if (ERR_IS_SET(errp)) {
         goto done;
     }
 
@@ -310,17 +308,15 @@ static QIOChannelSocket *nbd_establish_connection(SocketAddress *saddr,
                                                   Error **errp)
 {
     QIOChannelSocket *sioc;
-    Error *local_err = NULL;
 
     sioc = qio_channel_socket_new();
     qio_channel_set_name(QIO_CHANNEL(sioc), "nbd-client");
 
     qio_channel_socket_connect_sync(sioc,
                                     saddr,
-                                    &local_err);
-    if (local_err) {
+                                    errp);
+    if (ERR_IS_SET(errp)) {
         object_unref(OBJECT(sioc));
-        error_propagate(errp, local_err);
         return NULL;
     }
 
@@ -397,16 +393,14 @@ static int nbd_open(BlockDriverState *bs, QDict *options, int flags,
 {
     BDRVNBDState *s = bs->opaque;
     QemuOpts *opts = NULL;
-    Error *local_err = NULL;
     QIOChannelSocket *sioc = NULL;
     QCryptoTLSCreds *tlscreds = NULL;
     const char *hostname = NULL;
     int ret = -EINVAL;
 
     opts = qemu_opts_create(&nbd_runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    qemu_opts_absorb_qdict(opts, options, errp);
+    if (ERR_IS_SET(errp)) {
         goto error;
     }
 
diff --git a/block/nfs.c b/block/nfs.c
index 848b2c0bb0..7792b3ad01 100644
--- a/block/nfs.c
+++ b/block/nfs.c
@@ -455,7 +455,6 @@ static NFSServer *nfs_config(QDict *options, Error **errp)
     QDict *addr = NULL;
     QObject *crumpled_addr = NULL;
     Visitor *iv = NULL;
-    Error *local_error = NULL;
 
     qdict_extract_subqdict(options, &addr, "server.");
     if (!qdict_size(addr)) {
@@ -476,9 +475,8 @@ static NFSServer *nfs_config(QDict *options, Error **errp)
      * they come from -drive, they're all QString.
      */
     iv = qobject_input_visitor_new(crumpled_addr);
-    visit_type_NFSServer(iv, NULL, &server, &local_error);
-    if (local_error) {
-        error_propagate(errp, local_error);
+    visit_type_NFSServer(iv, NULL, &server, errp);
+    if (ERR_IS_SET(errp)) {
         goto out;
     }
 
@@ -495,14 +493,12 @@ static int64_t nfs_client_open(NFSClient *client, QDict *options,
 {
     int ret = -EINVAL;
     QemuOpts *opts = NULL;
-    Error *local_err = NULL;
     struct stat st;
     char *file = NULL, *strp = NULL;
 
     opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    qemu_opts_absorb_qdict(opts, options, errp);
+    if (ERR_IS_SET(errp)) {
         ret = -EINVAL;
         goto fail;
     }
diff --git a/block/qapi.c b/block/qapi.c
index a40922ea26..423934f0bf 100644
--- a/block/qapi.c
+++ b/block/qapi.c
@@ -460,13 +460,11 @@ BlockInfoList *qmp_query_block(Error **errp)
 {
     BlockInfoList *head = NULL, **p_next = &head;
     BlockBackend *blk;
-    Error *local_err = NULL;
 
     for (blk = blk_next(NULL); blk; blk = blk_next(blk)) {
         BlockInfoList *info = g_malloc0(sizeof(*info));
-        bdrv_query_info(blk, &info->value, &local_err);
-        if (local_err) {
-            error_propagate(errp, local_err);
+        bdrv_query_info(blk, &info->value, errp);
+        if (ERR_IS_SET(errp)) {
             g_free(info);
             qapi_free_BlockInfoList(head);
             return NULL;
diff --git a/block/qcow2.c b/block/qcow2.c
index 53920a83b5..5e7e5bf292 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -598,22 +598,19 @@ static int qcow2_update_options_prepare(BlockDriverState *bs,
     int overlap_check_template = 0;
     uint64_t l2_cache_size, refcount_cache_size;
     int i;
-    Error *local_err = NULL;
     int ret;
 
     opts = qemu_opts_create(&qcow2_runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    qemu_opts_absorb_qdict(opts, options, errp);
+    if (ERR_IS_SET(errp)) {
         ret = -EINVAL;
         goto fail;
     }
 
     /* get L2 table/refcount block cache size from command line options */
     read_cache_sizes(bs, opts, &l2_cache_size, &refcount_cache_size,
-                     &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+                     errp);
+    if (ERR_IS_SET(errp)) {
         ret = -EINVAL;
         goto fail;
     }
diff --git a/block/raw-format.c b/block/raw-format.c
index 36e65036f0..5134373fbf 100644
--- a/block/raw-format.c
+++ b/block/raw-format.c
@@ -71,7 +71,6 @@ static QemuOptsList raw_create_opts = {
 static int raw_read_options(QDict *options, BlockDriverState *bs,
     BDRVRawState *s, Error **errp)
 {
-    Error *local_err = NULL;
     QemuOpts *opts = NULL;
     int64_t real_size = 0;
     int ret;
@@ -83,9 +82,8 @@ static int raw_read_options(QDict *options, BlockDriverState *bs,
     }
 
     opts = qemu_opts_create(&raw_runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    qemu_opts_absorb_qdict(opts, options, errp);
+    if (ERR_IS_SET(errp)) {
         ret = -EINVAL;
         goto end;
     }
diff --git a/block/rbd.c b/block/rbd.c
index e551639e47..25149e776b 100644
--- a/block/rbd.c
+++ b/block/rbd.c
@@ -346,7 +346,6 @@ static QemuOptsList runtime_opts = {
 
 static int qemu_rbd_create(const char *filename, QemuOpts *opts, Error **errp)
 {
-    Error *local_err = NULL;
     int64_t bytes = 0;
     int64_t objsize;
     int obj_order = 0;
@@ -378,10 +377,9 @@ static int qemu_rbd_create(const char *filename, QemuOpts *opts, Error **errp)
     }
 
     options = qdict_new();
-    qemu_rbd_parse_filename(filename, options, &local_err);
-    if (local_err) {
+    qemu_rbd_parse_filename(filename, options, errp);
+    if (ERR_IS_SET(errp)) {
         ret = -EINVAL;
-        error_propagate(errp, local_err);
         goto exit;
     }
 
diff --git a/block/replication.c b/block/replication.c
index c4ac17201a..c7ea016af9 100644
--- a/block/replication.c
+++ b/block/replication.c
@@ -313,7 +313,6 @@ static bool replication_recurse_is_first_non_filter(BlockDriverState *bs,
 
 static void secondary_do_checkpoint(BDRVReplicationState *s, Error **errp)
 {
-    Error *local_err = NULL;
     int ret;
 
     if (!s->secondary_disk->bs->job) {
@@ -321,9 +320,8 @@ static void secondary_do_checkpoint(BDRVReplicationState *s, Error **errp)
         return;
     }
 
-    backup_do_checkpoint(s->secondary_disk->bs->job, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    backup_do_checkpoint(s->secondary_disk->bs->job, errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
@@ -347,7 +345,6 @@ static void reopen_backing_file(BlockDriverState *bs, bool writable,
     BlockReopenQueue *reopen_queue = NULL;
     int orig_hidden_flags, orig_secondary_flags;
     int new_hidden_flags, new_secondary_flags;
-    Error *local_err = NULL;
 
     if (writable) {
         orig_hidden_flags = s->orig_hidden_flags =
@@ -379,8 +376,7 @@ static void reopen_backing_file(BlockDriverState *bs, bool writable,
 
     if (reopen_queue) {
         bdrv_reopen_multiple(bdrv_get_aio_context(bs),
-                             reopen_queue, &local_err);
-        error_propagate(errp, local_err);
+                             reopen_queue, errp);
     }
 }
 
diff --git a/block/sheepdog.c b/block/sheepdog.c
index dd75571435..6160fa6717 100644
--- a/block/sheepdog.c
+++ b/block/sheepdog.c
@@ -553,7 +553,6 @@ static SocketAddress *sd_server_config(QDict *options, Error **errp)
     QObject *crumpled_server = NULL;
     Visitor *iv = NULL;
     SocketAddress *saddr = NULL;
-    Error *local_err = NULL;
 
     qdict_extract_subqdict(options, &server, "server.");
 
@@ -571,9 +570,8 @@ static SocketAddress *sd_server_config(QDict *options, Error **errp)
      * visitor expects the former.
      */
     iv = qobject_input_visitor_new(crumpled_server);
-    visit_type_SocketAddress(iv, NULL, &saddr, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    visit_type_SocketAddress(iv, NULL, &saddr, errp);
+    if (ERR_IS_SET(errp)) {
         goto done;
     }
 
@@ -1197,17 +1195,15 @@ static void parse_vdiname(SheepdogConfig *cfg, const char *filename,
 static void sd_parse_filename(const char *filename, QDict *options,
                               Error **errp)
 {
-    Error *err = NULL;
     SheepdogConfig cfg;
     char buf[32];
 
     if (strstr(filename, "://")) {
-        sd_parse_uri(&cfg, filename, &err);
+        sd_parse_uri(&cfg, filename, errp);
     } else {
-        parse_vdiname(&cfg, filename, &err);
+        parse_vdiname(&cfg, filename, errp);
     }
-    if (err) {
-        error_propagate(errp, err);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
@@ -1572,15 +1568,13 @@ static int sd_open(BlockDriverState *bs, QDict *options, int flags,
     uint64_t snap_id;
     char *buf = NULL;
     QemuOpts *opts;
-    Error *local_err = NULL;
 
     s->bs = bs;
     s->aio_context = bdrv_get_aio_context(bs);
 
     opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    qemu_opts_absorb_qdict(opts, options, errp);
+    if (ERR_IS_SET(errp)) {
         ret = -EINVAL;
         goto err_no_fd;
     }
@@ -1955,7 +1949,6 @@ static int parse_block_size_shift(BDRVSheepdogState *s, QemuOpts *opt)
 static int sd_create(const char *filename, QemuOpts *opts,
                      Error **errp)
 {
-    Error *err = NULL;
     int ret = 0;
     uint32_t vid = 0;
     char *backing_file = NULL;
@@ -1968,12 +1961,11 @@ static int sd_create(const char *filename, QemuOpts *opts,
     s = g_new0(BDRVSheepdogState, 1);
 
     if (strstr(filename, "://")) {
-        sd_parse_uri(&cfg, filename, &err);
+        sd_parse_uri(&cfg, filename, errp);
     } else {
-        parse_vdiname(&cfg, filename, &err);
+        parse_vdiname(&cfg, filename, errp);
     }
-    if (err) {
-        error_propagate(errp, err);
+    if (ERR_IS_SET(errp)) {
         goto out;
     }
 
diff --git a/block/ssh.c b/block/ssh.c
index 11203fc5a2..008e256ad1 100644
--- a/block/ssh.c
+++ b/block/ssh.c
@@ -586,7 +586,6 @@ static InetSocketAddress *ssh_config(QDict *options, Error **errp)
     QDict *addr = NULL;
     QObject *crumpled_addr = NULL;
     Visitor *iv = NULL;
-    Error *local_error = NULL;
 
     qdict_extract_subqdict(options, &addr, "server.");
     if (!qdict_size(addr)) {
@@ -608,9 +607,8 @@ static InetSocketAddress *ssh_config(QDict *options, Error **errp)
      * visitor expects the former.
      */
     iv = qobject_input_visitor_new(crumpled_addr);
-    visit_type_InetSocketAddress(iv, NULL, &inet, &local_error);
-    if (local_error) {
-        error_propagate(errp, local_error);
+    visit_type_InetSocketAddress(iv, NULL, &inet, errp);
+    if (ERR_IS_SET(errp)) {
         goto out;
     }
 
@@ -626,15 +624,13 @@ static int connect_to_ssh(BDRVSSHState *s, QDict *options,
 {
     int r, ret;
     QemuOpts *opts = NULL;
-    Error *local_err = NULL;
     const char *user, *path, *host_key_check;
     long port = 0;
 
     opts = qemu_opts_create(&ssh_runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
+    qemu_opts_absorb_qdict(opts, options, errp);
+    if (ERR_IS_SET(errp)) {
         ret = -EINVAL;
-        error_propagate(errp, local_err);
         goto err;
     }
 
diff --git a/blockdev.c b/blockdev.c
index fdbf33aa3d..3ce592d4af 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -1620,7 +1620,6 @@ static void external_snapshot_prepare(BlkActionState *common,
 {
     int flags = 0;
     QDict *options = NULL;
-    Error *local_err = NULL;
     /* Device and node name of the image to generate the snapshot from */
     const char *device;
     const char *node_name;
@@ -1726,9 +1725,8 @@ static void external_snapshot_prepare(BlkActionState *common,
             bdrv_img_create(new_image_file, format,
                             state->old_bs->filename,
                             state->old_bs->drv->format_name,
-                            NULL, size, flags, false, &local_err);
-            if (local_err) {
-                error_propagate(errp, local_err);
+                            NULL, size, flags, false, errp);
+            if (ERR_IS_SET(errp)) {
                 return;
             }
         }
@@ -1775,9 +1773,8 @@ static void external_snapshot_prepare(BlkActionState *common,
      * can fail, so we need to do it in .prepare; undoing it for abort is
      * always possible. */
     bdrv_ref(state->new_bs);
-    bdrv_append(state->new_bs, state->old_bs, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    bdrv_append(state->new_bs, state->old_bs, errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
     state->overlay_appended = true;
@@ -2166,7 +2163,6 @@ void qmp_transaction(TransactionActionList *dev_list,
     TransactionActionList *dev_entry = dev_list;
     BlockJobTxn *block_job_txn = NULL;
     BlkActionState *state, *next;
-    Error *local_err = NULL;
 
     QSIMPLEQ_HEAD(snap_bdrv_states, BlkActionState) snap_bdrv_states;
     QSIMPLEQ_INIT(&snap_bdrv_states);
@@ -2202,9 +2198,8 @@ void qmp_transaction(TransactionActionList *dev_list,
         state->txn_props = props;
         QSIMPLEQ_INSERT_TAIL(&snap_bdrv_states, state, entry);
 
-        state->ops->prepare(state, &local_err);
-        if (local_err) {
-            error_propagate(errp, local_err);
+        state->ops->prepare(state, errp);
+        if (ERR_IS_SET(errp)) {
             goto delete_and_fail;
         }
     }
@@ -2366,7 +2361,6 @@ void qmp_blockdev_close_tray(bool has_device, const char *device,
                              Error **errp)
 {
     BlockBackend *blk;
-    Error *local_err = NULL;
 
     device = has_device ? device : NULL;
     id = has_id ? id : NULL;
@@ -2390,9 +2384,8 @@ void qmp_blockdev_close_tray(bool has_device, const char *device,
         return;
     }
 
-    blk_dev_change_media_cb(blk, true, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    blk_dev_change_media_cb(blk, true, errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 }
@@ -2457,7 +2450,6 @@ out:
 static void qmp_blockdev_insert_anon_medium(BlockBackend *blk,
                                             BlockDriverState *bs, Error **errp)
 {
-    Error *local_err = NULL;
     bool has_device;
     int ret;
 
@@ -2490,9 +2482,8 @@ static void qmp_blockdev_insert_anon_medium(BlockBackend *blk,
          * slot here.
          * Do it after blk_insert_bs() so blk_is_inserted(blk) returns the @load
          * value passed here (i.e. true). */
-        blk_dev_change_media_cb(blk, true, &local_err);
-        if (local_err) {
-            error_propagate(errp, local_err);
+        blk_dev_change_media_cb(blk, true, errp);
+        if (ERR_IS_SET(errp)) {
             blk_remove_bs(blk);
             return;
         }
@@ -2947,7 +2938,6 @@ void qmp_block_stream(bool has_job_id, const char *job_id, const char *device,
     BlockDriverState *bs, *iter;
     BlockDriverState *base_bs = NULL;
     AioContext *aio_context;
-    Error *local_err = NULL;
     const char *base_name = NULL;
 
     if (!has_on_error) {
@@ -3011,9 +3001,8 @@ void qmp_block_stream(bool has_job_id, const char *job_id, const char *device,
     base_name = has_backing_file ? backing_file : base_name;
 
     stream_start(has_job_id ? job_id : NULL, bs, base_bs, base_name,
-                 has_speed ? speed : 0, on_error, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+                 has_speed ? speed : 0, on_error, errp);
+    if (ERR_IS_SET(errp)) {
         goto out;
     }
 
@@ -3600,7 +3589,6 @@ void qmp_blockdev_mirror(bool has_job_id, const char *job_id,
     BlockDriverState *target_bs;
     AioContext *aio_context;
     BlockMirrorBackingMode backing_mode = MIRROR_LEAVE_BACKING_CHAIN;
-    Error *local_err = NULL;
 
     bs = qmp_get_root_bs(device, errp);
     if (!bs) {
@@ -3626,8 +3614,7 @@ void qmp_blockdev_mirror(bool has_job_id, const char *job_id,
                            has_on_target_error, on_target_error,
                            true, true,
                            has_filter_node_name, filter_node_name,
-                           &local_err);
-    error_propagate(errp, local_err);
+                           errp);
 
     aio_context_release(aio_context);
 }
@@ -3856,11 +3843,9 @@ void qmp_blockdev_add(BlockdevOptions *options, Error **errp)
     QObject *obj;
     Visitor *v = qobject_output_visitor_new(&obj);
     QDict *qdict;
-    Error *local_err = NULL;
 
-    visit_type_BlockdevOptions(v, NULL, &options, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    visit_type_BlockdevOptions(v, NULL, &options, errp);
+    if (ERR_IS_SET(errp)) {
         goto fail;
     }
 
diff --git a/blockjob.c b/blockjob.c
index 69ad28dd65..c0b528f1e9 100644
--- a/blockjob.c
+++ b/blockjob.c
@@ -356,7 +356,6 @@ static int block_job_finish_sync(BlockJob *job,
                                  void (*finish)(BlockJob *, Error **errp),
                                  Error **errp)
 {
-    Error *local_err = NULL;
     int ret;
 
     assert(blk_bs(job->blk)->job == job);
@@ -364,10 +363,9 @@ static int block_job_finish_sync(BlockJob *job,
     block_job_ref(job);
 
     if (finish) {
-        finish(job, &local_err);
+        finish(job, errp);
     }
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (ERR_IS_SET(errp)) {
         block_job_unref(job);
         return -EBUSY;
     }
@@ -454,15 +452,12 @@ static void block_job_completed_txn_success(BlockJob *job)
 
 void block_job_set_speed(BlockJob *job, int64_t speed, Error **errp)
 {
-    Error *local_err = NULL;
-
     if (!job->driver->set_speed) {
         error_setg(errp, QERR_UNSUPPORTED);
         return;
     }
-    job->driver->set_speed(job, speed, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    job->driver->set_speed(job, speed, errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
diff --git a/bootdevice.c b/bootdevice.c
index 29ebbb1c48..92f607d321 100644
--- a/bootdevice.c
+++ b/bootdevice.c
@@ -52,17 +52,14 @@ void qemu_register_boot_set(QEMUBootSetHandler *func, void *opaque)
 
 void qemu_boot_set(const char *boot_order, Error **errp)
 {
-    Error *local_err = NULL;
-
     if (!boot_set_handler) {
         error_setg(errp, "no function defined to set boot device list for"
                          " this architecture");
         return;
     }
 
-    validate_bootdevices(boot_order, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    validate_bootdevices(boot_order, errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
@@ -319,7 +316,6 @@ void device_add_bootindex_property(Object *obj, int32_t *bootindex,
                                    const char *name, const char *suffix,
                                    DeviceState *dev, Error **errp)
 {
-    Error *local_err = NULL;
     BootIndexProperty *prop = g_malloc0(sizeof(*prop));
 
     prop->bootindex = bootindex;
@@ -330,10 +326,9 @@ void device_add_bootindex_property(Object *obj, int32_t *bootindex,
                         device_get_bootindex,
                         device_set_bootindex,
                         property_release_bootindex,
-                        prop, &local_err);
+                        prop, errp);
 
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (ERR_IS_SET(errp)) {
         g_free(prop);
         return;
     }
diff --git a/chardev/char.c b/chardev/char.c
index 7aa0210765..ac3cd2b436 100644
--- a/chardev/char.c
+++ b/chardev/char.c
@@ -559,7 +559,6 @@ help_string_append(const char *name, void *opaque)
 Chardev *qemu_chr_new_from_opts(QemuOpts *opts,
                                 Error **errp)
 {
-    Error *local_err = NULL;
     const ChardevClass *cc;
     Chardev *chr;
     int i;
@@ -610,9 +609,8 @@ Chardev *qemu_chr_new_from_opts(QemuOpts *opts,
 
     chr = NULL;
     if (cc->parse) {
-        cc->parse(opts, backend, &local_err);
-        if (local_err) {
-            error_propagate(errp, local_err);
+        cc->parse(opts, backend, errp);
+        if (ERR_IS_SET(errp)) {
             goto out;
         }
     } else {
diff --git a/dump.c b/dump.c
index dc78c98b23..3fa8ba3571 100644
--- a/dump.c
+++ b/dump.c
@@ -348,22 +348,19 @@ static void write_memory(DumpState *s, GuestPhysBlock *block, ram_addr_t start,
                          int64_t size, Error **errp)
 {
     int64_t i;
-    Error *local_err = NULL;
 
     for (i = 0; i < size / s->dump_info.page_size; i++) {
         write_data(s, block->host_addr + start + i * s->dump_info.page_size,
-                   s->dump_info.page_size, &local_err);
-        if (local_err) {
-            error_propagate(errp, local_err);
+                   s->dump_info.page_size, errp);
+        if (ERR_IS_SET(errp)) {
             return;
         }
     }
 
     if ((size % s->dump_info.page_size) != 0) {
         write_data(s, block->host_addr + start + i * s->dump_info.page_size,
-                   size % s->dump_info.page_size, &local_err);
-        if (local_err) {
-            error_propagate(errp, local_err);
+                   size % s->dump_info.page_size, errp);
+        if (ERR_IS_SET(errp)) {
             return;
         }
     }
@@ -437,7 +434,6 @@ static void write_elf_loads(DumpState *s, Error **errp)
     MemoryMapping *memory_mapping;
     uint32_t phdr_index = 1;
     uint32_t max_index;
-    Error *local_err = NULL;
 
     if (s->have_section) {
         max_index = s->sh_info;
@@ -451,14 +447,13 @@ static void write_elf_loads(DumpState *s, Error **errp)
                          s, &offset, &filesz);
         if (s->dump_info.d_class == ELFCLASS64) {
             write_elf64_load(s, memory_mapping, phdr_index++, offset,
-                             filesz, &local_err);
+                             filesz, errp);
         } else {
             write_elf32_load(s, memory_mapping, phdr_index++, offset,
-                             filesz, &local_err);
+                             filesz, errp);
         }
 
-        if (local_err) {
-            error_propagate(errp, local_err);
+        if (ERR_IS_SET(errp)) {
             return;
         }
 
@@ -471,101 +466,65 @@ static void write_elf_loads(DumpState *s, Error **errp)
 /* write elf header, PT_NOTE and elf note to vmcore. */
 static void dump_begin(DumpState *s, Error **errp)
 {
-    Error *local_err = NULL;
-
-    /*
-     * the vmcore's format is:
-     *   --------------
-     *   |  elf header |
-     *   --------------
-     *   |  PT_NOTE    |
-     *   --------------
-     *   |  PT_LOAD    |
-     *   --------------
-     *   |  ......     |
-     *   --------------
-     *   |  PT_LOAD    |
-     *   --------------
-     *   |  sec_hdr    |
-     *   --------------
-     *   |  elf note   |
-     *   --------------
-     *   |  memory     |
-     *   --------------
-     *
-     * we only know where the memory is saved after we write elf note into
-     * vmcore.
-     */
-
-    /* write elf header to vmcore */
     if (s->dump_info.d_class == ELFCLASS64) {
-        write_elf64_header(s, &local_err);
+        write_elf64_header(s, errp);
     } else {
-        write_elf32_header(s, &local_err);
+        write_elf32_header(s, errp);
     }
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
     if (s->dump_info.d_class == ELFCLASS64) {
         /* write PT_NOTE to vmcore */
-        write_elf64_note(s, &local_err);
-        if (local_err) {
-            error_propagate(errp, local_err);
+        write_elf64_note(s, errp);
+        if (ERR_IS_SET(errp)) {
             return;
         }
 
         /* write all PT_LOAD to vmcore */
-        write_elf_loads(s, &local_err);
-        if (local_err) {
-            error_propagate(errp, local_err);
+        write_elf_loads(s, errp);
+        if (ERR_IS_SET(errp)) {
             return;
         }
 
         /* write section to vmcore */
         if (s->have_section) {
-            write_elf_section(s, 1, &local_err);
-            if (local_err) {
-                error_propagate(errp, local_err);
+            write_elf_section(s, 1, errp);
+            if (ERR_IS_SET(errp)) {
                 return;
             }
         }
 
         /* write notes to vmcore */
-        write_elf64_notes(fd_write_vmcore, s, &local_err);
-        if (local_err) {
-            error_propagate(errp, local_err);
+        write_elf64_notes(fd_write_vmcore, s, errp);
+        if (ERR_IS_SET(errp)) {
             return;
         }
     } else {
         /* write PT_NOTE to vmcore */
-        write_elf32_note(s, &local_err);
-        if (local_err) {
-            error_propagate(errp, local_err);
+        write_elf32_note(s, errp);
+        if (ERR_IS_SET(errp)) {
             return;
         }
 
         /* write all PT_LOAD to vmcore */
-        write_elf_loads(s, &local_err);
-        if (local_err) {
-            error_propagate(errp, local_err);
+        write_elf_loads(s, errp);
+        if (ERR_IS_SET(errp)) {
             return;
         }
 
         /* write section to vmcore */
         if (s->have_section) {
-            write_elf_section(s, 0, &local_err);
-            if (local_err) {
-                error_propagate(errp, local_err);
+            write_elf_section(s, 0, errp);
+            if (ERR_IS_SET(errp)) {
                 return;
             }
         }
 
         /* write notes to vmcore */
-        write_elf32_notes(fd_write_vmcore, s, &local_err);
-        if (local_err) {
-            error_propagate(errp, local_err);
+        write_elf32_notes(fd_write_vmcore, s, errp);
+        if (ERR_IS_SET(errp)) {
             return;
         }
     }
@@ -603,7 +562,6 @@ static void dump_iterate(DumpState *s, Error **errp)
 {
     GuestPhysBlock *block;
     int64_t size;
-    Error *local_err = NULL;
 
     do {
         block = s->next_block;
@@ -615,9 +573,8 @@ static void dump_iterate(DumpState *s, Error **errp)
                 size -= block->target_end - (s->begin + s->length);
             }
         }
-        write_memory(s, block, s->start, size, &local_err);
-        if (local_err) {
-            error_propagate(errp, local_err);
+        write_memory(s, block, s->start, size, errp);
+        if (ERR_IS_SET(errp)) {
             return;
         }
 
@@ -626,11 +583,8 @@ static void dump_iterate(DumpState *s, Error **errp)
 
 static void create_vmcore(DumpState *s, Error **errp)
 {
-    Error *local_err = NULL;
-
-    dump_begin(s, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    dump_begin(s, errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
@@ -725,7 +679,6 @@ static void create_header32(DumpState *s, Error **errp)
     uint32_t bitmap_blocks;
     uint32_t status = 0;
     uint64_t offset_note;
-    Error *local_err = NULL;
 
     /* write common header, the version of kdump-compressed format is 6th */
     size = sizeof(DiskDumpHeader32);
@@ -789,9 +742,8 @@ static void create_header32(DumpState *s, Error **errp)
     s->note_buf_offset = 0;
 
     /* use s->note_buf to store notes temporarily */
-    write_elf32_notes(buf_write_note, s, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    write_elf32_notes(buf_write_note, s, errp);
+    if (ERR_IS_SET(errp)) {
         goto out;
     }
     if (write_buffer(s->fd, offset_note, s->note_buf,
@@ -825,7 +777,6 @@ static void create_header64(DumpState *s, Error **errp)
     uint32_t bitmap_blocks;
     uint32_t status = 0;
     uint64_t offset_note;
-    Error *local_err = NULL;
 
     /* write common header, the version of kdump-compressed format is 6th */
     size = sizeof(DiskDumpHeader64);
@@ -889,9 +840,8 @@ static void create_header64(DumpState *s, Error **errp)
     s->note_buf_offset = 0;
 
     /* use s->note_buf to store notes temporarily */
-    write_elf64_notes(buf_write_note, s, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    write_elf64_notes(buf_write_note, s, errp);
+    if (ERR_IS_SET(errp)) {
         goto out;
     }
 
@@ -917,14 +867,11 @@ out:
 
 static void write_dump_header(DumpState *s, Error **errp)
 {
-     Error *local_err = NULL;
-
     if (s->dump_info.d_class == ELFCLASS32) {
-        create_header32(s, &local_err);
+        create_header32(s, errp);
     } else {
-        create_header64(s, &local_err);
+        create_header64(s, errp);
     }
-    error_propagate(errp, local_err);
 }
 
 static size_t dump_bitmap_get_bufsize(DumpState *s)
@@ -1359,7 +1306,6 @@ out:
 static void create_kdump_vmcore(DumpState *s, Error **errp)
 {
     int ret;
-    Error *local_err = NULL;
 
     /*
      * the kdump-compressed format is:
@@ -1389,21 +1335,18 @@ static void create_kdump_vmcore(DumpState *s, Error **errp)
         return;
     }
 
-    write_dump_header(s, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    write_dump_header(s, errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
-    write_dump_bitmap(s, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    write_dump_bitmap(s, errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
-    write_dump_pages(s, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    write_dump_pages(s, errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
@@ -1494,7 +1437,6 @@ static void dump_init(DumpState *s, int fd, bool has_format,
 {
     CPUState *cpu;
     int nr_cpus;
-    Error *err = NULL;
     int ret;
 
     s->has_format = has_format;
@@ -1565,9 +1507,8 @@ static void dump_init(DumpState *s, int fd, bool has_format,
 
     /* get memory mapping */
     if (paging) {
-        qemu_get_guest_memory_mapping(&s->list, &s->guest_phys_blocks, &err);
-        if (err != NULL) {
-            error_propagate(errp, err);
+        qemu_get_guest_memory_mapping(&s->list, &s->guest_phys_blocks, errp);
+        if (ERR_IS_SET(errp)) {
             goto cleanup;
         }
     } else {
@@ -1723,7 +1664,6 @@ void qmp_dump_guest_memory(bool paging, const char *file,
     const char *p;
     int fd = -1;
     DumpState *s;
-    Error *local_err = NULL;
     bool detach_p = false;
 
     if (runstate_check(RUN_STATE_INMIGRATE)) {
@@ -1801,9 +1741,8 @@ void qmp_dump_guest_memory(bool paging, const char *file,
     dump_state_prepare(s);
 
     dump_init(s, fd, has_format, format, paging, has_begin,
-              begin, length, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+              begin, length, errp);
+    if (ERR_IS_SET(errp)) {
         atomic_set(&s->status, DUMP_STATUS_FAILED);
         return;
     }
diff --git a/exec.c b/exec.c
index 9d73a63f1c..35d9588350 100644
--- a/exec.c
+++ b/exec.c
@@ -1860,7 +1860,6 @@ static void ram_block_add(RAMBlock *new_block, Error **errp)
     RAMBlock *block;
     RAMBlock *last_block = NULL;
     ram_addr_t old_ram_size, new_ram_size;
-    Error *err = NULL;
 
     old_ram_size = last_ram_page();
 
@@ -1870,9 +1869,8 @@ static void ram_block_add(RAMBlock *new_block, Error **errp)
     if (!new_block->host) {
         if (xen_enabled()) {
             xen_ram_alloc(new_block->offset, new_block->max_length,
-                          new_block->mr, &err);
-            if (err) {
-                error_propagate(errp, err);
+                          new_block->mr, errp);
+            if (ERR_IS_SET(errp)) {
                 qemu_mutex_unlock_ramlist();
                 return;
             }
@@ -1938,7 +1936,6 @@ RAMBlock *qemu_ram_alloc_from_file(ram_addr_t size, MemoryRegion *mr,
                                    Error **errp)
 {
     RAMBlock *new_block;
-    Error *local_err = NULL;
 
     if (xen_enabled()) {
         error_setg(errp, "-mem-path not supported with Xen");
@@ -1969,10 +1966,9 @@ RAMBlock *qemu_ram_alloc_from_file(ram_addr_t size, MemoryRegion *mr,
         return NULL;
     }
 
-    ram_block_add(new_block, &local_err);
-    if (local_err) {
+    ram_block_add(new_block, errp);
+    if (ERR_IS_SET(errp)) {
         g_free(new_block);
-        error_propagate(errp, local_err);
         return NULL;
     }
     return new_block;
@@ -1988,7 +1984,6 @@ RAMBlock *qemu_ram_alloc_internal(ram_addr_t size, ram_addr_t max_size,
                                   MemoryRegion *mr, Error **errp)
 {
     RAMBlock *new_block;
-    Error *local_err = NULL;
 
     size = HOST_PAGE_ALIGN(size);
     max_size = HOST_PAGE_ALIGN(max_size);
@@ -2007,10 +2002,9 @@ RAMBlock *qemu_ram_alloc_internal(ram_addr_t size, ram_addr_t max_size,
     if (resizeable) {
         new_block->flags |= RAM_RESIZEABLE;
     }
-    ram_block_add(new_block, &local_err);
-    if (local_err) {
+    ram_block_add(new_block, errp);
+    if (ERR_IS_SET(errp)) {
         g_free(new_block);
-        error_propagate(errp, local_err);
         return NULL;
     }
     return new_block;
diff --git a/hw/arm/allwinner-a10.c b/hw/arm/allwinner-a10.c
index 651409094c..7d9c8691bb 100644
--- a/hw/arm/allwinner-a10.c
+++ b/hw/arm/allwinner-a10.c
@@ -54,19 +54,16 @@ static void aw_a10_realize(DeviceState *dev, Error **errp)
     SysBusDevice *sysbusdev;
     uint8_t i;
     qemu_irq fiq, irq;
-    Error *err = NULL;
 
-    object_property_set_bool(OBJECT(&s->cpu), true, "realized", &err);
-    if (err != NULL) {
-        error_propagate(errp, err);
+    object_property_set_bool(OBJECT(&s->cpu), true, "realized", errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
     irq = qdev_get_gpio_in(DEVICE(&s->cpu), ARM_CPU_IRQ);
     fiq = qdev_get_gpio_in(DEVICE(&s->cpu), ARM_CPU_FIQ);
 
-    object_property_set_bool(OBJECT(&s->intc), true, "realized", &err);
-    if (err != NULL) {
-        error_propagate(errp, err);
+    object_property_set_bool(OBJECT(&s->intc), true, "realized", errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
     sysbusdev = SYS_BUS_DEVICE(&s->intc);
@@ -77,9 +74,8 @@ static void aw_a10_realize(DeviceState *dev, Error **errp)
         s->irq[i] = qdev_get_gpio_in(DEVICE(&s->intc), i);
     }
 
-    object_property_set_bool(OBJECT(&s->timer), true, "realized", &err);
-    if (err != NULL) {
-        error_propagate(errp, err);
+    object_property_set_bool(OBJECT(&s->timer), true, "realized", errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
     sysbusdev = SYS_BUS_DEVICE(&s->timer);
@@ -91,18 +87,16 @@ static void aw_a10_realize(DeviceState *dev, Error **errp)
     sysbus_connect_irq(sysbusdev, 4, s->irq[67]);
     sysbus_connect_irq(sysbusdev, 5, s->irq[68]);
 
-    object_property_set_bool(OBJECT(&s->emac), true, "realized", &err);
-    if (err != NULL) {
-        error_propagate(errp, err);
+    object_property_set_bool(OBJECT(&s->emac), true, "realized", errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
     sysbusdev = SYS_BUS_DEVICE(&s->emac);
     sysbus_mmio_map(sysbusdev, 0, AW_A10_EMAC_BASE);
     sysbus_connect_irq(sysbusdev, 0, s->irq[55]);
 
-    object_property_set_bool(OBJECT(&s->sata), true, "realized", &err);
-    if (err) {
-        error_propagate(errp, err);
+    object_property_set_bool(OBJECT(&s->sata), true, "realized", errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
     sysbus_mmio_map(SYS_BUS_DEVICE(&s->sata), 0, AW_A10_SATA_BASE);
diff --git a/hw/arm/armv7m.c b/hw/arm/armv7m.c
index c8a11f2b53..2fa8bbb249 100644
--- a/hw/arm/armv7m.c
+++ b/hw/arm/armv7m.c
@@ -161,7 +161,6 @@ static void armv7m_realize(DeviceState *dev, Error **errp)
 {
     ARMv7MState *s = ARMV7M(dev);
     SysBusDevice *sbd;
-    Error *err = NULL;
     int i;
     char **cpustr;
     ObjectClass *oc;
@@ -186,10 +185,9 @@ static void armv7m_realize(DeviceState *dev, Error **errp)
 
     cc = CPU_CLASS(oc);
     typename = object_class_get_name(oc);
-    cc->parse_features(typename, cpustr[1], &err);
+    cc->parse_features(typename, cpustr[1], errp);
     g_strfreev(cpustr);
-    if (err) {
-        error_propagate(errp, err);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
@@ -201,16 +199,14 @@ static void armv7m_realize(DeviceState *dev, Error **errp)
 
     object_property_set_link(OBJECT(s->cpu), OBJECT(&s->container), "memory",
                              &error_abort);
-    object_property_set_bool(OBJECT(s->cpu), true, "realized", &err);
-    if (err != NULL) {
-        error_propagate(errp, err);
+    object_property_set_bool(OBJECT(s->cpu), true, "realized", errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
     /* Note that we must realize the NVIC after the CPU */
-    object_property_set_bool(OBJECT(&s->nvic), true, "realized", &err);
-    if (err != NULL) {
-        error_propagate(errp, err);
+    object_property_set_bool(OBJECT(&s->nvic), true, "realized", errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
@@ -234,16 +230,14 @@ static void armv7m_realize(DeviceState *dev, Error **errp)
         Object *obj = OBJECT(&s->bitband[i]);
         SysBusDevice *sbd = SYS_BUS_DEVICE(&s->bitband[i]);
 
-        object_property_set_int(obj, bitband_input_addr[i], "base", &err);
-        if (err != NULL) {
-            error_propagate(errp, err);
+        object_property_set_int(obj, bitband_input_addr[i], "base", errp);
+        if (ERR_IS_SET(errp)) {
             return;
         }
         object_property_set_link(obj, OBJECT(s->board_memory),
                                  "source-memory", &error_abort);
-        object_property_set_bool(obj, true, "realized", &err);
-        if (err != NULL) {
-            error_propagate(errp, err);
+        object_property_set_bool(obj, true, "realized", errp);
+        if (ERR_IS_SET(errp)) {
             return;
         }
 
diff --git a/hw/arm/digic.c b/hw/arm/digic.c
index f22fae73c3..eeaa8729ff 100644
--- a/hw/arm/digic.c
+++ b/hw/arm/digic.c
@@ -59,26 +59,22 @@ static void digic_init(Object *obj)
 static void digic_realize(DeviceState *dev, Error **errp)
 {
     DigicState *s = DIGIC(dev);
-    Error *err = NULL;
     SysBusDevice *sbd;
     int i;
 
-    object_property_set_bool(OBJECT(&s->cpu), true, "reset-hivecs", &err);
-    if (err != NULL) {
-        error_propagate(errp, err);
+    object_property_set_bool(OBJECT(&s->cpu), true, "reset-hivecs", errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
-    object_property_set_bool(OBJECT(&s->cpu), true, "realized", &err);
-    if (err != NULL) {
-        error_propagate(errp, err);
+    object_property_set_bool(OBJECT(&s->cpu), true, "realized", errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
     for (i = 0; i < DIGIC4_NB_TIMERS; i++) {
-        object_property_set_bool(OBJECT(&s->timer[i]), true, "realized", &err);
-        if (err != NULL) {
-            error_propagate(errp, err);
+        object_property_set_bool(OBJECT(&s->timer[i]), true, "realized", errp);
+        if (ERR_IS_SET(errp)) {
             return;
         }
 
@@ -87,9 +83,8 @@ static void digic_realize(DeviceState *dev, Error **errp)
     }
 
     qdev_prop_set_chr(DEVICE(&s->uart), "chardev", serial_hds[0]);
-    object_property_set_bool(OBJECT(&s->uart), true, "realized", &err);
-    if (err != NULL) {
-        error_propagate(errp, err);
+    object_property_set_bool(OBJECT(&s->uart), true, "realized", errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
diff --git a/hw/arm/fsl-imx25.c b/hw/arm/fsl-imx25.c
index 40666b68a3..c10f96d83c 100644
--- a/hw/arm/fsl-imx25.c
+++ b/hw/arm/fsl-imx25.c
@@ -78,17 +78,14 @@ static void fsl_imx25_realize(DeviceState *dev, Error **errp)
 {
     FslIMX25State *s = FSL_IMX25(dev);
     uint8_t i;
-    Error *err = NULL;
 
-    object_property_set_bool(OBJECT(&s->cpu), true, "realized", &err);
-    if (err) {
-        error_propagate(errp, err);
+    object_property_set_bool(OBJECT(&s->cpu), true, "realized", errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
-    object_property_set_bool(OBJECT(&s->avic), true, "realized", &err);
-    if (err) {
-        error_propagate(errp, err);
+    object_property_set_bool(OBJECT(&s->avic), true, "realized", errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
     sysbus_mmio_map(SYS_BUS_DEVICE(&s->avic), 0, FSL_IMX25_AVIC_ADDR);
@@ -97,9 +94,8 @@ static void fsl_imx25_realize(DeviceState *dev, Error **errp)
     sysbus_connect_irq(SYS_BUS_DEVICE(&s->avic), 1,
                        qdev_get_gpio_in(DEVICE(&s->cpu), ARM_CPU_FIQ));
 
-    object_property_set_bool(OBJECT(&s->ccm), true, "realized", &err);
-    if (err) {
-        error_propagate(errp, err);
+    object_property_set_bool(OBJECT(&s->ccm), true, "realized", errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
     sysbus_mmio_map(SYS_BUS_DEVICE(&s->ccm), 0, FSL_IMX25_CCM_ADDR);
@@ -131,9 +127,8 @@ static void fsl_imx25_realize(DeviceState *dev, Error **errp)
             qdev_prop_set_chr(DEVICE(&s->uart[i]), "chardev", chr);
         }
 
-        object_property_set_bool(OBJECT(&s->uart[i]), true, "realized", &err);
-        if (err) {
-            error_propagate(errp, err);
+        object_property_set_bool(OBJECT(&s->uart[i]), true, "realized", errp);
+        if (ERR_IS_SET(errp)) {
             return;
         }
         sysbus_mmio_map(SYS_BUS_DEVICE(&s->uart[i]), 0, serial_table[i].addr);
@@ -156,9 +151,8 @@ static void fsl_imx25_realize(DeviceState *dev, Error **errp)
 
         s->gpt[i].ccm = IMX_CCM(&s->ccm);
 
-        object_property_set_bool(OBJECT(&s->gpt[i]), true, "realized", &err);
-        if (err) {
-            error_propagate(errp, err);
+        object_property_set_bool(OBJECT(&s->gpt[i]), true, "realized", errp);
+        if (ERR_IS_SET(errp)) {
             return;
         }
         sysbus_mmio_map(SYS_BUS_DEVICE(&s->gpt[i]), 0, gpt_table[i].addr);
@@ -179,9 +173,8 @@ static void fsl_imx25_realize(DeviceState *dev, Error **errp)
 
         s->epit[i].ccm = IMX_CCM(&s->ccm);
 
-        object_property_set_bool(OBJECT(&s->epit[i]), true, "realized", &err);
-        if (err) {
-            error_propagate(errp, err);
+        object_property_set_bool(OBJECT(&s->epit[i]), true, "realized", errp);
+        if (ERR_IS_SET(errp)) {
             return;
         }
         sysbus_mmio_map(SYS_BUS_DEVICE(&s->epit[i]), 0, epit_table[i].addr);
@@ -192,9 +185,8 @@ static void fsl_imx25_realize(DeviceState *dev, Error **errp)
 
     qdev_set_nic_properties(DEVICE(&s->fec), &nd_table[0]);
 
-    object_property_set_bool(OBJECT(&s->fec), true, "realized", &err);
-    if (err) {
-        error_propagate(errp, err);
+    object_property_set_bool(OBJECT(&s->fec), true, "realized", errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
     sysbus_mmio_map(SYS_BUS_DEVICE(&s->fec), 0, FSL_IMX25_FEC_ADDR);
@@ -213,9 +205,8 @@ static void fsl_imx25_realize(DeviceState *dev, Error **errp)
             { FSL_IMX25_I2C3_ADDR, FSL_IMX25_I2C3_IRQ }
         };
 
-        object_property_set_bool(OBJECT(&s->i2c[i]), true, "realized", &err);
-        if (err) {
-            error_propagate(errp, err);
+        object_property_set_bool(OBJECT(&s->i2c[i]), true, "realized", errp);
+        if (ERR_IS_SET(errp)) {
             return;
         }
         sysbus_mmio_map(SYS_BUS_DEVICE(&s->i2c[i]), 0, i2c_table[i].addr);
@@ -236,9 +227,8 @@ static void fsl_imx25_realize(DeviceState *dev, Error **errp)
             { FSL_IMX25_GPIO4_ADDR, FSL_IMX25_GPIO4_IRQ }
         };
 
-        object_property_set_bool(OBJECT(&s->gpio[i]), true, "realized", &err);
-        if (err) {
-            error_propagate(errp, err);
+        object_property_set_bool(OBJECT(&s->gpio[i]), true, "realized", errp);
+        if (ERR_IS_SET(errp)) {
             return;
         }
         sysbus_mmio_map(SYS_BUS_DEVICE(&s->gpio[i]), 0, gpio_table[i].addr);
@@ -250,17 +240,15 @@ static void fsl_imx25_realize(DeviceState *dev, Error **errp)
 
     /* initialize 2 x 16 KB ROM */
     memory_region_init_rom(&s->rom[0], NULL,
-                           "imx25.rom0", FSL_IMX25_ROM0_SIZE, &err);
-    if (err) {
-        error_propagate(errp, err);
+                           "imx25.rom0", FSL_IMX25_ROM0_SIZE, errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
     memory_region_add_subregion(get_system_memory(), FSL_IMX25_ROM0_ADDR,
                                 &s->rom[0]);
     memory_region_init_rom(&s->rom[1], NULL,
-                           "imx25.rom1", FSL_IMX25_ROM1_SIZE, &err);
-    if (err) {
-        error_propagate(errp, err);
+                           "imx25.rom1", FSL_IMX25_ROM1_SIZE, errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
     memory_region_add_subregion(get_system_memory(), FSL_IMX25_ROM1_ADDR,
@@ -268,9 +256,8 @@ static void fsl_imx25_realize(DeviceState *dev, Error **errp)
 
     /* initialize internal RAM (128 KB) */
     memory_region_init_ram(&s->iram, NULL, "imx25.iram", FSL_IMX25_IRAM_SIZE,
-                           &err);
-    if (err) {
-        error_propagate(errp, err);
+                           errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
     memory_region_add_subregion(get_system_memory(), FSL_IMX25_IRAM_ADDR,
diff --git a/hw/arm/fsl-imx31.c b/hw/arm/fsl-imx31.c
index c30130667e..0cc80f3aee 100644
--- a/hw/arm/fsl-imx31.c
+++ b/hw/arm/fsl-imx31.c
@@ -70,17 +70,14 @@ static void fsl_imx31_realize(DeviceState *dev, Error **errp)
 {
     FslIMX31State *s = FSL_IMX31(dev);
     uint16_t i;
-    Error *err = NULL;
 
-    object_property_set_bool(OBJECT(&s->cpu), true, "realized", &err);
-    if (err) {
-        error_propagate(errp, err);
+    object_property_set_bool(OBJECT(&s->cpu), true, "realized", errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
-    object_property_set_bool(OBJECT(&s->avic), true, "realized", &err);
-    if (err) {
-        error_propagate(errp, err);
+    object_property_set_bool(OBJECT(&s->avic), true, "realized", errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
     sysbus_mmio_map(SYS_BUS_DEVICE(&s->avic), 0, FSL_IMX31_AVIC_ADDR);
@@ -89,9 +86,8 @@ static void fsl_imx31_realize(DeviceState *dev, Error **errp)
     sysbus_connect_irq(SYS_BUS_DEVICE(&s->avic), 1,
                        qdev_get_gpio_in(DEVICE(&s->cpu), ARM_CPU_FIQ));
 
-    object_property_set_bool(OBJECT(&s->ccm), true, "realized", &err);
-    if (err) {
-        error_propagate(errp, err);
+    object_property_set_bool(OBJECT(&s->ccm), true, "realized", errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
     sysbus_mmio_map(SYS_BUS_DEVICE(&s->ccm), 0, FSL_IMX31_CCM_ADDR);
@@ -120,9 +116,8 @@ static void fsl_imx31_realize(DeviceState *dev, Error **errp)
             qdev_prop_set_chr(DEVICE(&s->uart[i]), "chardev", chr);
         }
 
-        object_property_set_bool(OBJECT(&s->uart[i]), true, "realized", &err);
-        if (err) {
-            error_propagate(errp, err);
+        object_property_set_bool(OBJECT(&s->uart[i]), true, "realized", errp);
+        if (ERR_IS_SET(errp)) {
             return;
         }
 
@@ -134,9 +129,8 @@ static void fsl_imx31_realize(DeviceState *dev, Error **errp)
 
     s->gpt.ccm = IMX_CCM(&s->ccm);
 
-    object_property_set_bool(OBJECT(&s->gpt), true, "realized", &err);
-    if (err) {
-        error_propagate(errp, err);
+    object_property_set_bool(OBJECT(&s->gpt), true, "realized", errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
@@ -156,9 +150,8 @@ static void fsl_imx31_realize(DeviceState *dev, Error **errp)
 
         s->epit[i].ccm = IMX_CCM(&s->ccm);
 
-        object_property_set_bool(OBJECT(&s->epit[i]), true, "realized", &err);
-        if (err) {
-            error_propagate(errp, err);
+        object_property_set_bool(OBJECT(&s->epit[i]), true, "realized", errp);
+        if (ERR_IS_SET(errp)) {
             return;
         }
 
@@ -180,9 +173,8 @@ static void fsl_imx31_realize(DeviceState *dev, Error **errp)
         };
 
         /* Initialize the I2C */
-        object_property_set_bool(OBJECT(&s->i2c[i]), true, "realized", &err);
-        if (err) {
-            error_propagate(errp, err);
+        object_property_set_bool(OBJECT(&s->i2c[i]), true, "realized", errp);
+        if (ERR_IS_SET(errp)) {
             return;
         }
         /* Map I2C memory */
@@ -206,9 +198,8 @@ static void fsl_imx31_realize(DeviceState *dev, Error **errp)
 
         object_property_set_bool(OBJECT(&s->gpio[i]), false, "has-edge-sel",
                                  &error_abort);
-        object_property_set_bool(OBJECT(&s->gpio[i]), true, "realized", &err);
-        if (err) {
-            error_propagate(errp, err);
+        object_property_set_bool(OBJECT(&s->gpio[i]), true, "realized", errp);
+        if (ERR_IS_SET(errp)) {
             return;
         }
         sysbus_mmio_map(SYS_BUS_DEVICE(&s->gpio[i]), 0, gpio_table[i].addr);
@@ -220,9 +211,8 @@ static void fsl_imx31_realize(DeviceState *dev, Error **errp)
 
     /* On a real system, the first 16k is a `secure boot rom' */
     memory_region_init_rom(&s->secure_rom, NULL, "imx31.secure_rom",
-                           FSL_IMX31_SECURE_ROM_SIZE, &err);
-    if (err) {
-        error_propagate(errp, err);
+                           FSL_IMX31_SECURE_ROM_SIZE, errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
     memory_region_add_subregion(get_system_memory(), FSL_IMX31_SECURE_ROM_ADDR,
@@ -230,9 +220,8 @@ static void fsl_imx31_realize(DeviceState *dev, Error **errp)
 
     /* There is also a 16k ROM */
     memory_region_init_rom(&s->rom, NULL, "imx31.rom",
-                           FSL_IMX31_ROM_SIZE, &err);
-    if (err) {
-        error_propagate(errp, err);
+                           FSL_IMX31_ROM_SIZE, errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
     memory_region_add_subregion(get_system_memory(), FSL_IMX31_ROM_ADDR,
@@ -240,9 +229,8 @@ static void fsl_imx31_realize(DeviceState *dev, Error **errp)
 
     /* initialize internal RAM (16 KB) */
     memory_region_init_ram(&s->iram, NULL, "imx31.iram", FSL_IMX31_IRAM_SIZE,
-                           &err);
-    if (err) {
-        error_propagate(errp, err);
+                           errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
     memory_region_add_subregion(get_system_memory(), FSL_IMX31_IRAM_ADDR,
diff --git a/hw/arm/fsl-imx6.c b/hw/arm/fsl-imx6.c
index 73610d48a5..1bdf9dbd70 100644
--- a/hw/arm/fsl-imx6.c
+++ b/hw/arm/fsl-imx6.c
@@ -123,7 +123,6 @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp)
 {
     FslIMX6State *s = FSL_IMX6(dev);
     uint16_t i;
-    Error *err = NULL;
 
     for (i = 0; i < smp_cpus; i++) {
 
@@ -139,9 +138,8 @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp)
                                      "start-powered-off", &error_abort);
         }
 
-        object_property_set_bool(OBJECT(&s->cpu[i]), true, "realized", &err);
-        if (err) {
-            error_propagate(errp, err);
+        object_property_set_bool(OBJECT(&s->cpu[i]), true, "realized", errp);
+        if (ERR_IS_SET(errp)) {
             return;
         }
     }
@@ -153,9 +151,8 @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp)
                             FSL_IMX6_MAX_IRQ + GIC_INTERNAL, "num-irq",
                             &error_abort);
 
-    object_property_set_bool(OBJECT(&s->a9mpcore), true, "realized", &err);
-    if (err) {
-        error_propagate(errp, err);
+    object_property_set_bool(OBJECT(&s->a9mpcore), true, "realized", errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
     sysbus_mmio_map(SYS_BUS_DEVICE(&s->a9mpcore), 0, FSL_IMX6_A9MPCORE_ADDR);
@@ -167,16 +164,14 @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp)
                            qdev_get_gpio_in(DEVICE(&s->cpu[i]), ARM_CPU_FIQ));
     }
 
-    object_property_set_bool(OBJECT(&s->ccm), true, "realized", &err);
-    if (err) {
-        error_propagate(errp, err);
+    object_property_set_bool(OBJECT(&s->ccm), true, "realized", errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
     sysbus_mmio_map(SYS_BUS_DEVICE(&s->ccm), 0, FSL_IMX6_CCM_ADDR);
 
-    object_property_set_bool(OBJECT(&s->src), true, "realized", &err);
-    if (err) {
-        error_propagate(errp, err);
+    object_property_set_bool(OBJECT(&s->src), true, "realized", errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
     sysbus_mmio_map(SYS_BUS_DEVICE(&s->src), 0, FSL_IMX6_SRC_ADDR);
@@ -209,9 +204,8 @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp)
             qdev_prop_set_chr(DEVICE(&s->uart[i]), "chardev", chr);
         }
 
-        object_property_set_bool(OBJECT(&s->uart[i]), true, "realized", &err);
-        if (err) {
-            error_propagate(errp, err);
+        object_property_set_bool(OBJECT(&s->uart[i]), true, "realized", errp);
+        if (ERR_IS_SET(errp)) {
             return;
         }
 
@@ -223,9 +217,8 @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp)
 
     s->gpt.ccm = IMX_CCM(&s->ccm);
 
-    object_property_set_bool(OBJECT(&s->gpt), true, "realized", &err);
-    if (err) {
-        error_propagate(errp, err);
+    object_property_set_bool(OBJECT(&s->gpt), true, "realized", errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
@@ -246,9 +239,8 @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp)
 
         s->epit[i].ccm = IMX_CCM(&s->ccm);
 
-        object_property_set_bool(OBJECT(&s->epit[i]), true, "realized", &err);
-        if (err) {
-            error_propagate(errp, err);
+        object_property_set_bool(OBJECT(&s->epit[i]), true, "realized", errp);
+        if (ERR_IS_SET(errp)) {
             return;
         }
 
@@ -269,9 +261,8 @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp)
             { FSL_IMX6_I2C3_ADDR, FSL_IMX6_I2C3_IRQ }
         };
 
-        object_property_set_bool(OBJECT(&s->i2c[i]), true, "realized", &err);
-        if (err) {
-            error_propagate(errp, err);
+        object_property_set_bool(OBJECT(&s->i2c[i]), true, "realized", errp);
+        if (ERR_IS_SET(errp)) {
             return;
         }
 
@@ -329,9 +320,8 @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp)
                                  &error_abort);
         object_property_set_bool(OBJECT(&s->gpio[i]), true, "has-upper-pin-irq",
                                  &error_abort);
-        object_property_set_bool(OBJECT(&s->gpio[i]), true, "realized", &err);
-        if (err) {
-            error_propagate(errp, err);
+        object_property_set_bool(OBJECT(&s->gpio[i]), true, "realized", errp);
+        if (ERR_IS_SET(errp)) {
             return;
         }
 
@@ -356,9 +346,8 @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp)
             { FSL_IMX6_uSDHC4_ADDR, FSL_IMX6_uSDHC4_IRQ },
         };
 
-        object_property_set_bool(OBJECT(&s->esdhc[i]), true, "realized", &err);
-        if (err) {
-            error_propagate(errp, err);
+        object_property_set_bool(OBJECT(&s->esdhc[i]), true, "realized", errp);
+        if (ERR_IS_SET(errp)) {
             return;
         }
         sysbus_mmio_map(SYS_BUS_DEVICE(&s->esdhc[i]), 0, esdhc_table[i].addr);
@@ -381,9 +370,8 @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp)
         };
 
         /* Initialize the SPI */
-        object_property_set_bool(OBJECT(&s->spi[i]), true, "realized", &err);
-        if (err) {
-            error_propagate(errp, err);
+        object_property_set_bool(OBJECT(&s->spi[i]), true, "realized", errp);
+        if (ERR_IS_SET(errp)) {
             return;
         }
 
@@ -393,9 +381,8 @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp)
                                             spi_table[i].irq));
     }
 
-    object_property_set_bool(OBJECT(&s->eth), true, "realized", &err);
-    if (err) {
-        error_propagate(errp, err);
+    object_property_set_bool(OBJECT(&s->eth), true, "realized", errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
     sysbus_mmio_map(SYS_BUS_DEVICE(&s->eth), 0, FSL_IMX6_ENET_ADDR);
@@ -408,9 +395,8 @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp)
 
     /* ROM memory */
     memory_region_init_rom(&s->rom, NULL, "imx6.rom",
-                           FSL_IMX6_ROM_SIZE, &err);
-    if (err) {
-        error_propagate(errp, err);
+                           FSL_IMX6_ROM_SIZE, errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
     memory_region_add_subregion(get_system_memory(), FSL_IMX6_ROM_ADDR,
@@ -418,9 +404,8 @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp)
 
     /* CAAM memory */
     memory_region_init_rom(&s->caam, NULL, "imx6.caam",
-                           FSL_IMX6_CAAM_MEM_SIZE, &err);
-    if (err) {
-        error_propagate(errp, err);
+                           FSL_IMX6_CAAM_MEM_SIZE, errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
     memory_region_add_subregion(get_system_memory(), FSL_IMX6_CAAM_MEM_ADDR,
@@ -428,9 +413,8 @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp)
 
     /* OCRAM memory */
     memory_region_init_ram(&s->ocram, NULL, "imx6.ocram", FSL_IMX6_OCRAM_SIZE,
-                           &err);
-    if (err) {
-        error_propagate(errp, err);
+                           errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
     memory_region_add_subregion(get_system_memory(), FSL_IMX6_OCRAM_ADDR,
diff --git a/hw/arm/xlnx-zynqmp.c b/hw/arm/xlnx-zynqmp.c
index 38f9577284..ee6c64b409 100644
--- a/hw/arm/xlnx-zynqmp.c
+++ b/hw/arm/xlnx-zynqmp.c
@@ -96,7 +96,6 @@ static inline int arm_gic_ppi_index(int cpu_nr, int ppi_index)
 static void xlnx_zynqmp_create_rpu(XlnxZynqMPState *s, const char *boot_cpu,
                                    Error **errp)
 {
-    Error *err = NULL;
     int i;
 
     for (i = 0; i < XLNX_ZYNQMP_NUM_RPU_CPUS; i++) {
@@ -120,9 +119,8 @@ static void xlnx_zynqmp_create_rpu(XlnxZynqMPState *s, const char *boot_cpu,
         object_property_set_bool(OBJECT(&s->rpu_cpu[i]), true, "reset-hivecs",
                                  &error_abort);
         object_property_set_bool(OBJECT(&s->rpu_cpu[i]), true, "realized",
-                                 &err);
-        if (err) {
-            error_propagate(errp, err);
+                                 errp);
+        if (ERR_IS_SET(errp)) {
             return;
         }
     }
diff --git a/hw/block/fdc.c b/hw/block/fdc.c
index 5fed23c774..597ea719a7 100644
--- a/hw/block/fdc.c
+++ b/hw/block/fdc.c
@@ -473,16 +473,14 @@ static void fd_revalidate(FDrive *drv)
 static void fd_change_cb(void *opaque, bool load, Error **errp)
 {
     FDrive *drive = opaque;
-    Error *local_err = NULL;
 
     if (!load) {
         blk_set_perm(drive->blk, 0, BLK_PERM_ALL, &error_abort);
     } else {
         blkconf_apply_backend_options(drive->conf,
                                       blk_is_read_only(drive->blk), false,
-                                      &local_err);
-        if (local_err) {
-            error_propagate(errp, local_err);
+                                      errp);
+        if (ERR_IS_SET(errp)) {
             return;
         }
     }
@@ -2528,7 +2526,6 @@ static void fdctrl_connect_drives(FDCtrl *fdctrl, DeviceState *fdc_dev,
     FDrive *drive;
     DeviceState *dev;
     BlockBackend *blk;
-    Error *local_err = NULL;
 
     for (i = 0; i < MAX_FD; i++) {
         drive = &fdctrl->drives[i];
@@ -2550,17 +2547,15 @@ static void fdctrl_connect_drives(FDCtrl *fdctrl, DeviceState *fdc_dev,
         blk_ref(blk);
         blk_detach_dev(blk, fdc_dev);
         fdctrl->qdev_for_drives[i].blk = NULL;
-        qdev_prop_set_drive(dev, "drive", blk, &local_err);
+        qdev_prop_set_drive(dev, "drive", blk, errp);
         blk_unref(blk);
 
-        if (local_err) {
-            error_propagate(errp, local_err);
+        if (ERR_IS_SET(errp)) {
             return;
         }
 
-        object_property_set_bool(OBJECT(dev), true, "realized", &local_err);
-        if (local_err) {
-            error_propagate(errp, local_err);
+        object_property_set_bool(OBJECT(dev), true, "realized", errp);
+        if (ERR_IS_SET(errp)) {
             return;
         }
     }
@@ -2689,7 +2684,6 @@ static void isabus_fdc_realize(DeviceState *dev, Error **errp)
     ISADevice *isadev = ISA_DEVICE(dev);
     FDCtrlISABus *isa = ISA_FDC(dev);
     FDCtrl *fdctrl = &isa->state;
-    Error *err = NULL;
 
     isa_register_portio_list(isadev, &fdctrl->portio_list,
                              isa->iobase, fdc_portio_list, fdctrl,
@@ -2703,9 +2697,8 @@ static void isabus_fdc_realize(DeviceState *dev, Error **errp)
     }
 
     qdev_set_legacy_instance_id(dev, isa->iobase, 2);
-    fdctrl_realize_common(dev, fdctrl, &err);
-    if (err != NULL) {
-        error_propagate(errp, err);
+    fdctrl_realize_common(dev, fdctrl, errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 }
diff --git a/hw/block/pflash_cfi01.c b/hw/block/pflash_cfi01.c
index 594d4cf6fe..e634b128ce 100644
--- a/hw/block/pflash_cfi01.c
+++ b/hw/block/pflash_cfi01.c
@@ -706,7 +706,6 @@ static void pflash_cfi01_realize(DeviceState *dev, Error **errp)
     int ret;
     uint64_t blocks_per_device, sector_len_per_device, device_len;
     int num_devices;
-    Error *local_err = NULL;
 
     if (pfl->sector_len == 0) {
         error_setg(errp, "attribute \"sector-length\" not specified or zero.");
@@ -747,9 +746,8 @@ static void pflash_cfi01_realize(DeviceState *dev, Error **errp)
         &pfl->mem, OBJECT(dev),
         &pflash_cfi01_ops,
         pfl,
-        pfl->name, total_len, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+        pfl->name, total_len, errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
diff --git a/hw/block/pflash_cfi02.c b/hw/block/pflash_cfi02.c
index e6c5c6c25d..2ef8c76b94 100644
--- a/hw/block/pflash_cfi02.c
+++ b/hw/block/pflash_cfi02.c
@@ -598,7 +598,6 @@ static void pflash_cfi02_realize(DeviceState *dev, Error **errp)
     pflash_t *pfl = CFI_PFLASH02(dev);
     uint32_t chip_len;
     int ret;
-    Error *local_err = NULL;
 
     if (pfl->sector_len == 0) {
         error_setg(errp, "attribute \"sector-length\" not specified or zero.");
@@ -623,9 +622,8 @@ static void pflash_cfi02_realize(DeviceState *dev, Error **errp)
 
     memory_region_init_rom_device(&pfl->orig_mem, OBJECT(pfl), pfl->be ?
                                   &pflash_cfi02_ops_be : &pflash_cfi02_ops_le,
-                                  pfl, pfl->name, chip_len, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+                                  pfl, pfl->name, chip_len, errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
index ce9cf63c3e..11455faebc 100644
--- a/hw/block/virtio-blk.c
+++ b/hw/block/virtio-blk.c
@@ -909,7 +909,6 @@ static void virtio_blk_device_realize(DeviceState *dev, Error **errp)
     VirtIODevice *vdev = VIRTIO_DEVICE(dev);
     VirtIOBlock *s = VIRTIO_BLK(dev);
     VirtIOBlkConf *conf = &s->conf;
-    Error *err = NULL;
     unsigned i;
 
     if (!conf->conf.blk) {
@@ -928,15 +927,13 @@ static void virtio_blk_device_realize(DeviceState *dev, Error **errp)
     blkconf_serial(&conf->conf, &conf->serial);
     blkconf_apply_backend_options(&conf->conf,
                                   blk_is_read_only(conf->conf.blk), true,
-                                  &err);
-    if (err) {
-        error_propagate(errp, err);
+                                  errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
     s->original_wce = blk_enable_write_cache(conf->conf.blk);
-    blkconf_geometry(&conf->conf, NULL, 65535, 255, 255, &err);
-    if (err) {
-        error_propagate(errp, err);
+    blkconf_geometry(&conf->conf, NULL, 65535, 255, 255, errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
     blkconf_blocksizes(&conf->conf);
@@ -951,9 +948,8 @@ static void virtio_blk_device_realize(DeviceState *dev, Error **errp)
     for (i = 0; i < conf->num_queues; i++) {
         virtio_add_queue(vdev, 128, virtio_blk_handle_output);
     }
-    virtio_blk_data_plane_create(vdev, conf, &s->dataplane, &err);
-    if (err != NULL) {
-        error_propagate(errp, err);
+    virtio_blk_data_plane_create(vdev, conf, &s->dataplane, errp);
+    if (ERR_IS_SET(errp)) {
         virtio_cleanup(vdev);
         return;
     }
diff --git a/hw/char/debugcon.c b/hw/char/debugcon.c
index 762e3d8ada..90e437edfb 100644
--- a/hw/char/debugcon.c
+++ b/hw/char/debugcon.c
@@ -100,11 +100,9 @@ static void debugcon_isa_realizefn(DeviceState *dev, Error **errp)
     ISADevice *d = ISA_DEVICE(dev);
     ISADebugconState *isa = ISA_DEBUGCON_DEVICE(dev);
     DebugconState *s = &isa->state;
-    Error *err = NULL;
 
-    debugcon_realize_core(s, &err);
-    if (err != NULL) {
-        error_propagate(errp, err);
+    debugcon_realize_core(s, errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
     memory_region_init_io(&s->io, OBJECT(dev), &debugcon_ops, s,
diff --git a/hw/char/serial-pci.c b/hw/char/serial-pci.c
index 303104dd19..60074eb114 100644
--- a/hw/char/serial-pci.c
+++ b/hw/char/serial-pci.c
@@ -55,12 +55,10 @@ static void serial_pci_realize(PCIDevice *dev, Error **errp)
 {
     PCISerialState *pci = DO_UPCAST(PCISerialState, dev, dev);
     SerialState *s = &pci->state;
-    Error *err = NULL;
 
     s->baudbase = 115200;
-    serial_realize_core(s, &err);
-    if (err != NULL) {
-        error_propagate(errp, err);
+    serial_realize_core(s, errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
@@ -91,7 +89,6 @@ static void multi_serial_pci_realize(PCIDevice *dev, Error **errp)
     PCIDeviceClass *pc = PCI_DEVICE_GET_CLASS(dev);
     PCIMultiSerialState *pci = DO_UPCAST(PCIMultiSerialState, dev, dev);
     SerialState *s;
-    Error *err = NULL;
     int i, nr_ports = 0;
 
     switch (pc->device_id) {
@@ -115,9 +112,8 @@ static void multi_serial_pci_realize(PCIDevice *dev, Error **errp)
     for (i = 0; i < nr_ports; i++) {
         s = pci->state + i;
         s->baudbase = 115200;
-        serial_realize_core(s, &err);
-        if (err != NULL) {
-            error_propagate(errp, err);
+        serial_realize_core(s, errp);
+        if (ERR_IS_SET(errp)) {
             multi_serial_pci_exit(dev);
             return;
         }
diff --git a/hw/char/virtio-serial-bus.c b/hw/char/virtio-serial-bus.c
index f5bc173844..8f0d130d49 100644
--- a/hw/char/virtio-serial-bus.c
+++ b/hw/char/virtio-serial-bus.c
@@ -926,7 +926,6 @@ static void virtser_port_device_realize(DeviceState *dev, Error **errp)
     VirtIOSerialBus *bus = VIRTIO_SERIAL_BUS(qdev_get_parent_bus(dev));
     int max_nr_ports;
     bool plugging_port0;
-    Error *err = NULL;
 
     port->vser = bus->vser;
     port->bh = qemu_bh_new(flush_queued_data_bh, port);
@@ -972,9 +971,8 @@ static void virtser_port_device_realize(DeviceState *dev, Error **errp)
         return;
     }
 
-    vsc->realize(dev, &err);
-    if (err != NULL) {
-        error_propagate(errp, err);
+    vsc->realize(dev, errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
diff --git a/hw/core/machine.c b/hw/core/machine.c
index 2e7e9778cd..61e921c9ef 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -91,12 +91,10 @@ static void machine_set_kvm_shadow_mem(Object *obj, Visitor *v,
                                        Error **errp)
 {
     MachineState *ms = MACHINE(obj);
-    Error *error = NULL;
     int64_t value;
 
-    visit_type_int(v, name, &value, &error);
-    if (error) {
-        error_propagate(errp, error);
+    visit_type_int(v, name, &value, errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
@@ -193,12 +191,10 @@ static void machine_set_phandle_start(Object *obj, Visitor *v,
                                       Error **errp)
 {
     MachineState *ms = MACHINE(obj);
-    Error *error = NULL;
     int64_t value;
 
-    visit_type_int(v, name, &value, &error);
-    if (error) {
-        error_propagate(errp, error);
+    visit_type_int(v, name, &value, errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-system.c
index 73640ee3c6..68c97c08dc 100644
--- a/hw/core/qdev-properties-system.c
+++ b/hw/core/qdev-properties-system.c
@@ -43,7 +43,6 @@ static void set_pointer(Object *obj, Visitor *v, Property *prop,
                         const char *name, Error **errp)
 {
     DeviceState *dev = DEVICE(obj);
-    Error *local_err = NULL;
     void **ptr = qdev_get_prop_ptr(dev, prop);
     char *str;
 
@@ -52,9 +51,8 @@ static void set_pointer(Object *obj, Visitor *v, Property *prop,
         return;
     }
 
-    visit_type_str(v, name, &str, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    visit_type_str(v, name, &str, errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
     if (!*str) {
@@ -185,7 +183,6 @@ static void set_chr(Object *obj, Visitor *v, const char *name, void *opaque,
                     Error **errp)
 {
     DeviceState *dev = DEVICE(obj);
-    Error *local_err = NULL;
     Property *prop = opaque;
     CharBackend *be = qdev_get_prop_ptr(dev, prop);
     Chardev *s;
@@ -196,9 +193,8 @@ static void set_chr(Object *obj, Visitor *v, const char *name, void *opaque,
         return;
     }
 
-    visit_type_str(v, name, &str, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    visit_type_str(v, name, &str, errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
@@ -257,7 +253,6 @@ static void set_netdev(Object *obj, Visitor *v, const char *name,
     NICPeers *peers_ptr = qdev_get_prop_ptr(dev, prop);
     NetClientState **ncs = peers_ptr->ncs;
     NetClientState *peers[MAX_QUEUE_NUM];
-    Error *local_err = NULL;
     int queues, err = 0, i = 0;
     char *str;
 
@@ -266,9 +261,8 @@ static void set_netdev(Object *obj, Visitor *v, const char *name,
         return;
     }
 
-    visit_type_str(v, name, &str, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    visit_type_str(v, name, &str, errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
@@ -361,7 +355,6 @@ static void set_vlan(Object *obj, Visitor *v, const char *name, void *opaque,
     Property *prop = opaque;
     NICPeers *peers_ptr = qdev_get_prop_ptr(dev, prop);
     NetClientState **ptr = &peers_ptr->ncs[0];
-    Error *local_err = NULL;
     int32_t id;
     NetClientState *hubport;
 
@@ -370,9 +363,8 @@ static void set_vlan(Object *obj, Visitor *v, const char *name, void *opaque,
         return;
     }
 
-    visit_type_int32(v, name, &id, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    visit_type_int32(v, name, &id, errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
     if (id == -1) {
diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c
index 65ba36f4fb..f289841484 100644
--- a/hw/core/qdev-properties.c
+++ b/hw/core/qdev-properties.c
@@ -104,7 +104,6 @@ static void prop_set_bit(Object *obj, Visitor *v, const char *name,
 {
     DeviceState *dev = DEVICE(obj);
     Property *prop = opaque;
-    Error *local_err = NULL;
     bool value;
 
     if (dev->realized) {
@@ -112,9 +111,8 @@ static void prop_set_bit(Object *obj, Visitor *v, const char *name,
         return;
     }
 
-    visit_type_bool(v, name, &value, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    visit_type_bool(v, name, &value, errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
     bit_prop_set(dev, prop, value);
@@ -162,7 +160,6 @@ static void prop_set_bit64(Object *obj, Visitor *v, const char *name,
 {
     DeviceState *dev = DEVICE(obj);
     Property *prop = opaque;
-    Error *local_err = NULL;
     bool value;
 
     if (dev->realized) {
@@ -170,9 +167,8 @@ static void prop_set_bit64(Object *obj, Visitor *v, const char *name,
         return;
     }
 
-    visit_type_bool(v, name, &value, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    visit_type_bool(v, name, &value, errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
     bit64_prop_set(dev, prop, value);
@@ -410,7 +406,6 @@ static void set_string(Object *obj, Visitor *v, const char *name,
     DeviceState *dev = DEVICE(obj);
     Property *prop = opaque;
     char **ptr = qdev_get_prop_ptr(dev, prop);
-    Error *local_err = NULL;
     char *str;
 
     if (dev->realized) {
@@ -418,9 +413,8 @@ static void set_string(Object *obj, Visitor *v, const char *name,
         return;
     }
 
-    visit_type_str(v, name, &str, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    visit_type_str(v, name, &str, errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
     g_free(*ptr);
@@ -470,7 +464,6 @@ static void set_mac(Object *obj, Visitor *v, const char *name, void *opaque,
     DeviceState *dev = DEVICE(obj);
     Property *prop = opaque;
     MACAddr *mac = qdev_get_prop_ptr(dev, prop);
-    Error *local_err = NULL;
     int i, pos;
     char *str, *p;
 
@@ -479,9 +472,8 @@ static void set_mac(Object *obj, Visitor *v, const char *name, void *opaque,
         return;
     }
 
-    visit_type_str(v, name, &str, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    visit_type_str(v, name, &str, errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
@@ -658,7 +650,6 @@ static void set_blocksize(Object *obj, Visitor *v, const char *name,
     DeviceState *dev = DEVICE(obj);
     Property *prop = opaque;
     uint16_t value, *ptr = qdev_get_prop_ptr(dev, prop);
-    Error *local_err = NULL;
     const int64_t min = 512;
     const int64_t max = 32768;
 
@@ -667,9 +658,8 @@ static void set_blocksize(Object *obj, Visitor *v, const char *name,
         return;
     }
 
-    visit_type_uint16(v, name, &value, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    visit_type_uint16(v, name, &value, errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
     /* value of 0 means "unset" */
@@ -732,7 +722,6 @@ static void set_pci_host_devaddr(Object *obj, Visitor *v, const char *name,
     DeviceState *dev = DEVICE(obj);
     Property *prop = opaque;
     PCIHostDeviceAddress *addr = qdev_get_prop_ptr(dev, prop);
-    Error *local_err = NULL;
     char *str, *p;
     char *e;
     unsigned long val;
@@ -744,9 +733,8 @@ static void set_pci_host_devaddr(Object *obj, Visitor *v, const char *name,
         return;
     }
 
-    visit_type_str(v, name, &str, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    visit_type_str(v, name, &str, errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
@@ -852,7 +840,6 @@ static void set_prop_arraylen(Object *obj, Visitor *v, const char *name,
     Property *prop = opaque;
     uint32_t *alenptr = qdev_get_prop_ptr(dev, prop);
     void **arrayptr = (void *)dev + prop->arrayoffset;
-    Error *local_err = NULL;
     void *eltptr;
     const char *arrayname;
     int i;
@@ -866,9 +853,8 @@ static void set_prop_arraylen(Object *obj, Visitor *v, const char *name,
                    name);
         return;
     }
-    visit_type_uint32(v, name, alenptr, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    visit_type_uint32(v, name, alenptr, errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
     if (!*alenptr) {
@@ -905,9 +891,8 @@ static void set_prop_arraylen(Object *obj, Visitor *v, const char *name,
                             arrayprop->prop.info->get,
                             arrayprop->prop.info->set,
                             array_element_release,
-                            arrayprop, &local_err);
-        if (local_err) {
-            error_propagate(errp, local_err);
+                            arrayprop, errp);
+        if (ERR_IS_SET(errp)) {
             return;
         }
     }
diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index 163e827e01..cd95d8ce63 100644
--- a/hw/core/qdev.c
+++ b/hw/core/qdev.c
@@ -768,7 +768,6 @@ static void qdev_property_add_legacy(DeviceState *dev, Property *prop,
 void qdev_property_add_static(DeviceState *dev, Property *prop,
                               Error **errp)
 {
-    Error *local_err = NULL;
     Object *obj = OBJECT(dev);
 
     /*
@@ -783,10 +782,9 @@ void qdev_property_add_static(DeviceState *dev, Property *prop,
     object_property_add(obj, prop->name, prop->info->name,
                         prop->info->get, prop->info->set,
                         prop->info->release,
-                        prop, &local_err);
+                        prop, errp);
 
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
diff --git a/hw/cpu/a15mpcore.c b/hw/cpu/a15mpcore.c
index 6d376b978d..e9f5caee7d 100644
--- a/hw/cpu/a15mpcore.c
+++ b/hw/cpu/a15mpcore.c
@@ -53,7 +53,6 @@ static void a15mp_priv_realize(DeviceState *dev, Error **errp)
     DeviceState *gicdev;
     SysBusDevice *busdev;
     int i;
-    Error *err = NULL;
     bool has_el3;
     Object *cpuobj;
 
@@ -71,9 +70,8 @@ static void a15mp_priv_realize(DeviceState *dev, Error **errp)
         qdev_prop_set_bit(gicdev, "has-security-extensions", has_el3);
     }
 
-    object_property_set_bool(OBJECT(&s->gic), true, "realized", &err);
-    if (err != NULL) {
-        error_propagate(errp, err);
+    object_property_set_bool(OBJECT(&s->gic), true, "realized", errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
     busdev = SYS_BUS_DEVICE(&s->gic);
diff --git a/hw/cpu/a9mpcore.c b/hw/cpu/a9mpcore.c
index 23f2c252bd..b32fbb7a44 100644
--- a/hw/cpu/a9mpcore.c
+++ b/hw/cpu/a9mpcore.c
@@ -50,16 +50,14 @@ static void a9mp_priv_realize(DeviceState *dev, Error **errp)
     DeviceState *scudev, *gicdev, *gtimerdev, *mptimerdev, *wdtdev;
     SysBusDevice *scubusdev, *gicbusdev, *gtimerbusdev, *mptimerbusdev,
                  *wdtbusdev;
-    Error *err = NULL;
     int i;
     bool has_el3;
     Object *cpuobj;
 
     scudev = DEVICE(&s->scu);
     qdev_prop_set_uint32(scudev, "num-cpu", s->num_cpu);
-    object_property_set_bool(OBJECT(&s->scu), true, "realized", &err);
-    if (err != NULL) {
-        error_propagate(errp, err);
+    object_property_set_bool(OBJECT(&s->scu), true, "realized", errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
     scubusdev = SYS_BUS_DEVICE(&s->scu);
@@ -76,9 +74,8 @@ static void a9mp_priv_realize(DeviceState *dev, Error **errp)
         object_property_get_bool(cpuobj, "has_el3", &error_abort);
     qdev_prop_set_bit(gicdev, "has-security-extensions", has_el3);
 
-    object_property_set_bool(OBJECT(&s->gic), true, "realized", &err);
-    if (err != NULL) {
-        error_propagate(errp, err);
+    object_property_set_bool(OBJECT(&s->gic), true, "realized", errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
     gicbusdev = SYS_BUS_DEVICE(&s->gic);
@@ -91,27 +88,24 @@ static void a9mp_priv_realize(DeviceState *dev, Error **errp)
 
     gtimerdev = DEVICE(&s->gtimer);
     qdev_prop_set_uint32(gtimerdev, "num-cpu", s->num_cpu);
-    object_property_set_bool(OBJECT(&s->gtimer), true, "realized", &err);
-    if (err != NULL) {
-        error_propagate(errp, err);
+    object_property_set_bool(OBJECT(&s->gtimer), true, "realized", errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
     gtimerbusdev = SYS_BUS_DEVICE(&s->gtimer);
 
     mptimerdev = DEVICE(&s->mptimer);
     qdev_prop_set_uint32(mptimerdev, "num-cpu", s->num_cpu);
-    object_property_set_bool(OBJECT(&s->mptimer), true, "realized", &err);
-    if (err != NULL) {
-        error_propagate(errp, err);
+    object_property_set_bool(OBJECT(&s->mptimer), true, "realized", errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
     mptimerbusdev = SYS_BUS_DEVICE(&s->mptimer);
 
     wdtdev = DEVICE(&s->wdt);
     qdev_prop_set_uint32(wdtdev, "num-cpu", s->num_cpu);
-    object_property_set_bool(OBJECT(&s->wdt), true, "realized", &err);
-    if (err != NULL) {
-        error_propagate(errp, err);
+    object_property_set_bool(OBJECT(&s->wdt), true, "realized", errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
     wdtbusdev = SYS_BUS_DEVICE(&s->wdt);
diff --git a/hw/cpu/arm11mpcore.c b/hw/cpu/arm11mpcore.c
index eb244658b9..60336b1c0a 100644
--- a/hw/cpu/arm11mpcore.c
+++ b/hw/cpu/arm11mpcore.c
@@ -72,20 +72,17 @@ static void mpcore_priv_realize(DeviceState *dev, Error **errp)
     DeviceState *gicdev = DEVICE(&s->gic);
     DeviceState *mptimerdev = DEVICE(&s->mptimer);
     DeviceState *wdtimerdev = DEVICE(&s->wdtimer);
-    Error *err = NULL;
 
     qdev_prop_set_uint32(scudev, "num-cpu", s->num_cpu);
-    object_property_set_bool(OBJECT(&s->scu), true, "realized", &err);
-    if (err != NULL) {
-        error_propagate(errp, err);
+    object_property_set_bool(OBJECT(&s->scu), true, "realized", errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
     qdev_prop_set_uint32(gicdev, "num-cpu", s->num_cpu);
     qdev_prop_set_uint32(gicdev, "num-irq", s->num_irq);
-    object_property_set_bool(OBJECT(&s->gic), true, "realized", &err);
-    if (err != NULL) {
-        error_propagate(errp, err);
+    object_property_set_bool(OBJECT(&s->gic), true, "realized", errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
@@ -96,16 +93,14 @@ static void mpcore_priv_realize(DeviceState *dev, Error **errp)
     qdev_init_gpio_in(dev, mpcore_priv_set_irq, s->num_irq - 32);
 
     qdev_prop_set_uint32(mptimerdev, "num-cpu", s->num_cpu);
-    object_property_set_bool(OBJECT(&s->mptimer), true, "realized", &err);
-    if (err != NULL) {
-        error_propagate(errp, err);
+    object_property_set_bool(OBJECT(&s->mptimer), true, "realized", errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
     qdev_prop_set_uint32(wdtimerdev, "num-cpu", s->num_cpu);
-    object_property_set_bool(OBJECT(&s->wdtimer), true, "realized", &err);
-    if (err != NULL) {
-        error_propagate(errp, err);
+    object_property_set_bool(OBJECT(&s->wdtimer), true, "realized", errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
diff --git a/hw/cpu/core.c b/hw/cpu/core.c
index b38d882432..a10e655d32 100644
--- a/hw/cpu/core.c
+++ b/hw/cpu/core.c
@@ -24,12 +24,10 @@ static void core_prop_set_core_id(Object *obj, Visitor *v, const char *name,
                                   void *opaque, Error **errp)
 {
     CPUCore *core = CPU_CORE(obj);
-    Error *local_err = NULL;
     int64_t value;
 
-    visit_type_int(v, name, &value, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    visit_type_int(v, name, &value, errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
@@ -49,12 +47,10 @@ static void core_prop_set_nr_threads(Object *obj, Visitor *v, const char *name,
                                      void *opaque, Error **errp)
 {
     CPUCore *core = CPU_CORE(obj);
-    Error *local_err = NULL;
     int64_t value;
 
-    visit_type_int(v, name, &value, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    visit_type_int(v, name, &value, errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
diff --git a/hw/cpu/realview_mpcore.c b/hw/cpu/realview_mpcore.c
index 39d4ebeb1d..be5fad6d74 100644
--- a/hw/cpu/realview_mpcore.c
+++ b/hw/cpu/realview_mpcore.c
@@ -62,14 +62,12 @@ static void realview_mpcore_realize(DeviceState *dev, Error **errp)
     DeviceState *priv = DEVICE(&s->priv);
     DeviceState *gic;
     SysBusDevice *gicbusdev;
-    Error *err = NULL;
     int n;
     int i;
 
     qdev_prop_set_uint32(priv, "num-cpu", s->num_cpu);
-    object_property_set_bool(OBJECT(&s->priv), true, "realized", &err);
-    if (err != NULL) {
-        error_propagate(errp, err);
+    object_property_set_bool(OBJECT(&s->priv), true, "realized", errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
     sysbus_pass_irq(sbd, SYS_BUS_DEVICE(&s->priv));
@@ -78,9 +76,8 @@ static void realview_mpcore_realize(DeviceState *dev, Error **errp)
     }
     /* ??? IRQ routing is hardcoded to "normal" mode.  */
     for (n = 0; n < 4; n++) {
-        object_property_set_bool(OBJECT(&s->gic[n]), true, "realized", &err);
-        if (err != NULL) {
-            error_propagate(errp, err);
+        object_property_set_bool(OBJECT(&s->gic[n]), true, "realized", errp);
+        if (ERR_IS_SET(errp)) {
             return;
         }
         gic = DEVICE(&s->gic[n]);
diff --git a/hw/display/qxl.c b/hw/display/qxl.c
index ad09bb98f9..0013b29ca5 100644
--- a/hw/display/qxl.c
+++ b/hw/display/qxl.c
@@ -2163,7 +2163,6 @@ static void qxl_realize_primary(PCIDevice *dev, Error **errp)
 {
     PCIQXLDevice *qxl = PCI_QXL(dev);
     VGACommonState *vga = &qxl->vga;
-    Error *local_err = NULL;
 
     qxl->id = 0;
     qxl_init_ramsize(qxl);
@@ -2180,9 +2179,8 @@ static void qxl_realize_primary(PCIDevice *dev, Error **errp)
     vga->con = graphic_console_init(DEVICE(dev), 0, &qxl_ops, qxl);
     qemu_spice_display_init_common(&qxl->ssd);
 
-    qxl_realize_common(qxl, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    qxl_realize_common(qxl, errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c
index 58dc0b2737..9c8ecd2d87 100644
--- a/hw/display/virtio-gpu.c
+++ b/hw/display/virtio-gpu.c
@@ -1104,7 +1104,6 @@ static void virtio_gpu_device_realize(DeviceState *qdev, Error **errp)
     VirtIODevice *vdev = VIRTIO_DEVICE(qdev);
     VirtIOGPU *g = VIRTIO_GPU(qdev);
     bool have_virgl;
-    Error *local_err = NULL;
     int i;
 
     if (g->conf.max_outputs > VIRTIO_GPU_MAX_SCANOUTS) {
@@ -1124,9 +1123,8 @@ static void virtio_gpu_device_realize(DeviceState *qdev, Error **errp)
 
     if (virtio_gpu_virgl_enabled(g->conf)) {
         error_setg(&g->migration_blocker, "virgl is not yet migratable");
-        migrate_add_blocker(g->migration_blocker, &local_err);
-        if (local_err) {
-            error_propagate(errp, local_err);
+        migrate_add_blocker(g->migration_blocker, errp);
+        if (ERR_IS_SET(errp)) {
             error_free(g->migration_blocker);
             return;
         }
diff --git a/hw/display/virtio-vga.c b/hw/display/virtio-vga.c
index f9b017d86b..f18484e333 100644
--- a/hw/display/virtio-vga.c
+++ b/hw/display/virtio-vga.c
@@ -101,7 +101,6 @@ static void virtio_vga_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
     VirtIOVGA *vvga = VIRTIO_VGA(vpci_dev);
     VirtIOGPU *g = &vvga->vdev;
     VGACommonState *vga = &vvga->vga;
-    Error *err = NULL;
     uint32_t offset;
     int i;
 
@@ -146,9 +145,8 @@ static void virtio_vga_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
     /* init virtio bits */
     qdev_set_parent_bus(DEVICE(g), BUS(&vpci_dev->bus));
     virtio_pci_force_virtio_1(vpci_dev);
-    object_property_set_bool(OBJECT(g), true, "realized", &err);
-    if (err) {
-        error_propagate(errp, err);
+    object_property_set_bool(OBJECT(g), true, "realized", errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
diff --git a/hw/i386/kvm/pci-assign.c b/hw/i386/kvm/pci-assign.c
index bc8795f7f3..194ebb70f3 100644
--- a/hw/i386/kvm/pci-assign.c
+++ b/hw/i386/kvm/pci-assign.c
@@ -838,7 +838,6 @@ static int assign_intx(AssignedDevice *dev, Error **errp)
     PCIINTxRoute intx_route;
     bool intx_host_msi;
     int r;
-    Error *local_err = NULL;
 
     /* Interrupt PIN 0 means don't use INTx */
     if (assigned_dev_pci_read_byte(&dev->dev, PCI_INTERRUPT_PIN) == 0) {
@@ -846,9 +845,8 @@ static int assign_intx(AssignedDevice *dev, Error **errp)
         return 0;
     }
 
-    verify_irqchip_in_kernel(&local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    verify_irqchip_in_kernel(errp);
+    if (ERR_IS_SET(errp)) {
         return -ENOTSUP;
     }
 
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index efa6c35157..7ce0ed96de 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1111,7 +1111,6 @@ void pc_hot_add_cpu(const int64_t id, Error **errp)
     ObjectClass *oc;
     MachineState *ms = MACHINE(qdev_get_machine());
     int64_t apic_id = x86_cpu_apic_id_from_index(id);
-    Error *local_err = NULL;
 
     if (id < 0) {
         error_setg(errp, "Invalid CPU id: %" PRIi64, id);
@@ -1127,9 +1126,8 @@ void pc_hot_add_cpu(const int64_t id, Error **errp)
 
     assert(ms->possible_cpus->cpus[0].cpu); /* BSP is always present */
     oc = OBJECT_CLASS(CPU_GET_CLASS(ms->possible_cpus->cpus[0].cpu));
-    pc_new_cpu(object_class_get_name(oc), apic_id, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    pc_new_cpu(object_class_get_name(oc), apic_id, errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 }
diff --git a/hw/input/virtio-input.c b/hw/input/virtio-input.c
index 0e42f0d02c..beb38528bd 100644
--- a/hw/input/virtio-input.c
+++ b/hw/input/virtio-input.c
@@ -235,12 +235,10 @@ static void virtio_input_device_realize(DeviceState *dev, Error **errp)
     VirtIODevice *vdev = VIRTIO_DEVICE(dev);
     VirtIOInput *vinput = VIRTIO_INPUT(dev);
     VirtIOInputConfig *cfg;
-    Error *local_err = NULL;
 
     if (vic->realize) {
-        vic->realize(dev, &local_err);
-        if (local_err) {
-            error_propagate(errp, local_err);
+        vic->realize(dev, errp);
+        if (ERR_IS_SET(errp)) {
             return;
         }
     }
@@ -278,12 +276,10 @@ static void virtio_input_device_unrealize(DeviceState *dev, Error **errp)
 {
     VirtIOInputClass *vic = VIRTIO_INPUT_GET_CLASS(dev);
     VirtIODevice *vdev = VIRTIO_DEVICE(dev);
-    Error *local_err = NULL;
 
     if (vic->unrealize) {
-        vic->unrealize(dev, &local_err);
-        if (local_err) {
-            error_propagate(errp, local_err);
+        vic->unrealize(dev, errp);
+        if (ERR_IS_SET(errp)) {
             return;
         }
     }
diff --git a/hw/intc/apic_common.c b/hw/intc/apic_common.c
index 09b75a3048..536cbad4d0 100644
--- a/hw/intc/apic_common.c
+++ b/hw/intc/apic_common.c
@@ -461,7 +461,6 @@ static void apic_common_set_id(Object *obj, Visitor *v, const char *name,
 {
     APICCommonState *s = APIC_COMMON(obj);
     DeviceState *dev = DEVICE(obj);
-    Error *local_err = NULL;
     int64_t value;
 
     if (dev->realized) {
@@ -469,9 +468,8 @@ static void apic_common_set_id(Object *obj, Visitor *v, const char *name,
         return;
     }
 
-    visit_type_int(v, name, &value, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    visit_type_int(v, name, &value, errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
diff --git a/hw/intc/arm_gic.c b/hw/intc/arm_gic.c
index b305d9032a..aa01bac522 100644
--- a/hw/intc/arm_gic.c
+++ b/hw/intc/arm_gic.c
@@ -1404,11 +1404,9 @@ static void arm_gic_realize(DeviceState *dev, Error **errp)
     GICState *s = ARM_GIC(dev);
     SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
     ARMGICClass *agc = ARM_GIC_GET_CLASS(s);
-    Error *local_err = NULL;
 
-    agc->parent_realize(dev, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    agc->parent_realize(dev, errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
diff --git a/hw/intc/arm_gic_kvm.c b/hw/intc/arm_gic_kvm.c
index af5cd367e9..00f1b704be 100644
--- a/hw/intc/arm_gic_kvm.c
+++ b/hw/intc/arm_gic_kvm.c
@@ -495,12 +495,10 @@ static void kvm_arm_gic_realize(DeviceState *dev, Error **errp)
     int i;
     GICState *s = KVM_ARM_GIC(dev);
     KVMARMGICClass *kgc = KVM_ARM_GIC_GET_CLASS(s);
-    Error *local_err = NULL;
     int ret;
 
-    kgc->parent_realize(dev, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    kgc->parent_realize(dev, errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
@@ -513,9 +511,8 @@ static void kvm_arm_gic_realize(DeviceState *dev, Error **errp)
     if (!kvm_arm_gic_can_save_restore(s)) {
         error_setg(&s->migration_blocker, "This operating system kernel does "
                                           "not support vGICv2 migration");
-        migrate_add_blocker(s->migration_blocker, &local_err);
-        if (local_err) {
-            error_propagate(errp, local_err);
+        migrate_add_blocker(s->migration_blocker, errp);
+        if (ERR_IS_SET(errp)) {
             error_free(s->migration_blocker);
             return;
         }
diff --git a/hw/intc/arm_gicv3.c b/hw/intc/arm_gicv3.c
index f0c967b304..1dd941fef3 100644
--- a/hw/intc/arm_gicv3.c
+++ b/hw/intc/arm_gicv3.c
@@ -365,11 +365,9 @@ static void arm_gic_realize(DeviceState *dev, Error **errp)
     /* Device instance realize function for the GIC sysbus device */
     GICv3State *s = ARM_GICV3(dev);
     ARMGICv3Class *agc = ARM_GICV3_GET_CLASS(s);
-    Error *local_err = NULL;
 
-    agc->parent_realize(dev, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    agc->parent_realize(dev, errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
diff --git a/hw/intc/arm_gicv3_its_kvm.c b/hw/intc/arm_gicv3_its_kvm.c
index a0441d6bd1..edeb4334d1 100644
--- a/hw/intc/arm_gicv3_its_kvm.c
+++ b/hw/intc/arm_gicv3_its_kvm.c
@@ -56,16 +56,14 @@ static int kvm_its_send_msi(GICv3ITSState *s, uint32_t value, uint16_t devid)
 static void kvm_arm_its_realize(DeviceState *dev, Error **errp)
 {
     GICv3ITSState *s = ARM_GICV3_ITS_COMMON(dev);
-    Error *local_err = NULL;
 
     /*
      * Block migration of a KVM GICv3 ITS device: the API for saving and
      * restoring the state in the kernel is not yet available
      */
     error_setg(&s->migration_blocker, "vITS migration is not implemented");
-    migrate_add_blocker(s->migration_blocker, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    migrate_add_blocker(s->migration_blocker, errp);
+    if (ERR_IS_SET(errp)) {
         error_free(s->migration_blocker);
         return;
     }
diff --git a/hw/intc/arm_gicv3_kvm.c b/hw/intc/arm_gicv3_kvm.c
index 4ee2baa691..21e86edb17 100644
--- a/hw/intc/arm_gicv3_kvm.c
+++ b/hw/intc/arm_gicv3_kvm.c
@@ -684,14 +684,12 @@ static void kvm_arm_gicv3_realize(DeviceState *dev, Error **errp)
 {
     GICv3State *s = KVM_ARM_GICV3(dev);
     KVMARMGICv3Class *kgc = KVM_ARM_GICV3_GET_CLASS(s);
-    Error *local_err = NULL;
     int i;
 
     DPRINTF("kvm_arm_gicv3_realize\n");
 
-    kgc->parent_realize(dev, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    kgc->parent_realize(dev, errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
@@ -744,9 +742,8 @@ static void kvm_arm_gicv3_realize(DeviceState *dev, Error **errp)
                                GICD_CTLR)) {
         error_setg(&s->migration_blocker, "This operating system kernel does "
                                           "not support vGICv3 migration");
-        migrate_add_blocker(s->migration_blocker, &local_err);
-        if (local_err) {
-            error_propagate(errp, local_err);
+        migrate_add_blocker(s->migration_blocker, errp);
+        if (ERR_IS_SET(errp)) {
             error_free(s->migration_blocker);
             return;
         }
diff --git a/hw/intc/armv7m_nvic.c b/hw/intc/armv7m_nvic.c
index 26a4b2dcb5..7795c0623f 100644
--- a/hw/intc/armv7m_nvic.c
+++ b/hw/intc/armv7m_nvic.c
@@ -1003,7 +1003,6 @@ static void armv7m_nvic_realize(DeviceState *dev, Error **errp)
 {
     NVICState *s = NVIC(dev);
     SysBusDevice *systick_sbd;
-    Error *err = NULL;
 
     s->cpu = ARM_CPU(qemu_get_cpu(0));
     assert(s->cpu);
@@ -1018,9 +1017,8 @@ static void armv7m_nvic_realize(DeviceState *dev, Error **errp)
     /* include space for internal exception vectors */
     s->num_irq += NVIC_FIRST_IRQ;
 
-    object_property_set_bool(OBJECT(&s->systick), true, "realized", &err);
-    if (err != NULL) {
-        error_propagate(errp, err);
+    object_property_set_bool(OBJECT(&s->systick), true, "realized", errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
     systick_sbd = SYS_BUS_DEVICE(&s->systick);
diff --git a/hw/intc/realview_gic.c b/hw/intc/realview_gic.c
index 50bbab66ee..1b114e7065 100644
--- a/hw/intc/realview_gic.c
+++ b/hw/intc/realview_gic.c
@@ -23,7 +23,6 @@ static void realview_gic_realize(DeviceState *dev, Error **errp)
     SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
     RealViewGICState *s = REALVIEW_GIC(dev);
     SysBusDevice *busdev;
-    Error *err = NULL;
     /* The GICs on the RealView boards have a fixed nonconfigurable
      * number of interrupt lines, so we don't need to expose this as
      * a qdev property.
@@ -31,9 +30,8 @@ static void realview_gic_realize(DeviceState *dev, Error **errp)
     int numirq = 96;
 
     qdev_prop_set_uint32(DEVICE(&s->gic), "num-irq", numirq);
-    object_property_set_bool(OBJECT(&s->gic), true, "realized", &err);
-    if (err != NULL) {
-        error_propagate(errp, err);
+    object_property_set_bool(OBJECT(&s->gic), true, "realized", errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
     busdev = SYS_BUS_DEVICE(&s->gic);
diff --git a/hw/ipack/ipack.c b/hw/ipack/ipack.c
index 6021e6d135..e380f4f369 100644
--- a/hw/ipack/ipack.c
+++ b/hw/ipack/ipack.c
@@ -60,11 +60,9 @@ static void ipack_device_unrealize(DeviceState *dev, Error **errp)
 {
     IPackDevice *idev = IPACK_DEVICE(dev);
     IPackDeviceClass *k = IPACK_DEVICE_GET_CLASS(dev);
-    Error *err = NULL;
 
     if (k->unrealize) {
-        k->unrealize(dev, &err);
-        error_propagate(errp, err);
+        k->unrealize(dev, errp);
         return;
     }
 
diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c
index 6367d041f0..a68342bd0e 100644
--- a/hw/misc/ivshmem.c
+++ b/hw/misc/ivshmem.c
@@ -463,7 +463,6 @@ static void setup_interrupt(IVShmemState *s, int vector, Error **errp)
     bool with_irqfd = kvm_msi_via_irqfd_enabled() &&
         ivshmem_has_feature(s, IVSHMEM_MSI);
     PCIDevice *pdev = PCI_DEVICE(s);
-    Error *err = NULL;
 
     IVSHMEM_DPRINTF("setting up interrupt for vector: %d\n", vector);
 
@@ -472,9 +471,8 @@ static void setup_interrupt(IVShmemState *s, int vector, Error **errp)
         watch_vector_notifier(s, n, vector);
     } else if (msix_enabled(pdev)) {
         IVSHMEM_DPRINTF("with irqfd\n");
-        ivshmem_add_kvm_msi_virq(s, vector, &err);
-        if (err) {
-            error_propagate(errp, err);
+        ivshmem_add_kvm_msi_virq(s, vector, errp);
+        if (ERR_IS_SET(errp)) {
             return;
         }
 
@@ -836,11 +834,9 @@ static void ivshmem_write_config(PCIDevice *pdev, uint32_t address,
 static void ivshmem_common_realize(PCIDevice *dev, Error **errp)
 {
     IVShmemState *s = IVSHMEM_COMMON(dev);
-    Error *err = NULL;
     uint8_t *pci_conf;
     uint8_t attr = PCI_BASE_ADDRESS_SPACE_MEMORY |
         PCI_BASE_ADDRESS_MEM_PREFETCH;
-    Error *local_err = NULL;
 
     /* IRQFD requires MSI */
     if (ivshmem_has_feature(s, IVSHMEM_IOEVENTFD) &&
@@ -883,9 +879,8 @@ static void ivshmem_common_realize(PCIDevice *dev, Error **errp)
          * Older versions did it asynchronously, but that creates a
          * number of entertaining race conditions.
          */
-        ivshmem_recv_setup(s, &err);
-        if (err) {
-            error_propagate(errp, err);
+        ivshmem_recv_setup(s, errp);
+        if (ERR_IS_SET(errp)) {
             return;
         }
 
@@ -911,9 +906,8 @@ static void ivshmem_common_realize(PCIDevice *dev, Error **errp)
     if (!ivshmem_is_master(s)) {
         error_setg(&s->migration_blocker,
                    "Migration is disabled when using feature 'peer mode' in device 'ivshmem'");
-        migrate_add_blocker(s->migration_blocker, &local_err);
-        if (local_err) {
-            error_propagate(errp, local_err);
+        migrate_add_blocker(s->migration_blocker, errp);
+        if (ERR_IS_SET(errp)) {
             error_free(s->migration_blocker);
             return;
         }
diff --git a/hw/misc/macio/macio.c b/hw/misc/macio/macio.c
index fed0c6b269..c5945b81f7 100644
--- a/hw/misc/macio/macio.c
+++ b/hw/misc/macio/macio.c
@@ -126,15 +126,13 @@ static void macio_common_realize(PCIDevice *d, Error **errp)
 {
     MacIOState *s = MACIO(d);
     SysBusDevice *sysbus_dev;
-    Error *err = NULL;
     MemoryRegion *dbdma_mem;
 
     s->dbdma = DBDMA_init(&dbdma_mem);
     memory_region_add_subregion(&s->bar, 0x08000, dbdma_mem);
 
-    object_property_set_bool(OBJECT(&s->cuda), true, "realized", &err);
-    if (err) {
-        error_propagate(errp, err);
+    object_property_set_bool(OBJECT(&s->cuda), true, "realized", errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
     sysbus_dev = SYS_BUS_DEVICE(&s->cuda);
@@ -162,23 +160,20 @@ static void macio_oldworld_realize(PCIDevice *d, Error **errp)
 {
     MacIOState *s = MACIO(d);
     OldWorldMacIOState *os = OLDWORLD_MACIO(d);
-    Error *err = NULL;
     SysBusDevice *sysbus_dev;
     int i;
     int cur_irq = 0;
 
-    macio_common_realize(d, &err);
-    if (err) {
-        error_propagate(errp, err);
+    macio_common_realize(d, errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
     sysbus_dev = SYS_BUS_DEVICE(&s->cuda);
     sysbus_connect_irq(sysbus_dev, 0, os->irqs[cur_irq++]);
 
-    object_property_set_bool(OBJECT(&os->nvram), true, "realized", &err);
-    if (err) {
-        error_propagate(errp, err);
+    object_property_set_bool(OBJECT(&os->nvram), true, "realized", errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
     sysbus_dev = SYS_BUS_DEVICE(&os->nvram);
@@ -196,9 +191,8 @@ static void macio_oldworld_realize(PCIDevice *d, Error **errp)
         qemu_irq irq0 = os->irqs[cur_irq++];
         qemu_irq irq1 = os->irqs[cur_irq++];
 
-        macio_realize_ide(s, &os->ide[i], irq0, irq1, 0x16 + (i * 4), &err);
-        if (err) {
-            error_propagate(errp, err);
+        macio_realize_ide(s, &os->ide[i], irq0, irq1, 0x16 + (i * 4), errp);
+        if (ERR_IS_SET(errp)) {
             return;
         }
     }
@@ -273,15 +267,13 @@ static void macio_newworld_realize(PCIDevice *d, Error **errp)
 {
     MacIOState *s = MACIO(d);
     NewWorldMacIOState *ns = NEWWORLD_MACIO(d);
-    Error *err = NULL;
     SysBusDevice *sysbus_dev;
     MemoryRegion *timer_memory = NULL;
     int i;
     int cur_irq = 0;
 
-    macio_common_realize(d, &err);
-    if (err) {
-        error_propagate(errp, err);
+    macio_common_realize(d, errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
@@ -298,9 +290,8 @@ static void macio_newworld_realize(PCIDevice *d, Error **errp)
         qemu_irq irq0 = ns->irqs[cur_irq++];
         qemu_irq irq1 = ns->irqs[cur_irq++];
 
-        macio_realize_ide(s, &ns->ide[i], irq0, irq1, 0x16 + (i * 4), &err);
-        if (err) {
-            error_propagate(errp, err);
+        macio_realize_ide(s, &ns->ide[i], irq0, irq1, 0x16 + (i * 4), errp);
+        if (ERR_IS_SET(errp)) {
             return;
         }
     }
diff --git a/hw/misc/tmp105.c b/hw/misc/tmp105.c
index 82a25b91f4..1b0584d14b 100644
--- a/hw/misc/tmp105.c
+++ b/hw/misc/tmp105.c
@@ -70,12 +70,10 @@ static void tmp105_set_temperature(Object *obj, Visitor *v, const char *name,
                                    void *opaque, Error **errp)
 {
     TMP105State *s = TMP105(obj);
-    Error *local_err = NULL;
     int64_t temp;
 
-    visit_type_int(v, name, &temp, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    visit_type_int(v, name, &temp, errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
     if (temp >= 128000 || temp < -128000) {
diff --git a/hw/net/dp8393x.c b/hw/net/dp8393x.c
index b53fcaa8bc..5142003d07 100644
--- a/hw/net/dp8393x.c
+++ b/hw/net/dp8393x.c
@@ -874,7 +874,6 @@ static void dp8393x_realize(DeviceState *dev, Error **errp)
     dp8393xState *s = DP8393X(dev);
     int i, checksum;
     uint8_t *prom;
-    Error *local_err = NULL;
 
     address_space_init(&s->as, s->dma_mr, "dp8393x");
     memory_region_init_io(&s->mmio, OBJECT(dev), &dp8393x_ops, s,
@@ -888,9 +887,8 @@ static void dp8393x_realize(DeviceState *dev, Error **errp)
     s->regs[SONIC_SR] = 0x0004; /* only revision recognized by Linux */
 
     memory_region_init_ram(&s->prom, OBJECT(dev),
-                           "dp8393x-prom", SONIC_PROM_SIZE, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+                           "dp8393x-prom", SONIC_PROM_SIZE, errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
     memory_region_set_readonly(&s->prom, true);
diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c
index 44da2caf51..43118044f1 100644
--- a/hw/nvram/fw_cfg.c
+++ b/hw/nvram/fw_cfg.c
@@ -1073,11 +1073,9 @@ static void fw_cfg_io_realize(DeviceState *dev, Error **errp)
 {
     FWCfgIoState *s = FW_CFG_IO(dev);
     SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
-    Error *local_err = NULL;
 
-    fw_cfg_file_slots_allocate(FW_CFG(s), &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    fw_cfg_file_slots_allocate(FW_CFG(s), errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
@@ -1126,11 +1124,9 @@ static void fw_cfg_mem_realize(DeviceState *dev, Error **errp)
     FWCfgMemState *s = FW_CFG_MEM(dev);
     SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
     const MemoryRegionOps *data_ops = &fw_cfg_data_mem_ops;
-    Error *local_err = NULL;
 
-    fw_cfg_file_slots_allocate(FW_CFG(s), &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    fw_cfg_file_slots_allocate(FW_CFG(s), errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
diff --git a/hw/pci-bridge/pci_expander_bridge.c b/hw/pci-bridge/pci_expander_bridge.c
index ff59abf208..54132c52ad 100644
--- a/hw/pci-bridge/pci_expander_bridge.c
+++ b/hw/pci-bridge/pci_expander_bridge.c
@@ -216,7 +216,6 @@ static void pxb_dev_realize_common(PCIDevice *dev, bool pcie, Error **errp)
     DeviceState *ds, *bds = NULL;
     PCIBus *bus;
     const char *dev_name = NULL;
-    Error *local_err = NULL;
 
     if (pxb->numa_node != NUMA_NODE_UNASSIGNED &&
         pxb->numa_node >= nb_numa_nodes) {
@@ -246,9 +245,8 @@ static void pxb_dev_realize_common(PCIDevice *dev, bool pcie, Error **errp)
 
     PCI_HOST_BRIDGE(ds)->bus = bus;
 
-    pxb_register_bus(dev, bus, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    pxb_register_bus(dev, bus, errp);
+    if (ERR_IS_SET(errp)) {
         goto err_register_bus;
     }
 
diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index a848d1508b..4e25eee0ad 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -960,7 +960,6 @@ static PCIDevice *do_pci_register_device(PCIDevice *pci_dev, PCIBus *bus,
     PCIDeviceClass *pc = PCI_DEVICE_GET_CLASS(pci_dev);
     PCIConfigReadFunc *config_read = pc->config_read;
     PCIConfigWriteFunc *config_write = pc->config_write;
-    Error *local_err = NULL;
     DeviceState *dev = DEVICE(pci_dev);
 
     pci_dev->bus = bus;
@@ -1039,9 +1038,8 @@ static PCIDevice *do_pci_register_device(PCIDevice *pci_dev, PCIBus *bus,
     if (pc->is_bridge) {
         pci_init_mask_bridge(pci_dev);
     }
-    pci_init_multifunction(bus, pci_dev, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    pci_init_multifunction(bus, pci_dev, errp);
+    if (ERR_IS_SET(errp)) {
         do_pci_unregister_device(pci_dev);
         return NULL;
     }
@@ -1983,7 +1981,6 @@ static void pci_qdev_realize(DeviceState *qdev, Error **errp)
 {
     PCIDevice *pci_dev = (PCIDevice *)qdev;
     PCIDeviceClass *pc = PCI_DEVICE_GET_CLASS(pci_dev);
-    Error *local_err = NULL;
     PCIBus *bus;
     bool is_default_rom;
 
@@ -2000,9 +1997,8 @@ static void pci_qdev_realize(DeviceState *qdev, Error **errp)
         return;
 
     if (pc->realize) {
-        pc->realize(pci_dev, &local_err);
-        if (local_err) {
-            error_propagate(errp, local_err);
+        pc->realize(pci_dev, errp);
+        if (ERR_IS_SET(errp)) {
             do_pci_unregister_device(pci_dev);
             return;
         }
@@ -2015,9 +2011,8 @@ static void pci_qdev_realize(DeviceState *qdev, Error **errp)
         is_default_rom = true;
     }
 
-    pci_add_option_rom(pci_dev, is_default_rom, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    pci_add_option_rom(pci_dev, is_default_rom, errp);
+    if (ERR_IS_SET(errp)) {
         pci_qdev_unrealize(DEVICE(pci_dev), IGNORE_ERRORS);
         return;
     }
diff --git a/hw/pci/shpc.c b/hw/pci/shpc.c
index 844bc97737..f3ea297a4d 100644
--- a/hw/pci/shpc.c
+++ b/hw/pci/shpc.c
@@ -508,14 +508,12 @@ static void shpc_device_hotplug_common(PCIDevice *affected_dev, int *slot,
 void shpc_device_hotplug_cb(HotplugHandler *hotplug_dev, DeviceState *dev,
                             Error **errp)
 {
-    Error *local_err = NULL;
     PCIDevice *pci_hotplug_dev = PCI_DEVICE(hotplug_dev);
     SHPCDevice *shpc = pci_hotplug_dev->shpc;
     int slot;
 
-    shpc_device_hotplug_common(PCI_DEVICE(dev), &slot, shpc, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    shpc_device_hotplug_common(PCI_DEVICE(dev), &slot, shpc, errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
@@ -551,16 +549,14 @@ void shpc_device_hotplug_cb(HotplugHandler *hotplug_dev, DeviceState *dev,
 void shpc_device_hot_unplug_request_cb(HotplugHandler *hotplug_dev,
                                        DeviceState *dev, Error **errp)
 {
-    Error *local_err = NULL;
     PCIDevice *pci_hotplug_dev = PCI_DEVICE(hotplug_dev);
     SHPCDevice *shpc = pci_hotplug_dev->shpc;
     uint8_t state;
     uint8_t led;
     int slot;
 
-    shpc_device_hotplug_common(PCI_DEVICE(dev), &slot, shpc, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    shpc_device_hotplug_common(PCI_DEVICE(dev), &slot, shpc, errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c
index 04621d5534..1b9abbb094 100644
--- a/hw/ppc/e500.c
+++ b/hw/ppc/e500.c
@@ -708,16 +708,14 @@ static DeviceState *ppce500_init_mpic_qemu(PPCE500Params *params,
 static DeviceState *ppce500_init_mpic_kvm(PPCE500Params *params,
                                           qemu_irq **irqs, Error **errp)
 {
-    Error *err = NULL;
     DeviceState *dev;
     CPUState *cs;
 
     dev = qdev_create(NULL, TYPE_KVM_OPENPIC);
     qdev_prop_set_uint32(dev, "model", params->mpic_version);
 
-    object_property_set_bool(OBJECT(dev), true, "realized", &err);
-    if (err) {
-        error_propagate(errp, err);
+    object_property_set_bool(OBJECT(dev), true, "realized", errp);
+    if (ERR_IS_SET(errp)) {
         object_unparent(OBJECT(dev));
         return NULL;
     }
diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c
index 655f1da14c..0e5236e577 100644
--- a/hw/ppc/pnv.c
+++ b/hw/ppc/pnv.c
@@ -885,7 +885,6 @@ static void pnv_chip_icp_realize(PnvChip *chip, Error **errp)
 static void pnv_chip_realize(DeviceState *dev, Error **errp)
 {
     PnvChip *chip = PNV_CHIP(dev);
-    Error *error = NULL;
     PnvChipClass *pcc = PNV_CHIP_GET_CLASS(chip);
     char *typename = pnv_core_typename(pcc->cpu_model);
     size_t typesize = object_type_get_instance_size(typename);
@@ -897,17 +896,15 @@ static void pnv_chip_realize(DeviceState *dev, Error **errp)
     }
 
     /* XSCOM bridge */
-    pnv_xscom_realize(chip, &error);
-    if (error) {
-        error_propagate(errp, error);
+    pnv_xscom_realize(chip, errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
     sysbus_mmio_map(SYS_BUS_DEVICE(chip), 0, PNV_XSCOM_BASE(chip));
 
     /* Cores */
-    pnv_chip_core_sanitize(chip, &error);
-    if (error) {
-        error_propagate(errp, error);
+    pnv_chip_core_sanitize(chip, errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
@@ -955,26 +952,23 @@ static void pnv_chip_realize(DeviceState *dev, Error **errp)
 
     /* Interrupt Management Area. This is the memory region holding
      * all the Interrupt Control Presenter (ICP) registers */
-    pnv_chip_icp_realize(chip, &error);
-    if (error) {
-        error_propagate(errp, error);
+    pnv_chip_icp_realize(chip, errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
     /* Processor Service Interface (PSI) Host Bridge */
     object_property_set_int(OBJECT(&chip->psi), PNV_PSIHB_BASE(chip),
                             "bar", &error_fatal);
-    object_property_set_bool(OBJECT(&chip->psi), true, "realized", &error);
-    if (error) {
-        error_propagate(errp, error);
+    object_property_set_bool(OBJECT(&chip->psi), true, "realized", errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
     pnv_xscom_add_subregion(chip, PNV_XSCOM_PSIHB_BASE, &chip->psi.xscom_regs);
 
     /* Create the simplified OCC model */
-    object_property_set_bool(OBJECT(&chip->occ), true, "realized", &error);
-    if (error) {
-        error_propagate(errp, error);
+    object_property_set_bool(OBJECT(&chip->occ), true, "realized", errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
     pnv_xscom_add_subregion(chip, PNV_XSCOM_OCC_BASE, &chip->occ.xscom_regs);
@@ -1083,11 +1077,9 @@ static void pnv_set_num_chips(Object *obj, Visitor *v, const char *name,
 {
     PnvMachineState *pnv = POWERNV_MACHINE(obj);
     uint32_t num_chips;
-    Error *local_err = NULL;
 
-    visit_type_uint32(v, name, &num_chips, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    visit_type_uint32(v, name, &num_chips, errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
diff --git a/hw/ppc/pnv_core.c b/hw/ppc/pnv_core.c
index 161f7dbc62..24d132cc3e 100644
--- a/hw/ppc/pnv_core.c
+++ b/hw/ppc/pnv_core.c
@@ -113,7 +113,6 @@ static const MemoryRegionOps pnv_core_xscom_ops = {
 
 static void pnv_core_realize_child(Object *child, XICSFabric *xi, Error **errp)
 {
-    Error *local_err = NULL;
     CPUState *cs = CPU(child);
     PowerPCCPU *cpu = POWERPC_CPU(cs);
     Object *obj;
@@ -121,23 +120,20 @@ static void pnv_core_realize_child(Object *child, XICSFabric *xi, Error **errp)
     obj = object_new(TYPE_PNV_ICP);
     object_property_add_child(OBJECT(cpu), "icp", obj, IGNORE_ERRORS);
     object_property_add_const_link(obj, "xics", OBJECT(xi), &error_abort);
-    object_property_set_bool(obj, true, "realized", &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    object_property_set_bool(obj, true, "realized", errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
-    object_property_set_bool(child, true, "realized", &local_err);
-    if (local_err) {
+    object_property_set_bool(child, true, "realized", errp);
+    if (ERR_IS_SET(errp)) {
         object_unparent(obj);
-        error_propagate(errp, local_err);
         return;
     }
 
-    powernv_cpu_init(cpu, &local_err);
-    if (local_err) {
+    powernv_cpu_init(cpu, errp);
+    if (ERR_IS_SET(errp)) {
         object_unparent(obj);
-        error_propagate(errp, local_err);
         return;
     }
 
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index af33297e0f..f39fd1e06f 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -2823,7 +2823,6 @@ void spapr_core_unplug_request(HotplugHandler *hotplug_dev, DeviceState *dev,
     int index;
     sPAPRDRConnector *drc;
     sPAPRDRConnectorClass *drck;
-    Error *local_err = NULL;
     CPUCore *cc = CPU_CORE(dev);
     int smt = kvmppc_smt_threads();
 
@@ -2841,9 +2840,8 @@ void spapr_core_unplug_request(HotplugHandler *hotplug_dev, DeviceState *dev,
     g_assert(drc);
 
     drck = SPAPR_DR_CONNECTOR_GET_CLASS(drc);
-    drck->detach(drc, dev, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    drck->detach(drc, dev, errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
@@ -2859,7 +2857,6 @@ static void spapr_core_plug(HotplugHandler *hotplug_dev, DeviceState *dev,
     CPUCore *cc = CPU_CORE(dev);
     CPUState *cs = CPU(core->threads);
     sPAPRDRConnector *drc;
-    Error *local_err = NULL;
     void *fdt = NULL;
     int fdt_offset = 0;
     int smt = kvmppc_smt_threads();
@@ -2886,10 +2883,9 @@ static void spapr_core_plug(HotplugHandler *hotplug_dev, DeviceState *dev,
 
     if (drc) {
         sPAPRDRConnectorClass *drck = SPAPR_DR_CONNECTOR_GET_CLASS(drc);
-        drck->attach(drc, dev, fdt, fdt_offset, !dev->hotplugged, &local_err);
-        if (local_err) {
+        drck->attach(drc, dev, fdt, fdt_offset, !dev->hotplugged, errp);
+        if (ERR_IS_SET(errp)) {
             g_free(fdt);
-            error_propagate(errp, local_err);
             return;
         }
     }
diff --git a/hw/ppc/spapr_drc.c b/hw/ppc/spapr_drc.c
index 1b0a7546fb..867fe9cd84 100644
--- a/hw/ppc/spapr_drc.c
+++ b/hw/ppc/spapr_drc.c
@@ -239,7 +239,6 @@ static void prop_get_fdt(Object *obj, Visitor *v, const char *name,
                          void *opaque, Error **errp)
 {
     sPAPRDRConnector *drc = SPAPR_DR_CONNECTOR(obj);
-    Error *err = NULL;
     int fdt_offset_next, fdt_offset, fdt_depth;
     void *fdt;
 
@@ -263,19 +262,17 @@ static void prop_get_fdt(Object *obj, Visitor *v, const char *name,
         case FDT_BEGIN_NODE:
             fdt_depth++;
             name = fdt_get_name(fdt, fdt_offset, &name_len);
-            visit_start_struct(v, name, NULL, 0, &err);
-            if (err) {
-                error_propagate(errp, err);
+            visit_start_struct(v, name, NULL, 0, errp);
+            if (ERR_IS_SET(errp)) {
                 return;
             }
             break;
         case FDT_END_NODE:
             /* shouldn't ever see an FDT_END_NODE before FDT_BEGIN_NODE */
             g_assert(fdt_depth > 0);
-            visit_check_struct(v, &err);
+            visit_check_struct(v, errp);
             visit_end_struct(v, NULL);
-            if (err) {
-                error_propagate(errp, err);
+            if (ERR_IS_SET(errp)) {
                 return;
             }
             fdt_depth--;
@@ -284,22 +281,19 @@ static void prop_get_fdt(Object *obj, Visitor *v, const char *name,
             int i;
             prop = fdt_get_property_by_offset(fdt, fdt_offset, &prop_len);
             name = fdt_string(fdt, fdt32_to_cpu(prop->nameoff));
-            visit_start_list(v, name, NULL, 0, &err);
-            if (err) {
-                error_propagate(errp, err);
+            visit_start_list(v, name, NULL, 0, errp);
+            if (ERR_IS_SET(errp)) {
                 return;
             }
             for (i = 0; i < prop_len; i++) {
-                visit_type_uint8(v, NULL, (uint8_t *)&prop->data[i], &err);
-                if (err) {
-                    error_propagate(errp, err);
+                visit_type_uint8(v, NULL, (uint8_t *)&prop->data[i], errp);
+                if (ERR_IS_SET(errp)) {
                     return;
                 }
             }
-            visit_check_list(v, &err);
+            visit_check_list(v, errp);
             visit_end_list(v, NULL);
-            if (err) {
-                error_propagate(errp, err);
+            if (ERR_IS_SET(errp)) {
                 return;
             }
             break;
diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
index 5b3660b674..03eff2f67c 100644
--- a/hw/ppc/spapr_pci.c
+++ b/hw/ppc/spapr_pci.c
@@ -1429,7 +1429,6 @@ static void spapr_phb_hot_plug_child(HotplugHandler *plug_handler,
     sPAPRPHBState *phb = SPAPR_PCI_HOST_BRIDGE(DEVICE(plug_handler));
     PCIDevice *pdev = PCI_DEVICE(plugged_dev);
     sPAPRDRConnector *drc = spapr_phb_get_pci_drc(phb, pdev);
-    Error *local_err = NULL;
     PCIBus *bus = PCI_BUS(qdev_get_parent_bus(DEVICE(pdev)));
     uint32_t slotnr = PCI_SLOT(pdev->devfn);
 
@@ -1461,9 +1460,8 @@ static void spapr_phb_hot_plug_child(HotplugHandler *plug_handler,
         return;
     }
 
-    spapr_phb_add_pci_device(drc, phb, pdev, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    spapr_phb_add_pci_device(drc, phb, pdev, errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
@@ -1497,7 +1495,6 @@ static void spapr_phb_hot_unplug_child(HotplugHandler *plug_handler,
     PCIDevice *pdev = PCI_DEVICE(plugged_dev);
     sPAPRDRConnectorClass *drck;
     sPAPRDRConnector *drc = spapr_phb_get_pci_drc(phb, pdev);
-    Error *local_err = NULL;
 
     if (!phb->dr_enabled) {
         error_setg(errp, QERR_BUS_NO_HOTPLUG,
@@ -1534,9 +1531,8 @@ static void spapr_phb_hot_unplug_child(HotplugHandler *plug_handler,
             }
         }
 
-        spapr_phb_remove_pci_device(drc, phb, pdev, &local_err);
-        if (local_err) {
-            error_propagate(errp, local_err);
+        spapr_phb_remove_pci_device(drc, phb, pdev, errp);
+        if (ERR_IS_SET(errp)) {
             return;
         }
 
diff --git a/hw/s390x/css-bridge.c b/hw/s390x/css-bridge.c
index 823747fcd7..49e20a5786 100644
--- a/hw/s390x/css-bridge.c
+++ b/hw/s390x/css-bridge.c
@@ -30,12 +30,10 @@ static void ccw_device_unplug(HotplugHandler *hotplug_dev,
     CcwDevice *ccw_dev = CCW_DEVICE(dev);
     CCWDeviceClass *k = CCW_DEVICE_GET_CLASS(ccw_dev);
     SubchDev *sch = ccw_dev->sch;
-    Error *err = NULL;
 
     if (k->unplug) {
-        k->unplug(hotplug_dev, dev, &err);
-        if (err) {
-            error_propagate(errp, err);
+        k->unplug(hotplug_dev, dev, errp);
+        if (ERR_IS_SET(errp)) {
             return;
         }
     }
diff --git a/hw/s390x/css.c b/hw/s390x/css.c
index c39e65f206..cf3a3fa70a 100644
--- a/hw/s390x/css.c
+++ b/hw/s390x/css.c
@@ -1974,7 +1974,6 @@ static void set_css_devid(Object *obj, Visitor *v, const char *name,
     DeviceState *dev = DEVICE(obj);
     Property *prop = opaque;
     CssDevId *dev_id = qdev_get_prop_ptr(dev, prop);
-    Error *local_err = NULL;
     char *str;
     int num, n1, n2;
     unsigned int cssid, ssid, devid;
@@ -1984,9 +1983,8 @@ static void set_css_devid(Object *obj, Visitor *v, const char *name,
         return;
     }
 
-    visit_type_str(v, name, &str, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    visit_type_str(v, name, &str, errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c
index 9c56e17196..5cace901e0 100644
--- a/hw/s390x/virtio-ccw.c
+++ b/hw/s390x/virtio-ccw.c
@@ -901,12 +901,10 @@ static void virtio_ccw_rng_realize(VirtioCcwDevice *ccw_dev, Error **errp)
 {
     VirtIORNGCcw *dev = VIRTIO_RNG_CCW(ccw_dev);
     DeviceState *vdev = DEVICE(&dev->vdev);
-    Error *err = NULL;
 
     qdev_set_parent_bus(vdev, BUS(&ccw_dev->bus));
-    object_property_set_bool(OBJECT(vdev), true, "realized", &err);
-    if (err) {
-        error_propagate(errp, err);
+    object_property_set_bool(OBJECT(vdev), true, "realized", errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
@@ -919,12 +917,10 @@ static void virtio_ccw_crypto_realize(VirtioCcwDevice *ccw_dev, Error **errp)
 {
     VirtIOCryptoCcw *dev = VIRTIO_CRYPTO_CCW(ccw_dev);
     DeviceState *vdev = DEVICE(&dev->vdev);
-    Error *err = NULL;
 
     qdev_set_parent_bus(vdev, BUS(&ccw_dev->bus));
-    object_property_set_bool(OBJECT(vdev), true, "realized", &err);
-    if (err) {
-        error_propagate(errp, err);
+    object_property_set_bool(OBJECT(vdev), true, "realized", errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
@@ -1762,11 +1758,9 @@ static void vhost_vsock_ccw_realize(VirtioCcwDevice *ccw_dev, Error **errp)
 {
     VHostVSockCCWState *dev = VHOST_VSOCK_CCW(ccw_dev);
     DeviceState *vdev = DEVICE(&dev->vdev);
-    Error *err = NULL;
 
     qdev_set_parent_bus(vdev, BUS(&ccw_dev->bus));
-    object_property_set_bool(OBJECT(vdev), true, "realized", &err);
-    error_propagate(errp, err);
+    object_property_set_bool(OBJECT(vdev), true, "realized", errp);
 }
 
 static void vhost_vsock_ccw_class_init(ObjectClass *klass, void *data)
diff --git a/hw/scsi/esp-pci.c b/hw/scsi/esp-pci.c
index e295d88939..30f866d5a0 100644
--- a/hw/scsi/esp-pci.c
+++ b/hw/scsi/esp-pci.c
@@ -462,15 +462,13 @@ static void dc390_write_config(PCIDevice *dev,
 static void dc390_scsi_realize(PCIDevice *dev, Error **errp)
 {
     DC390State *pci = DC390(dev);
-    Error *err = NULL;
     uint8_t *contents;
     uint16_t chksum = 0;
     int i;
 
     /* init base class */
-    esp_pci_scsi_realize(dev, &err);
-    if (err) {
-        error_propagate(errp, err);
+    esp_pci_scsi_realize(dev, errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c
index 796ae562bf..bb9f5628db 100644
--- a/hw/scsi/scsi-bus.c
+++ b/hw/scsi/scsi-bus.c
@@ -152,7 +152,6 @@ static void scsi_qdev_realize(DeviceState *qdev, Error **errp)
     SCSIDevice *dev = SCSI_DEVICE(qdev);
     SCSIBus *bus = DO_UPCAST(SCSIBus, qbus, dev->qdev.parent_bus);
     SCSIDevice *d;
-    Error *local_err = NULL;
 
     if (dev->channel > bus->info->max_channel) {
         error_setg(errp, "bad scsi channel id: %d", dev->channel);
@@ -200,9 +199,8 @@ static void scsi_qdev_realize(DeviceState *qdev, Error **errp)
     }
 
     QTAILQ_INIT(&dev->requests);
-    scsi_device_realize(dev, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    scsi_device_realize(dev, errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
     dev->vmsentry = qemu_add_vm_change_state_handler(scsi_dma_restart_cb,
@@ -229,7 +227,6 @@ SCSIDevice *scsi_bus_legacy_add_drive(SCSIBus *bus, BlockBackend *blk,
     const char *driver;
     char *name;
     DeviceState *dev;
-    Error *err = NULL;
 
     driver = blk_is_sg(blk) ? "scsi-generic" : "scsi-disk";
     dev = qdev_create(&bus->qbus, driver);
@@ -248,15 +245,13 @@ SCSIDevice *scsi_bus_legacy_add_drive(SCSIBus *bus, BlockBackend *blk,
     if (serial && object_property_find(OBJECT(dev), "serial", IGNORE_ERRORS)) {
         qdev_prop_set_string(dev, "serial", serial);
     }
-    qdev_prop_set_drive(dev, "drive", blk, &err);
-    if (err) {
-        error_propagate(errp, err);
+    qdev_prop_set_drive(dev, "drive", blk, errp);
+    if (ERR_IS_SET(errp)) {
         object_unparent(OBJECT(dev));
         return NULL;
     }
-    object_property_set_bool(OBJECT(dev), true, "realized", &err);
-    if (err != NULL) {
-        error_propagate(errp, err);
+    object_property_set_bool(OBJECT(dev), true, "realized", errp);
+    if (ERR_IS_SET(errp)) {
         object_unparent(OBJECT(dev));
         return NULL;
     }
diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c
index a53f058621..d5c984504b 100644
--- a/hw/scsi/scsi-disk.c
+++ b/hw/scsi/scsi-disk.c
@@ -2306,7 +2306,6 @@ static void scsi_disk_unit_attention_reported(SCSIDevice *dev)
 static void scsi_realize(SCSIDevice *dev, Error **errp)
 {
     SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, dev);
-    Error *err = NULL;
 
     if (!s->qdev.conf.blk) {
         error_setg(errp, "drive property not set");
@@ -2322,17 +2321,15 @@ static void scsi_realize(SCSIDevice *dev, Error **errp)
     blkconf_serial(&s->qdev.conf, &s->serial);
     blkconf_blocksizes(&s->qdev.conf);
     if (dev->type == TYPE_DISK) {
-        blkconf_geometry(&dev->conf, NULL, 65535, 255, 255, &err);
-        if (err) {
-            error_propagate(errp, err);
+        blkconf_geometry(&dev->conf, NULL, 65535, 255, 255, errp);
+        if (ERR_IS_SET(errp)) {
             return;
         }
     }
     blkconf_apply_backend_options(&dev->conf,
                                   blk_is_read_only(s->qdev.conf.blk),
-                                  dev->type == TYPE_DISK, &err);
-    if (err) {
-        error_propagate(errp, err);
+                                  dev->type == TYPE_DISK, errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
diff --git a/hw/scsi/vhost-scsi.c b/hw/scsi/vhost-scsi.c
index c44d1045b6..dea479b7ba 100644
--- a/hw/scsi/vhost-scsi.c
+++ b/hw/scsi/vhost-scsi.c
@@ -139,7 +139,6 @@ static void vhost_scsi_realize(DeviceState *dev, Error **errp)
 {
     VirtIOSCSICommon *vs = VIRTIO_SCSI_COMMON(dev);
     VHostSCSICommon *vsc = VHOST_SCSI_COMMON(dev);
-    Error *err = NULL;
     int vhostfd = -1;
     int ret;
 
@@ -167,17 +166,15 @@ static void vhost_scsi_realize(DeviceState *dev, Error **errp)
                                vhost_dummy_handle_output,
                                vhost_dummy_handle_output,
                                vhost_dummy_handle_output,
-                               &err);
-    if (err != NULL) {
-        error_propagate(errp, err);
+                               errp);
+    if (ERR_IS_SET(errp)) {
         goto close_fd;
     }
 
     error_setg(&vsc->migration_blocker,
                "vhost-scsi does not support migration");
-    migrate_add_blocker(vsc->migration_blocker, &err);
-    if (err) {
-        error_propagate(errp, err);
+    migrate_add_blocker(vsc->migration_blocker, errp);
+    if (ERR_IS_SET(errp)) {
         error_free(vsc->migration_blocker);
         goto close_fd;
     }
diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c
index f46f06d055..a253b5df59 100644
--- a/hw/scsi/virtio-scsi.c
+++ b/hw/scsi/virtio-scsi.c
@@ -877,15 +877,13 @@ static void virtio_scsi_device_realize(DeviceState *dev, Error **errp)
 {
     VirtIODevice *vdev = VIRTIO_DEVICE(dev);
     VirtIOSCSI *s = VIRTIO_SCSI(dev);
-    Error *err = NULL;
 
     virtio_scsi_common_realize(dev,
                                virtio_scsi_handle_ctrl,
                                virtio_scsi_handle_event,
                                virtio_scsi_handle_cmd,
-                               &err);
-    if (err != NULL) {
-        error_propagate(errp, err);
+                               errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
diff --git a/hw/usb/bus.c b/hw/usb/bus.c
index c25247e3cb..9c747821d2 100644
--- a/hw/usb/bus.c
+++ b/hw/usb/bus.c
@@ -246,7 +246,6 @@ void usb_device_free_streams(USBDevice *dev, USBEndpoint **eps, int nr_eps)
 static void usb_qdev_realize(DeviceState *qdev, Error **errp)
 {
     USBDevice *dev = USB_DEVICE(qdev);
-    Error *local_err = NULL;
 
     pstrcpy(dev->product_desc, sizeof(dev->product_desc),
             usb_device_get_product_desc(dev));
@@ -254,24 +253,21 @@ static void usb_qdev_realize(DeviceState *qdev, Error **errp)
     QLIST_INIT(&dev->strings);
     usb_ep_init(dev);
 
-    usb_claim_port(dev, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    usb_claim_port(dev, errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
-    usb_device_realize(dev, &local_err);
-    if (local_err) {
+    usb_device_realize(dev, errp);
+    if (ERR_IS_SET(errp)) {
         usb_release_port(dev);
-        error_propagate(errp, local_err);
         return;
     }
 
     if (dev->auto_attach) {
-        usb_device_attach(dev, &local_err);
-        if (local_err) {
+        usb_device_attach(dev, errp);
+        if (ERR_IS_SET(errp)) {
             usb_qdev_unrealize(qdev, IGNORE_ERRORS);
-            error_propagate(errp, local_err);
             return;
         }
     }
@@ -330,7 +326,6 @@ USBDevice *usb_create(USBBus *bus, const char *name)
 static USBDevice *usb_try_create_simple(USBBus *bus, const char *name,
                                         Error **errp)
 {
-    Error *err = NULL;
     USBDevice *dev;
 
     dev = USB_DEVICE(qdev_try_create(&bus->qbus, name));
@@ -338,9 +333,8 @@ static USBDevice *usb_try_create_simple(USBBus *bus, const char *name,
         error_setg(errp, "Failed to create USB device '%s'", name);
         return NULL;
     }
-    object_property_set_bool(OBJECT(dev), true, "realized", &err);
-    if (err) {
-        error_propagate(errp, err);
+    object_property_set_bool(OBJECT(dev), true, "realized", errp);
+    if (ERR_IS_SET(errp)) {
         error_prepend(errp, "Failed to initialize USB device '%s': ",
                       name);
         object_unparent(OBJECT(dev));
@@ -533,11 +527,9 @@ void usb_check_attach(USBDevice *dev, Error **errp)
 void usb_device_attach(USBDevice *dev, Error **errp)
 {
     USBPort *port = dev->port;
-    Error *local_err = NULL;
 
-    usb_check_attach(dev, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    usb_check_attach(dev, errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
@@ -754,15 +746,13 @@ static bool usb_get_attached(Object *obj, Error **errp)
 static void usb_set_attached(Object *obj, bool value, Error **errp)
 {
     USBDevice *dev = USB_DEVICE(obj);
-    Error *err = NULL;
 
     if (dev->attached == value) {
         return;
     }
 
     if (value) {
-        usb_device_attach(dev, &err);
-        error_propagate(errp, err);
+        usb_device_attach(dev, errp);
     } else {
         usb_device_detach(dev);
     }
diff --git a/hw/usb/dev-serial.c b/hw/usb/dev-serial.c
index bfbf7cdce7..cc9dd8b533 100644
--- a/hw/usb/dev-serial.c
+++ b/hw/usb/dev-serial.c
@@ -483,7 +483,6 @@ static void usb_serial_event(void *opaque, int event)
 static void usb_serial_realize(USBDevice *dev, Error **errp)
 {
     USBSerialState *s = USB_SERIAL_DEV(dev);
-    Error *local_err = NULL;
     Chardev *chr = qemu_chr_fe_get_driver(&s->cs);
 
     usb_desc_create_serial(dev);
@@ -495,9 +494,8 @@ static void usb_serial_realize(USBDevice *dev, Error **errp)
         return;
     }
 
-    usb_check_attach(dev, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    usb_check_attach(dev, errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
diff --git a/hw/usb/hcd-ohci.c b/hw/usb/hcd-ohci.c
index 3ada35e954..2c221d23be 100644
--- a/hw/usb/hcd-ohci.c
+++ b/hw/usb/hcd-ohci.c
@@ -1850,7 +1850,6 @@ static void usb_ohci_init(OHCIState *ohci, DeviceState *dev,
                           char *masterbus, uint32_t firstport,
                           AddressSpace *as, Error **errp)
 {
-    Error *err = NULL;
     int i;
 
     ohci->as = as;
@@ -1885,9 +1884,8 @@ static void usb_ohci_init(OHCIState *ohci, DeviceState *dev,
         usb_register_companion(masterbus, ports, num_ports,
                                firstport, ohci, &ohci_port_ops,
                                USB_SPEED_MASK_LOW | USB_SPEED_MASK_FULL,
-                               &err);
-        if (err) {
-            error_propagate(errp, err);
+                               errp);
+        if (ERR_IS_SET(errp)) {
             return;
         }
     } else {
@@ -1944,7 +1942,6 @@ static void ohci_die(OHCIState *ohci)
 
 static void usb_ohci_realize_pci(PCIDevice *dev, Error **errp)
 {
-    Error *err = NULL;
     OHCIPCIState *ohci = PCI_OHCI(dev);
 
     dev->config[PCI_CLASS_PROG] = 0x10; /* OHCI */
@@ -1952,9 +1949,8 @@ static void usb_ohci_realize_pci(PCIDevice *dev, Error **errp)
 
     usb_ohci_init(&ohci->state, DEVICE(dev), ohci->num_ports, 0,
                   ohci->masterbus, ohci->firstport,
-                  pci_get_address_space(dev), &err);
-    if (err) {
-        error_propagate(errp, err);
+                  pci_get_address_space(dev), errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c
index ca72a80f27..b99a4d6429 100644
--- a/hw/usb/hcd-uhci.c
+++ b/hw/usb/hcd-uhci.c
@@ -1208,7 +1208,6 @@ static USBBusOps uhci_bus_ops = {
 
 static void usb_uhci_common_realize(PCIDevice *dev, Error **errp)
 {
-    Error *err = NULL;
     PCIDeviceClass *pc = PCI_DEVICE_GET_CLASS(dev);
     UHCIPCIDeviceClass *u = container_of(pc, UHCIPCIDeviceClass, parent_class);
     UHCIState *s = UHCI(dev);
@@ -1229,9 +1228,8 @@ static void usb_uhci_common_realize(PCIDevice *dev, Error **errp)
         usb_register_companion(s->masterbus, ports, NB_PORTS,
                                s->firstport, s, &uhci_port_ops,
                                USB_SPEED_MASK_LOW | USB_SPEED_MASK_FULL,
-                               &err);
-        if (err) {
-            error_propagate(errp, err);
+                               errp);
+        if (ERR_IS_SET(errp)) {
             return;
         }
     } else {
diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
index 2d3bad68fc..ae34f35a55 100644
--- a/hw/vfio/pci.c
+++ b/hw/vfio/pci.c
@@ -2615,7 +2615,6 @@ static void vfio_realize(PCIDevice *pdev, Error **errp)
     VFIODevice *vbasedev_iter;
     VFIOGroup *group;
     char *tmp, group_path[PATH_MAX], *group_name;
-    Error *err = NULL;
     ssize_t len;
     struct stat st;
     int groupid;
@@ -2684,9 +2683,8 @@ static void vfio_realize(PCIDevice *pdev, Error **errp)
         goto error;
     }
 
-    vfio_populate_device(vdev, &err);
-    if (err) {
-        error_propagate(errp, err);
+    vfio_populate_device(vdev, errp);
+    if (ERR_IS_SET(errp)) {
         goto error;
     }
 
@@ -2775,9 +2773,8 @@ static void vfio_realize(PCIDevice *pdev, Error **errp)
 
     vfio_pci_size_rom(vdev);
 
-    vfio_msix_early_setup(vdev, &err);
-    if (err) {
-        error_propagate(errp, err);
+    vfio_msix_early_setup(vdev, errp);
+    if (ERR_IS_SET(errp)) {
         goto error;
     }
 
diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c
index c2ba3f991b..09ac3b7d12 100644
--- a/hw/virtio/virtio-balloon.c
+++ b/hw/virtio/virtio-balloon.c
@@ -162,12 +162,10 @@ static void balloon_stats_set_poll_interval(Object *obj, Visitor *v,
                                             Error **errp)
 {
     VirtIOBalloon *s = opaque;
-    Error *local_err = NULL;
     int64_t value;
 
-    visit_type_int(v, name, &value, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    visit_type_int(v, name, &value, errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index 20b2fef683..d6a8b6be5f 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -2373,12 +2373,10 @@ static void virtio_rng_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
 {
     VirtIORngPCI *vrng = VIRTIO_RNG_PCI(vpci_dev);
     DeviceState *vdev = DEVICE(&vrng->vdev);
-    Error *err = NULL;
 
     qdev_set_parent_bus(vdev, BUS(&vpci_dev->bus));
-    object_property_set_bool(OBJECT(vdev), true, "realized", &err);
-    if (err) {
-        error_propagate(errp, err);
+    object_property_set_bool(OBJECT(vdev), true, "realized", errp);
+    if (ERR_IS_SET(errp)) {
         return;
     }
 
diff --git a/hw/virtio/virtio-rng.c b/hw/virtio/virtio-rng.c
index e564e3b291..964c775e41 100644
--- a/hw/virtio/virtio-rng.c
+++ b/hw/virtio/virtio-rng.c
@@ -160,7 +160,6 @@ static void virtio_rng_device_realize(DeviceState *dev, Error **errp)
 {
     VirtIODevice *vdev = VIRTIO_DEVICE(dev);
     VirtIORNG *vrng = VIRTIO_RNG(dev);
-