diff mbox

[v2] error-report: leveraging error_report_exit()

Message ID 1470902156-11471-1-git-send-email-peterx@redhat.com
State New
Headers show

Commit Message

Peter Xu Aug. 11, 2016, 7:55 a.m. UTC
Replace possible places in current codes to leverage the new macro. Most
of the changes are done by spatch using error_report_exit.cocci script,
with some further manual fixes on the format (line width not exceeding
80 chars).

Signed-off-by: Peter Xu <peterx@redhat.com>
---

V1 of this patch didn't pass checkpatch...

Some more tunings on line width. This V2 survives.

 arch_init.c                    |   6 +-
 bootdevice.c                   |   4 +-
 cpus.c                         |   3 +-
 device_tree.c                  |  42 +++----
 hw/9pfs/9p.c                   |   3 +-
 hw/alpha/dp264.c               |  14 +--
 hw/arm/armv7m.c                |   3 +-
 hw/arm/digic_boards.c          |   6 +-
 hw/arm/fsl-imx6.c              |   5 +-
 hw/arm/highbank.c              |   6 +-
 hw/arm/raspi.c                 |   7 +-
 hw/arm/sabrelite.c             |   8 +-
 hw/arm/strongarm.c             |   6 +-
 hw/arm/sysbus-fdt.c            |   5 +-
 hw/arm/vexpress.c              |  14 +--
 hw/arm/virt.c                  |  44 +++----
 hw/arm/xlnx-ep108.c            |   9 +-
 hw/block/tc58128.c             |   3 +-
 hw/block/virtio-blk.c          |   9 +-
 hw/char/exynos4210_uart.c      |   9 +-
 hw/core/machine.c              |   5 +-
 hw/core/platform-bus.c         |   8 +-
 hw/i386/intel_iommu.c          |   5 +-
 hw/i386/pc.c                   |  36 +++---
 hw/i386/pc_piix.c              |   3 +-
 hw/i386/x86-iommu.c            |   5 +-
 hw/ide/core.c                  |   5 +-
 hw/intc/ioapic.c               |   5 +-
 hw/intc/xics_kvm.c             |  17 ++-
 hw/m68k/an5206.c               |   3 +-
 hw/microblaze/boot.c           |   5 +-
 hw/mips/mips_fulong2e.c        |   3 +-
 hw/mips/mips_jazz.c            |   3 +-
 hw/mips/mips_malta.c           |  26 ++--
 hw/mips/mips_mipssim.c         |   5 +-
 hw/net/virtio-net.c            |  28 ++---
 hw/nvram/fw_cfg.c              |   5 +-
 hw/pci/pci.c                   |   5 +-
 hw/ppc/e500.c                  |   5 +-
 hw/ppc/mac_newworld.c          |  14 +--
 hw/ppc/mac_oldworld.c          |  18 ++-
 hw/ppc/mpc8544ds.c             |   3 +-
 hw/ppc/ppc405_boards.c         |  14 +--
 hw/ppc/prep.c                  |  11 +-
 hw/ppc/spapr.c                 |  87 +++++--------
 hw/ppc/virtex_ml507.c          |   5 +-
 hw/scsi/vhost-scsi.c           |  11 +-
 hw/scsi/virtio-scsi.c          |  10 +-
 hw/sh4/shix.c                  |   3 +-
 hw/smbios/smbios.c             |  41 +++----
 hw/sparc/sun4m.c               |  19 ++-
 hw/tricore/tricore_testboard.c |   8 +-
 hw/unicore32/puv3.c            |   9 +-
 hw/virtio/virtio.c             |  45 +++----
 hw/xtensa/sim.c                |   4 +-
 hw/xtensa/xtfpga.c             |  16 +--
 numa.c                         |  22 ++--
 qemu-img.c                     |  16 +--
 qemu-io.c                      |   9 +-
 qemu-nbd.c                     | 115 +++++++-----------
 replay/replay-char.c           |   6 +-
 replay/replay-events.c         |  12 +-
 replay/replay-internal.c       |   4 +-
 replay/replay-time.c           |   3 +-
 replay/replay.c                |   9 +-
 target-arm/machine.c           |   5 +-
 target-i386/kvm.c              |   8 +-
 target-ppc/kvm.c               |   7 +-
 target-s390x/cpu.c             |   5 +-
 target-s390x/kvm.c             |   8 +-
 target-s390x/mmu_helper.c      |   3 +-
 trace/control.c                |   6 +-
 ui/spice-core.c                |  41 +++----
 vl.c                           | 270 +++++++++++++++--------------------------
 xen-hvm.c                      |   3 +-
 75 files changed, 481 insertions(+), 772 deletions(-)

Comments

no-reply@patchew.org Aug. 11, 2016, 8:01 a.m. UTC | #1
Hi,

Your series failed automatic build test. Please find the testing commands and
their output below. If you have docker installed, you can probably reproduce it
locally.

Subject: [Qemu-devel] [PATCH v2] error-report: leveraging error_report_exit()
Message-id: 1470902156-11471-1-git-send-email-peterx@redhat.com
Type: series

=== TEST SCRIPT BEGIN ===
#!/bin/bash
set -e
git submodule update --init dtc
make J=8 docker-test-quick@centos6

# we need CURL DPRINTF patch
# http://patchew.org/QEMU/1470027888-24381-1-git-send-email-famz%40redhat.com/
#make J=8 docker-test-mingw@fedora
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
Switched to a new branch 'test'
b3e901f error-report: leveraging error_report_exit()

=== OUTPUT BEGIN ===
Submodule 'dtc' (git://git.qemu-project.org/dtc.git) registered for path 'dtc'
Cloning into 'dtc'...
Submodule path 'dtc': checked out '65cc4d2748a2c2e6f27f1cf39e07a5dbabd80ebf'
  BUILD centos6
  ARCHIVE qemu.tgz
  ARCHIVE dtc.tgz
  COPY RUNNER
  RUN test-quick in centos6
No C++ compiler available; disabling C++ specific optional code
Install prefix    /tmp/qemu-test/src/tests/docker/install
BIOS directory    /tmp/qemu-test/src/tests/docker/install/share/qemu
binary directory  /tmp/qemu-test/src/tests/docker/install/bin
library directory /tmp/qemu-test/src/tests/docker/install/lib
module directory  /tmp/qemu-test/src/tests/docker/install/lib/qemu
libexec directory /tmp/qemu-test/src/tests/docker/install/libexec
include directory /tmp/qemu-test/src/tests/docker/install/include
config directory  /tmp/qemu-test/src/tests/docker/install/etc
local state directory   /tmp/qemu-test/src/tests/docker/install/var
Manual directory  /tmp/qemu-test/src/tests/docker/install/share/man
ELF interp prefix /usr/gnemul/qemu-%M
Source path       /tmp/qemu-test/src
C compiler        cc
Host C compiler   cc
C++ compiler      
Objective-C compiler cc
ARFLAGS           rv
CFLAGS            -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include   -g 
QEMU_CFLAGS       -I/usr/include/pixman-1    -fPIE -DPIE -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common  -Wendif-labels -Wmissing-include-dirs -Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wold-style-declaration -Wold-style-definition -Wtype-limits -fstack-protector-all
LDFLAGS           -Wl,--warn-common -Wl,-z,relro -Wl,-z,now -pie -m64 -g 
make              make
install           install
python            python -B
smbd              /usr/sbin/smbd
module support    no
host CPU          x86_64
host big endian   no
target list       x86_64-softmmu aarch64-softmmu
tcg debug enabled no
gprof enabled     no
sparse enabled    no
strip binaries    yes
profiler          no
static build      no
pixman            system
SDL support       yes (1.2.14)
GTK support       no 
GTK GL support    no
VTE support       no 
TLS priority      NORMAL
GNUTLS support    no
GNUTLS rnd        no
libgcrypt         no
libgcrypt kdf     no
nettle            no 
nettle kdf        no
libtasn1          no
curses support    no
virgl support     no
curl support      no
mingw32 support   no
Audio drivers     oss
Block whitelist (rw) 
Block whitelist (ro) 
VirtFS support    no
VNC support       yes
VNC SASL support  no
VNC JPEG support  no
VNC PNG support   no
xen support       no
brlapi support    no
bluez  support    no
Documentation     no
PIE               yes
vde support       no
netmap support    no
Linux AIO support no
ATTR/XATTR support yes
Install blobs     yes
KVM support       yes
RDMA support      no
TCG interpreter   no
fdt support       yes
preadv support    yes
fdatasync         yes
madvise           yes
posix_madvise     yes
uuid support      no
libcap-ng support no
vhost-net support yes
vhost-scsi support yes
Trace backends    log
spice support     no 
rbd support       no
xfsctl support    no
smartcard support no
libusb            no
usb net redir     no
OpenGL support    no
OpenGL dmabufs    no
libiscsi support  no
libnfs support    no
build guest agent yes
QGA VSS support   no
QGA w32 disk info no
QGA MSI support   no
seccomp support   no
coroutine backend ucontext
coroutine pool    yes
GlusterFS support no
Archipelago support no
gcov              gcov
gcov enabled      no
TPM support       yes
libssh2 support   no
TPM passthrough   yes
QOM debugging     yes
vhdx              no
lzo support       no
snappy support    no
bzip2 support     no
NUMA host support no
tcmalloc support  no
jemalloc support  no
avx2 optimization no
  GEN   x86_64-softmmu/config-devices.mak.tmp
  GEN   aarch64-softmmu/config-devices.mak.tmp
  GEN   config-host.h
  GEN   qemu-options.def
  GEN   qmp-commands.h
  GEN   qapi-types.h
  GEN   qapi-visit.h
  GEN   qapi-event.h
  GEN   x86_64-softmmu/config-devices.mak
  GEN   aarch64-softmmu/config-devices.mak
  GEN   qmp-introspect.h
  GEN   tests/test-qapi-types.h
  GEN   tests/test-qapi-visit.h
  GEN   tests/test-qmp-commands.h
  GEN   tests/test-qapi-event.h
  GEN   tests/test-qmp-introspect.h
  GEN   config-all-devices.mak
  GEN   trace/generated-events.h
  GEN   trace/generated-tracers.h
  GEN   trace/generated-tcg-tracers.h
  GEN   trace/generated-helpers-wrappers.h
  GEN   trace/generated-helpers.h
  CC    tests/qemu-iotests/socket_scm_helper.o
  GEN   qga/qapi-generated/qga-qapi-types.h
  GEN   qga/qapi-generated/qga-qapi-visit.h
  GEN   qga/qapi-generated/qga-qmp-commands.h
  GEN   qga/qapi-generated/qga-qapi-types.c
  GEN   qga/qapi-generated/qga-qapi-visit.c
  GEN   qga/qapi-generated/qga-qmp-marshal.c
  GEN   qmp-introspect.c
  GEN   qapi-types.c
  GEN   qapi-visit.c
  GEN   qapi-event.c
  CC    qapi/qapi-visit-core.o
  CC    qapi/qapi-dealloc-visitor.o
  CC    qapi/qmp-input-visitor.o
  CC    qapi/qmp-output-visitor.o
  CC    qapi/qmp-registry.o
  CC    qapi/qmp-dispatch.o
  CC    qapi/string-input-visitor.o
  CC    qapi/string-output-visitor.o
  CC    qapi/opts-visitor.o
  CC    qapi/qapi-clone-visitor.o
  CC    qapi/qmp-event.o
  CC    qapi/qapi-util.o
  CC    qobject/qnull.o
  CC    qobject/qint.o
  CC    qobject/qstring.o
  CC    qobject/qdict.o
  CC    qobject/qlist.o
  CC    qobject/qfloat.o
  CC    qobject/qbool.o
  CC    qobject/qjson.o
  CC    qobject/qobject.o
  CC    qobject/json-lexer.o
  CC    qobject/json-streamer.o
  CC    qobject/json-parser.o
  GEN   trace/generated-events.c
  CC    trace/control.o
  CC    trace/qmp.o
  CC    util/osdep.o
  CC    util/cutils.o
  CC    util/unicode.o
  CC    util/qemu-timer-common.o
  CC    util/compatfd.o
  CC    util/event_notifier-posix.o
  CC    util/mmap-alloc.o
  CC    util/oslib-posix.o
  CC    util/qemu-openpty.o
  CC    util/qemu-thread-posix.o
  CC    util/memfd.o
  CC    util/envlist.o
  CC    util/path.o
  CC    util/module.o
  CC    util/bitmap.o
  CC    util/bitops.o
  CC    util/hbitmap.o
  CC    util/fifo8.o
  CC    util/acl.o
  CC    util/error.o
  CC    util/qemu-error.o
  CC    util/id.o
  CC    util/iov.o
  CC    util/qemu-config.o
  CC    util/qemu-sockets.o
  CC    util/uri.o
  CC    util/notify.o
  CC    util/qemu-option.o
  CC    util/qemu-progress.o
  CC    util/hexdump.o
  CC    util/crc32c.o
  CC    util/throttle.o
  CC    util/getauxval.o
  CC    util/readline.o
  CC    util/rfifolock.o
  CC    util/rcu.o
  CC    util/qemu-coroutine.o
  CC    util/qemu-coroutine-lock.o
  CC    util/qemu-coroutine-io.o
  CC    util/qemu-coroutine-sleep.o
  CC    util/coroutine-ucontext.o
  CC    util/buffer.o
  CC    util/timed-average.o
  CC    util/base64.o
  CC    util/log.o
  CC    util/qdist.o
  CC    util/qht.o
  CC    util/range.o
  CC    crypto/pbkdf-stub.o
  CC    stubs/arch-query-cpu-def.o
  CC    stubs/bdrv-next-monitor-owned.o
  CC    stubs/blk-commit-all.o
/tmp/qemu-test/src/util/qht.c: In function ‘qht_reset_size’:
/tmp/qemu-test/src/util/qht.c:413: warning: ‘new’ may be used uninitialized in this function
  CC    stubs/blockdev-close-all-bdrv-states.o
  CC    stubs/clock-warp.o
  CC    stubs/cpu-get-clock.o
  CC    stubs/cpu-get-icount.o
  CC    stubs/dump.o
  CC    stubs/fdset-add-fd.o
  CC    stubs/fdset-find-fd.o
  CC    stubs/fdset-get-fd.o
  CC    stubs/fdset-remove-fd.o
  CC    stubs/gdbstub.o
  CC    stubs/get-fd.o
  CC    stubs/get-next-serial.o
  CC    stubs/get-vm-name.o
  CC    stubs/iothread-lock.o
  CC    stubs/is-daemonized.o
  CC    stubs/machine-init-done.o
  CC    stubs/migr-blocker.o
  CC    stubs/mon-is-qmp.o
  CC    stubs/mon-printf.o
  CC    stubs/monitor-init.o
  CC    stubs/notify-event.o
  CC    stubs/qtest.o
  CC    stubs/replay.o
  CC    stubs/replay-user.o
  CC    stubs/reset.o
  CC    stubs/runstate-check.o
  CC    stubs/set-fd-handler.o
  CC    stubs/slirp.o
  CC    stubs/sysbus.o
  CC    stubs/trace-control.o
  CC    stubs/uuid.o
  CC    stubs/vm-stop.o
  CC    stubs/vmstate.o
  CC    stubs/cpus.o
  CC    stubs/kvm.o
  CC    stubs/qmp_pc_dimm_device_list.o
  CC    stubs/target-monitor-defs.o
  CC    stubs/target-get-monitor-def.o
  CC    stubs/vhost.o
  CC    stubs/iohandler.o
/tmp/qemu-test/src/trace/control.c: In function ‘trace_init_events’:
/tmp/qemu-test/src/trace/control.c:195: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/trace/control.c:195: warning: nested extern declaration of ‘error_report_exit’
  CC    stubs/smbios_type_38.o
  CC    stubs/ipmi.o
  CC    stubs/pc_madt_cpu_entry.o
  CC    contrib/ivshmem-client/ivshmem-client.o
  CC    contrib/ivshmem-client/main.o
  CC    contrib/ivshmem-server/ivshmem-server.o
  CC    contrib/ivshmem-server/main.o
  CC    qemu-nbd.o
  CC    async.o
  CC    thread-pool.o
  CC    block.o
  CC    blockjob.o
  CC    main-loop.o
  CC    iohandler.o
  CC    qemu-timer.o
  CC    aio-posix.o
  CC    qemu-io-cmds.o
  CC    block/raw_bsd.o
  CC    block/qcow.o
  CC    block/vdi.o
  CC    block/vmdk.o
  CC    block/cloop.o
  CC    block/bochs.o
  CC    block/vpc.o
  CC    block/vvfat.o
  CC    block/qcow2.o
  CC    block/qcow2-refcount.o
  CC    block/qcow2-cluster.o
  CC    block/qcow2-snapshot.o
  CC    block/qcow2-cache.o
  CC    block/qed.o
  CC    block/qed-gencb.o
  CC    block/qed-l2-cache.o
  CC    block/qed-table.o
  CC    block/qed-cluster.o
  CC    block/qed-check.o
  CC    block/quorum.o
  CC    block/parallels.o
  CC    block/blkdebug.o
  CC    block/blkverify.o
  CC    block/blkreplay.o
  CC    block/block-backend.o
  CC    block/snapshot.o
  CC    block/qapi.o
  CC    block/raw-posix.o
  CC    block/null.o
  CC    block/mirror.o
  CC    block/commit.o
  CC    block/io.o
  CC    block/throttle-groups.o
  CC    block/nbd.o
  CC    block/nbd-client.o
  CC    block/sheepdog.o
  CC    block/accounting.o
  CC    block/dirty-bitmap.o
  CC    block/write-threshold.o
  CC    block/crypto.o
  CC    nbd/server.o
  CC    nbd/client.o
  CC    nbd/common.o
  CC    block/dmg.o
  CC    crypto/init.o
  CC    crypto/hash.o
  CC    crypto/hash-glib.o
  CC    crypto/aes.o
  CC    crypto/desrfb.o
  CC    crypto/cipher.o
  CC    crypto/tlscreds.o
  CC    crypto/tlscredsanon.o
  CC    crypto/tlscredsx509.o
  CC    crypto/tlssession.o
  CC    crypto/secret.o
  CC    crypto/random-platform.o
  CC    crypto/pbkdf.o
  CC    crypto/ivgen.o
  CC    crypto/ivgen-essiv.o
  CC    crypto/ivgen-plain.o
  CC    crypto/ivgen-plain64.o
  CC    crypto/afsplit.o
  CC    crypto/xts.o
  CC    crypto/block.o
  CC    crypto/block-qcow.o
  CC    crypto/block-luks.o
  CC    io/channel.o
  CC    io/channel-buffer.o
  CC    io/channel-command.o
  CC    io/channel-file.o
  CC    io/channel-socket.o
  CC    io/channel-tls.o
  CC    io/channel-watch.o
  CC    io/channel-websock.o
  CC    io/channel-util.o
  CC    io/task.o
  CC    qom/object.o
  CC    qom/container.o
  CC    qom/qom-qobject.o
  CC    qom/object_interfaces.o
  GEN   qemu-img-cmds.h
  CC    qemu-io.o
  CC    qemu-bridge-helper.o
  CC    blockdev.o
  CC    blockdev-nbd.o
  CC    iothread.o
  CC    qdev-monitor.o
  CC    device-hotplug.o
  CC    os-posix.o
  CC    qemu-char.o
  CC    page_cache.o
  CC    accel.o
  CC    bt-host.o
  CC    bt-vhci.o
  CC    dma-helpers.o
  CC    vl.o
  CC    tpm.o
  CC    device_tree.o
  GEN   qmp-marshal.c
  CC    qmp.o
  CC    hmp.o
  CC    tcg-runtime.o
/tmp/qemu-test/src/qemu-nbd.c: In function ‘find_partition’:
/tmp/qemu-test/src/qemu-nbd.c:176: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/qemu-nbd.c:176: warning: nested extern declaration of ‘error_report_exit’
  CC    audio/audio.o
  CC    audio/noaudio.o
  CC    audio/wavaudio.o
  CC    audio/mixeng.o
  CC    audio/sdlaudio.o
  CC    audio/ossaudio.o
  CC    audio/wavcapture.o
  CC    backends/rng.o
  CC    backends/rng-egd.o
  CC    backends/rng-random.o
  CC    backends/msmouse.o
  CC    backends/testdev.o
  CC    backends/tpm.o
  CC    backends/hostmem.o
  CC    backends/hostmem-ram.o
  CC    backends/hostmem-file.o
  CC    block/stream.o
  CC    block/backup.o
  CC    disas/arm.o
  CC    disas/i386.o
  CC    fsdev/qemu-fsdev-dummy.o
  CC    fsdev/qemu-fsdev-opts.o
  CC    hw/acpi/core.o
  CC    hw/acpi/piix4.o
  CC    hw/acpi/pcihp.o
  CC    hw/acpi/ich9.o
  CC    hw/acpi/tco.o
  CC    hw/acpi/cpu_hotplug.o
  CC    hw/acpi/memory_hotplug.o
  CC    hw/acpi/memory_hotplug_acpi_table.o
  CC    hw/acpi/cpu.o
  CC    hw/acpi/acpi_interface.o
  CC    hw/acpi/bios-linker-loader.o
  CC    hw/acpi/aml-build.o
  CC    hw/acpi/ipmi.o
  CC    hw/audio/es1370.o
  CC    hw/audio/sb16.o
  CC    hw/audio/ac97.o
  CC    hw/audio/fmopl.o
  CC    hw/audio/adlib.o
  CC    hw/audio/gus.o
  CC    hw/audio/gusemu_hal.o
  CC    hw/audio/gusemu_mixer.o
  CC    hw/audio/cs4231a.o
  CC    hw/audio/intel-hda.o
  CC    hw/audio/hda-codec.o
  CC    hw/audio/pcspk.o
  CC    hw/audio/wm8750.o
  CC    hw/audio/pl041.o
  CC    hw/audio/marvell_88w8618.o
  CC    hw/audio/lm4549.o
  CC    hw/block/block.o
  CC    hw/block/cdrom.o
  CC    hw/block/hd-geometry.o
  CC    hw/block/fdc.o
  CC    hw/block/m25p80.o
  CC    hw/block/nand.o
  CC    hw/block/pflash_cfi01.o
  CC    hw/block/pflash_cfi02.o
  CC    hw/block/ecc.o
  CC    hw/block/onenand.o
  CC    hw/block/nvme.o
  CC    hw/bt/core.o
  CC    hw/bt/l2cap.o
  CC    hw/bt/sdp.o
  CC    hw/bt/hci.o
  CC    hw/bt/hid.o
  CC    hw/bt/hci-csr.o
  CC    hw/char/ipoctal232.o
/tmp/qemu-test/src/qemu-io.c: In function ‘main’:
/tmp/qemu-test/src/qemu-io.c:491: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/qemu-io.c:491: warning: nested extern declaration of ‘error_report_exit’
  CC    hw/char/parallel.o
  CC    hw/char/pl011.o
  CC    hw/char/serial.o
  CC    hw/char/serial-isa.o
  CC    hw/char/serial-pci.o
  CC    hw/char/virtio-console.o
  CC    hw/char/cadence_uart.o
  CC    hw/char/debugcon.o
  CC    hw/char/imx_serial.o
  CC    hw/core/qdev.o
  CC    hw/core/qdev-properties.o
/tmp/qemu-test/src/device_tree.c: In function ‘create_device_tree’:
/tmp/qemu-test/src/device_tree.c:63: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/device_tree.c:63: warning: nested extern declaration of ‘error_report_exit’
/tmp/qemu-test/src/device_tree.c:70: warning: control reaches end of non-void function
  CC    hw/core/bus.o
  CC    hw/core/fw-path-provider.o
  CC    hw/core/irq.o
  CC    hw/core/hotplug.o
  CC    hw/core/ptimer.o
  CC    hw/core/sysbus.o
  CC    hw/core/machine.o
  CC    hw/core/null-machine.o
  CC    hw/core/loader.o
  CC    hw/core/qdev-properties-system.o
  CC    hw/core/register.o
  CC    hw/core/platform-bus.o
  CC    hw/display/ads7846.o
  CC    hw/display/cirrus_vga.o
  CC    hw/display/pl110.o
  CC    hw/display/ssd0303.o
  CC    hw/display/ssd0323.o
  CC    hw/display/vga-pci.o
  CC    hw/display/vga-isa.o
  CC    hw/display/vmware_vga.o
  CC    hw/display/blizzard.o
  CC    hw/display/exynos4210_fimd.o
  CC    hw/display/framebuffer.o
  CC    hw/display/tc6393xb.o
  CC    hw/dma/pl080.o
  CC    hw/dma/pl330.o
  CC    hw/dma/i8257.o
  CC    hw/dma/xlnx-zynq-devcfg.o
  CC    hw/gpio/max7310.o
  CC    hw/gpio/pl061.o
  CC    hw/gpio/zaurus.o
  CC    hw/gpio/gpio_key.o
  CC    hw/i2c/core.o
  CC    hw/i2c/smbus.o
  CC    hw/i2c/smbus_eeprom.o
  CC    hw/i2c/i2c-ddc.o
  CC    hw/i2c/versatile_i2c.o
  CC    hw/i2c/smbus_ich9.o
  CC    hw/i2c/pm_smbus.o
  CC    hw/i2c/bitbang_i2c.o
  CC    hw/i2c/exynos4210_i2c.o
  CC    hw/i2c/imx_i2c.o
  CC    hw/i2c/aspeed_i2c.o
  CC    hw/ide/core.o
  CC    hw/ide/atapi.o
  CC    hw/ide/qdev.o
  CC    hw/ide/pci.o
  CC    hw/ide/isa.o
  CC    hw/ide/piix.o
  CC    hw/ide/microdrive.o
  CC    hw/ide/ahci.o
  CC    hw/ide/ich.o
  CC    hw/input/hid.o
  CC    hw/input/lm832x.o
  CC    hw/input/pckbd.o
  CC    hw/input/pl050.o
  CC    hw/input/ps2.o
  CC    hw/input/stellaris_input.o
  CC    hw/input/tsc2005.o
  CC    hw/input/vmmouse.o
  CC    hw/input/virtio-input.o
  CC    hw/input/virtio-input-hid.o
  CC    hw/input/virtio-input-host.o
  CC    hw/intc/i8259_common.o
  CC    hw/intc/i8259.o
  CC    hw/intc/pl190.o
  CC    hw/intc/imx_avic.o
  CC    hw/intc/realview_gic.o
  CC    hw/intc/ioapic_common.o
  CC    hw/intc/arm_gic_common.o
  CC    hw/intc/arm_gic.o
/tmp/qemu-test/src/hw/core/platform-bus.c: In function ‘platform_bus_map_irq’:
/tmp/qemu-test/src/hw/core/platform-bus.c:124: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/hw/core/platform-bus.c:124: warning: nested extern declaration of ‘error_report_exit’
  CC    hw/intc/arm_gicv2m.o
  CC    hw/intc/arm_gicv3_common.o
  CC    hw/intc/arm_gicv3.o
  CC    hw/intc/arm_gicv3_dist.o
  CC    hw/intc/arm_gicv3_redist.o
  CC    hw/ipack/ipack.o
  CC    hw/ipack/tpci200.o
  CC    hw/ipmi/ipmi.o
  CC    hw/ipmi/ipmi_bmc_sim.o
  CC    hw/ipmi/ipmi_bmc_extern.o
  CC    hw/ipmi/isa_ipmi_kcs.o
  CC    hw/ipmi/isa_ipmi_bt.o
  CC    hw/isa/isa-bus.o
  CC    hw/isa/apm.o
  CC    hw/mem/pc-dimm.o
/tmp/qemu-test/src/hw/core/machine.c: In function ‘error_on_sysbus_device’:
/tmp/qemu-test/src/hw/core/machine.c:337: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/hw/core/machine.c:337: warning: nested extern declaration of ‘error_report_exit’
/tmp/qemu-test/src/hw/core/machine.c:339: warning: no return statement in function returning non-void
  CC    hw/mem/nvdimm.o
  CC    hw/misc/applesmc.o
  CC    hw/misc/max111x.o
  CC    hw/misc/tmp105.o
  CC    hw/misc/debugexit.o
  CC    hw/misc/sga.o
  CC    hw/misc/pc-testdev.o
  CC    hw/misc/arm_l2x0.o
  CC    hw/misc/pci-testdev.o
  CC    hw/misc/arm_integrator_debug.o
  CC    hw/misc/a9scu.o
  CC    hw/misc/arm11scu.o
  CC    hw/net/ne2000.o
  CC    hw/net/eepro100.o
  CC    hw/net/pcnet-pci.o
  CC    hw/net/pcnet.o
  CC    hw/net/e1000.o
  CC    hw/net/e1000x_common.o
  CC    hw/net/net_tx_pkt.o
  CC    hw/net/net_rx_pkt.o
  CC    hw/net/e1000e.o
  CC    hw/net/e1000e_core.o
  CC    hw/net/rtl8139.o
  CC    hw/net/vmxnet3.o
  CC    hw/net/smc91c111.o
  CC    hw/net/lan9118.o
  CC    hw/net/ne2000-isa.o
  CC    hw/net/xgmac.o
  CC    hw/net/allwinner_emac.o
  CC    hw/net/imx_fec.o
  CC    hw/net/cadence_gem.o
  CC    hw/net/stellaris_enet.o
  CC    hw/net/rocker/rocker.o
  CC    hw/net/rocker/rocker_fp.o
  CC    hw/net/rocker/rocker_desc.o
  CC    hw/net/rocker/rocker_world.o
  CC    hw/net/rocker/rocker_of_dpa.o
  CC    hw/nvram/eeprom93xx.o
  CC    hw/nvram/fw_cfg.o
  CC    hw/pci-bridge/pci_bridge_dev.o
  CC    hw/pci-bridge/pci_expander_bridge.o
  CC    hw/pci-bridge/xio3130_upstream.o
  CC    hw/pci-bridge/xio3130_downstream.o
  CC    hw/pci-bridge/ioh3420.o
  CC    hw/pci-bridge/i82801b11.o
  CC    hw/pci-host/pam.o
  CC    hw/pci-host/versatile.o
  CC    hw/pci-host/piix.o
  CC    hw/pci-host/q35.o
  CC    hw/pci-host/gpex.o
  CC    hw/pci/pci.o
  CC    hw/pci/pci_bridge.o
  CC    hw/pci/msix.o
  CC    hw/pci/msi.o
/tmp/qemu-test/src/vl.c: In function ‘configure_rtc’:
/tmp/qemu-test/src/vl.c:869: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/vl.c:869: warning: nested extern declaration of ‘error_report_exit’
/tmp/qemu-test/src/vl.c: In function ‘mon_init_func’:
/tmp/qemu-test/src/vl.c:2330: warning: ‘flags’ may be used uninitialized in this function
  CC    hw/pci/shpc.o
  CC    hw/pci/slotid_cap.o
  CC    hw/pci/pci_host.o
  CC    hw/pci/pcie_host.o
  CC    hw/pci/pcie.o
  CC    hw/pci/pcie_aer.o
  CC    hw/pci/pcie_port.o
  CC    hw/pci/pci-stub.o
  CC    hw/pcmcia/pcmcia.o
  CC    hw/scsi/scsi-disk.o
  CC    hw/scsi/scsi-generic.o
  CC    hw/scsi/scsi-bus.o
  CC    hw/scsi/lsi53c895a.o
  CC    hw/scsi/mptsas.o
  CC    hw/scsi/mptconfig.o
  CC    hw/scsi/mptendian.o
  CC    hw/scsi/megasas.o
  CC    hw/scsi/vmw_pvscsi.o
  CC    hw/scsi/esp.o
  CC    hw/scsi/esp-pci.o
  CC    hw/sd/pl181.o
  CC    hw/sd/ssi-sd.o
  CC    hw/sd/sd.o
  CC    hw/sd/core.o
  CC    hw/sd/sdhci.o
  CC    hw/smbios/smbios.o
  CC    hw/smbios/smbios_type_38.o
  CC    hw/ssi/pl022.o
  CC    hw/ssi/ssi.o
  CC    hw/ssi/xilinx_spips.o
  CC    hw/ssi/aspeed_smc.o
  CC    hw/timer/arm_timer.o
  CC    hw/timer/arm_mptimer.o
  CC    hw/timer/a9gtimer.o
  CC    hw/timer/cadence_ttc.o
  CC    hw/timer/ds1338.o
  CC    hw/timer/hpet.o
  CC    hw/timer/i8254_common.o
  CC    hw/timer/i8254.o
  CC    hw/timer/pl031.o
  CC    hw/timer/twl92230.o
  CC    hw/timer/imx_epit.o
  CC    hw/timer/imx_gpt.o
  CC    hw/timer/stm32f2xx_timer.o
  CC    hw/timer/aspeed_timer.o
  CC    hw/tpm/tpm_tis.o
  CC    hw/tpm/tpm_passthrough.o
  CC    hw/tpm/tpm_util.o
  CC    hw/usb/core.o
  CC    hw/usb/combined-packet.o
  CC    hw/usb/bus.o
  CC    hw/usb/libhw.o
  CC    hw/usb/desc.o
  CC    hw/usb/desc-msos.o
  CC    hw/usb/hcd-uhci.o
  CC    hw/usb/hcd-ohci.o
/tmp/qemu-test/src/hw/ide/core.c: In function ‘ide_drive_get’:
/tmp/qemu-test/src/hw/ide/core.c:2854: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/hw/ide/core.c:2854: warning: nested extern declaration of ‘error_report_exit’
  CC    hw/usb/hcd-ehci.o
  CC    hw/usb/hcd-ehci-pci.o
  CC    hw/usb/hcd-ehci-sysbus.o
  CC    hw/usb/hcd-xhci.o
  CC    hw/usb/hcd-musb.o
  CC    hw/usb/dev-hub.o
  CC    hw/usb/dev-hid.o
  CC    hw/usb/dev-wacom.o
  CC    hw/usb/dev-storage.o
  CC    hw/usb/dev-uas.o
  CC    hw/usb/dev-audio.o
  CC    hw/usb/dev-serial.o
  CC    hw/usb/dev-network.o
  CC    hw/usb/dev-bluetooth.o
  CC    hw/usb/dev-smartcard-reader.o
  CC    hw/usb/dev-mtp.o
  CC    hw/usb/host-stub.o
  CC    hw/virtio/virtio-rng.o
  CC    hw/virtio/virtio-pci.o
  CC    hw/virtio/virtio-bus.o
  CC    hw/virtio/virtio-mmio.o
  CC    hw/watchdog/watchdog.o
  CC    hw/watchdog/wdt_i6300esb.o
  CC    hw/watchdog/wdt_ib700.o
  CC    migration/migration.o
  CC    migration/socket.o
  CC    migration/fd.o
  CC    migration/exec.o
  CC    migration/tls.o
  CC    migration/vmstate.o
  CC    migration/qemu-file.o
  CC    migration/qemu-file-channel.o
  CC    migration/xbzrle.o
  CC    migration/postcopy-ram.o
  CC    migration/qjson.o
  CC    migration/block.o
  CC    net/net.o
  CC    net/queue.o
  CC    net/checksum.o
  CC    net/util.o
  CC    net/hub.o
  CC    net/socket.o
  CC    net/dump.o
  CC    net/eth.o
  CC    net/l2tpv3.o
  CC    net/tap.o
  CC    net/vhost-user.o
  CC    net/tap-linux.o
  CC    net/slirp.o
/tmp/qemu-test/src/hw/smbios/smbios.c: In function ‘smbios_validate_table’:
/tmp/qemu-test/src/hw/smbios/smbios.c:333: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/hw/smbios/smbios.c:333: warning: nested extern declaration of ‘error_report_exit’
  CC    net/filter.o
  CC    net/filter-buffer.o
  CC    net/filter-mirror.o
  CC    qom/cpu.o
  CC    replay/replay.o
  CC    replay/replay-internal.o
  CC    replay/replay-events.o
  CC    replay/replay-time.o
  CC    replay/replay-input.o
  CC    replay/replay-char.o
  CC    slirp/cksum.o
  CC    slirp/if.o
/tmp/qemu-test/src/hw/nvram/fw_cfg.c: In function ‘fw_cfg_add_file_callback’:
/tmp/qemu-test/src/hw/nvram/fw_cfg.c:808: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/hw/nvram/fw_cfg.c:808: warning: nested extern declaration of ‘error_report_exit’
/tmp/qemu-test/src/hw/nvram/fw_cfg.c: In function ‘fw_cfg_dma_transfer’:
/tmp/qemu-test/src/hw/nvram/fw_cfg.c:330: warning: ‘read’ may be used uninitialized in this function
  CC    slirp/ip_icmp.o
  CC    slirp/ip6_icmp.o
  CC    slirp/ip6_input.o
  CC    slirp/ip6_output.o
  CC    slirp/ip_input.o
  CC    slirp/ip_output.o
  CC    slirp/dnssearch.o
  CC    slirp/dhcpv6.o
  CC    slirp/slirp.o
  CC    slirp/mbuf.o
  CC    slirp/misc.o
  CC    slirp/sbuf.o
  CC    slirp/socket.o
  CC    slirp/tcp_input.o
  CC    slirp/tcp_output.o
/tmp/qemu-test/src/slirp/tcp_input.c: In function ‘tcp_input’:
/tmp/qemu-test/src/slirp/tcp_input.c:219: warning: ‘save_ip.ip_p’ may be used uninitialized in this function
/tmp/qemu-test/src/slirp/tcp_input.c:219: warning: ‘save_ip.ip_len’ may be used uninitialized in this function
/tmp/qemu-test/src/slirp/tcp_input.c:219: warning: ‘save_ip.ip_tos’ may be used uninitialized in this function
/tmp/qemu-test/src/slirp/tcp_input.c:219: warning: ‘save_ip.ip_id’ may be used uninitialized in this function
/tmp/qemu-test/src/slirp/tcp_input.c:219: warning: ‘save_ip.ip_off’ may be used uninitialized in this function
/tmp/qemu-test/src/slirp/tcp_input.c:219: warning: ‘save_ip.ip_ttl’ may be used uninitialized in this function
/tmp/qemu-test/src/slirp/tcp_input.c:219: warning: ‘save_ip.ip_sum’ may be used uninitialized in this function
/tmp/qemu-test/src/slirp/tcp_input.c:219: warning: ‘save_ip.ip_src.s_addr’ may be used uninitialized in this function
/tmp/qemu-test/src/slirp/tcp_input.c:219: warning: ‘save_ip.ip_dst.s_addr’ may be used uninitialized in this function
/tmp/qemu-test/src/slirp/tcp_input.c:220: warning: ‘save_ip6.ip_nh’ may be used uninitialized in this function
  CC    slirp/tcp_subr.o
  CC    slirp/tcp_timer.o
/tmp/qemu-test/src/replay/replay-time.c: In function ‘replay_read_clock’:
/tmp/qemu-test/src/replay/replay-time.c:63: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/replay/replay-time.c:63: warning: nested extern declaration of ‘error_report_exit’
/tmp/qemu-test/src/replay/replay-time.c:64: warning: control reaches end of non-void function
  CC    slirp/udp.o
  CC    slirp/udp6.o
  CC    slirp/bootp.o
/tmp/qemu-test/src/hw/pci/pci.c: In function ‘pci_nic_init_nofail’:
/tmp/qemu-test/src/hw/pci/pci.c:1800: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/hw/pci/pci.c:1800: warning: nested extern declaration of ‘error_report_exit’
/tmp/qemu-test/src/hw/pci/pci.c:1786: warning: ‘devfn’ may be used uninitialized in this function
/tmp/qemu-test/src/replay/replay.c: In function ‘replay_configure’:
/tmp/qemu-test/src/replay/replay.c:284: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/replay/replay.c:284: warning: nested extern declaration of ‘error_report_exit’
  CC    slirp/tftp.o
  CC    slirp/arp_table.o
  CC    slirp/ndp_table.o
  CC    ui/keymaps.o
  CC    ui/console.o
/tmp/qemu-test/src/replay/replay-internal.c: In function ‘replay_put_array’:
/tmp/qemu-test/src/replay/replay-internal.c:68: warning: ignoring return value of ‘fwrite’, declared with attribute warn_unused_result
/tmp/qemu-test/src/replay/replay-internal.c: In function ‘replay_fetch_data_kind’:
/tmp/qemu-test/src/replay/replay-internal.c:161: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/replay/replay-internal.c:161: warning: nested extern declaration of ‘error_report_exit’
  CC    ui/cursor.o
  CC    ui/qemu-pixman.o
  CC    ui/input-keymap.o
  CC    ui/input.o
  CC    ui/input-legacy.o
  CC    ui/input-linux.o
  CC    ui/sdl.o
  CC    ui/sdl_zoom.o
  CC    ui/x_keymap.o
  CC    ui/vnc.o
  CC    ui/vnc-enc-zlib.o
  CC    ui/vnc-enc-hextile.o
  CC    ui/vnc-enc-tight.o
  CC    ui/vnc-palette.o
  CC    ui/vnc-auth-vencrypt.o
  CC    ui/vnc-enc-zrle.o
/tmp/qemu-test/src/replay/replay-char.c: In function ‘replay_char_write_event_load’:
/tmp/qemu-test/src/replay/replay-char.c:118: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/replay/replay-char.c:118: warning: nested extern declaration of ‘error_report_exit’
/tmp/qemu-test/src/replay/replay-char.c: In function ‘replay_char_read_all_load’:
/tmp/qemu-test/src/replay/replay-char.c:143: warning: control reaches end of non-void function
  CC    ui/vnc-ws.o
  CC    ui/vnc-jobs.o
  LINK  tests/qemu-iotests/socket_scm_helper
/tmp/qemu-test/src/replay/replay-events.c: In function ‘replay_run_event’:
/tmp/qemu-test/src/replay/replay-events.c:58: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/replay/replay-events.c:58: warning: nested extern declaration of ‘error_report_exit’
  CC    qga/commands.o
  CC    qga/guest-agent-command-state.o
  CC    qga/main.o
  CC    qga/commands-posix.o
  CC    qga/channel-posix.o
  CC    qga/qapi-generated/qga-qapi-types.o
  CC    qga/qapi-generated/qga-qapi-visit.o
  CC    qga/qapi-generated/qga-qmp-marshal.o
  CC    qmp-introspect.o
  CC    qapi-visit.o
  CC    qapi-types.o
  CC    qapi-event.o
  AR    libqemustub.a
  CC    qemu-img.o
  CC    qmp-marshal.o
  AS    optionrom/multiboot.o
  AS    optionrom/linuxboot.o
  CC    optionrom/linuxboot_dma.o
  CC    trace/generated-events.o
cc: unrecognized option '-no-integrated-as'
cc: unrecognized option '-no-integrated-as'
  AS    optionrom/kvmvapic.o
  Building optionrom/linuxboot.img
  Building optionrom/linuxboot_dma.img
  Building optionrom/linuxboot.raw
  Building optionrom/linuxboot_dma.raw
  Signing optionrom/linuxboot.bin
  Signing optionrom/linuxboot_dma.bin
  Building optionrom/multiboot.img
  Building optionrom/multiboot.raw
  Signing optionrom/multiboot.bin
  AR    libqemuutil.a
  Building optionrom/kvmvapic.img
  Building optionrom/kvmvapic.raw
  Signing optionrom/kvmvapic.bin
  LINK  qemu-ga
  LINK  ivshmem-client
  LINK  ivshmem-server
  LINK  qemu-nbd
  LINK  qemu-io
  LINK  qemu-bridge-helper
libqemuutil.a(control.o): In function `trace_init_events':
/tmp/qemu-test/src/trace/control.c:210: undefined reference to `error_report_exit'
/tmp/qemu-test/src/trace/control.c:195: undefined reference to `error_report_exit'
collect2: ld returned 1 exit status
make: *** [ivshmem-server] Error 1
make: *** Waiting for unfinished jobs....
libqemuutil.a(control.o): In function `trace_init_events':
/tmp/qemu-test/src/trace/control.c:210: undefined reference to `error_report_exit'
/tmp/qemu-test/src/trace/control.c:195: undefined reference to `error_report_exit'
collect2: ld returned 1 exit status
make: *** [qemu-ga] Error 1
qemu-io.o: In function `main':
/tmp/qemu-test/src/qemu-io.c:491: undefined reference to `error_report_exit'
/tmp/qemu-test/src/qemu-io.c:511: undefined reference to `error_report_exit'
/tmp/qemu-test/src/qemu-io.c:547: undefined reference to `error_report_exit'
libqemuutil.a(control.o): In function `trace_init_events':
/tmp/qemu-test/src/trace/control.c:210: undefined reference to `error_report_exit'
/tmp/qemu-test/src/trace/control.c:195: undefined reference to `error_report_exit'
collect2: ld returned 1 exit status
make: *** [qemu-io] Error 1
qemu-nbd.o: In function `main':
/tmp/qemu-test/src/qemu-nbd.c:682: undefined reference to `error_report_exit'
/tmp/qemu-test/src/qemu-nbd.c:594: undefined reference to `error_report_exit'
/tmp/qemu-test/src/qemu-nbd.c:577: undefined reference to `error_report_exit'
/tmp/qemu-test/src/qemu-nbd.c:568: undefined reference to `error_report_exit'
/tmp/qemu-test/src/qemu-nbd.c:611: undefined reference to `error_report_exit'
qemu-nbd.o:/tmp/qemu-test/src/qemu-nbd.c:555: more undefined references to `error_report_exit' follow
collect2: ld returned 1 exit status
make: *** [qemu-nbd] Error 1
/tmp/qemu-test/src/qemu-img.c: In function ‘dump_map_entry’:
/tmp/qemu-test/src/qemu-img.c:2418: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/qemu-img.c:2418: warning: nested extern declaration of ‘error_report_exit’
  GEN   x86_64-softmmu/hmp-commands.h
  GEN   x86_64-softmmu/hmp-commands-info.h
  GEN   x86_64-softmmu/qmp-commands-old.h
  GEN   x86_64-softmmu/config-target.h
  GEN   aarch64-softmmu/hmp-commands.h
  GEN   aarch64-softmmu/hmp-commands-info.h
  GEN   aarch64-softmmu/qmp-commands-old.h
  GEN   aarch64-softmmu/config-target.h
  CC    x86_64-softmmu/exec.o
  CC    x86_64-softmmu/translate-all.o
  CC    x86_64-softmmu/cpu-exec.o
  CC    x86_64-softmmu/translate-common.o
  CC    x86_64-softmmu/cpu-exec-common.o
  CC    x86_64-softmmu/tcg/tcg.o
  CC    x86_64-softmmu/tcg/tcg-op.o
  CC    x86_64-softmmu/tcg/optimize.o
  CC    x86_64-softmmu/tcg/tcg-common.o
  CC    x86_64-softmmu/fpu/softfloat.o
  CC    x86_64-softmmu/disas.o
  CC    x86_64-softmmu/arch_init.o
  CC    x86_64-softmmu/cpus.o
  CC    x86_64-softmmu/monitor.o
  CC    x86_64-softmmu/gdbstub.o
  CC    x86_64-softmmu/balloon.o
  CC    x86_64-softmmu/ioport.o
  CC    x86_64-softmmu/numa.o
  CC    x86_64-softmmu/qtest.o
  CC    x86_64-softmmu/bootdevice.o
  CC    x86_64-softmmu/kvm-all.o
  CC    x86_64-softmmu/memory.o
  CC    x86_64-softmmu/cputlb.o
  CC    aarch64-softmmu/exec.o
  CC    x86_64-softmmu/memory_mapping.o
  CC    x86_64-softmmu/dump.o
  CC    x86_64-softmmu/migration/ram.o
  CC    x86_64-softmmu/migration/savevm.o
  CC    aarch64-softmmu/translate-all.o
  CC    aarch64-softmmu/cpu-exec.o
  CC    x86_64-softmmu/xen-common-stub.o
  CC    aarch64-softmmu/translate-common.o
  CC    x86_64-softmmu/xen-hvm-stub.o
  CC    aarch64-softmmu/cpu-exec-common.o
  CC    x86_64-softmmu/hw/acpi/nvdimm.o
  CC    aarch64-softmmu/tcg/tcg.o
  CC    x86_64-softmmu/hw/block/virtio-blk.o
  CC    aarch64-softmmu/tcg/tcg-op.o
  CC    x86_64-softmmu/hw/block/dataplane/virtio-blk.o
  CC    aarch64-softmmu/tcg/optimize.o
  CC    aarch64-softmmu/tcg/tcg-common.o
  CC    aarch64-softmmu/fpu/softfloat.o
  CC    x86_64-softmmu/hw/char/virtio-serial-bus.o
  CC    x86_64-softmmu/hw/core/nmi.o
  CC    aarch64-softmmu/disas.o
  CC    x86_64-softmmu/hw/cpu/core.o
  GEN   aarch64-softmmu/gdbstub-xml.c
  CC    aarch64-softmmu/kvm-stub.o
  CC    aarch64-softmmu/arch_init.o
  CC    x86_64-softmmu/hw/display/vga.o
  CC    aarch64-softmmu/cpus.o
/tmp/qemu-test/src/bootdevice.c: In function ‘add_boot_device_path’:
/tmp/qemu-test/src/bootdevice.c:175: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/bootdevice.c:175: warning: nested extern declaration of ‘error_report_exit’
/tmp/qemu-test/src/arch_init.c: In function ‘audio_init’:
/tmp/qemu-test/src/arch_init.c:223: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/arch_init.c:223: warning: nested extern declaration of ‘error_report_exit’
  CC    x86_64-softmmu/hw/display/virtio-gpu.o
  CC    x86_64-softmmu/hw/display/virtio-gpu-3d.o
  CC    aarch64-softmmu/monitor.o
  CC    x86_64-softmmu/hw/display/virtio-gpu-pci.o
  CC    aarch64-softmmu/gdbstub.o
  CC    x86_64-softmmu/hw/display/virtio-vga.o
  CC    aarch64-softmmu/balloon.o
  CC    x86_64-softmmu/hw/intc/apic.o
  CC    x86_64-softmmu/hw/intc/apic_common.o
  CC    aarch64-softmmu/ioport.o
  CC    aarch64-softmmu/numa.o
  CC    x86_64-softmmu/hw/intc/ioapic.o
  CC    aarch64-softmmu/qtest.o
/tmp/qemu-test/src/numa.c: In function ‘validate_numa_cpus’:
/tmp/qemu-test/src/numa.c:277: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/numa.c:277: warning: nested extern declaration of ‘error_report_exit’
  CC    x86_64-softmmu/hw/isa/lpc_ich9.o
  CC    aarch64-softmmu/bootdevice.o
  CC    aarch64-softmmu/memory.o
  CC    aarch64-softmmu/cputlb.o
  CC    aarch64-softmmu/memory_mapping.o
/tmp/qemu-test/src/cpus.c: In function ‘qemu_kvm_destroy_vcpu’:
/tmp/qemu-test/src/cpus.c:978: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/cpus.c:978: warning: nested extern declaration of ‘error_report_exit’
  CC    x86_64-softmmu/hw/misc/vmport.o
  CC    aarch64-softmmu/dump.o
  CC    aarch64-softmmu/migration/ram.o
  CC    aarch64-softmmu/migration/savevm.o
  CC    aarch64-softmmu/xen-common-stub.o
  CC    x86_64-softmmu/hw/misc/ivshmem.o
  CC    x86_64-softmmu/hw/misc/pvpanic.o
  CC    x86_64-softmmu/hw/misc/edu.o
  CC    aarch64-softmmu/xen-hvm-stub.o
  CC    aarch64-softmmu/hw/block/virtio-blk.o
/tmp/qemu-test/src/arch_init.c: In function ‘audio_init’:
/tmp/qemu-test/src/arch_init.c:223: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/arch_init.c:223: warning: nested extern declaration of ‘error_report_exit’
  CC    aarch64-softmmu/hw/block/dataplane/virtio-blk.o
  CC    aarch64-softmmu/hw/char/exynos4210_uart.o
  CC    aarch64-softmmu/hw/char/omap_uart.o
  CC    aarch64-softmmu/hw/char/digic-uart.o
  CC    x86_64-softmmu/hw/misc/hyperv_testdev.o
  CC    x86_64-softmmu/hw/net/virtio-net.o
/tmp/qemu-test/src/numa.c: In function ‘validate_numa_cpus’:
/tmp/qemu-test/src/numa.c:277: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/numa.c:277: warning: nested extern declaration of ‘error_report_exit’
  CC    aarch64-softmmu/hw/char/stm32f2xx_usart.o
  CC    aarch64-softmmu/hw/char/bcm2835_aux.o
  CC    aarch64-softmmu/hw/char/virtio-serial-bus.o
/tmp/qemu-test/src/bootdevice.c: In function ‘add_boot_device_path’:
/tmp/qemu-test/src/bootdevice.c:175: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/bootdevice.c:175: warning: nested extern declaration of ‘error_report_exit’
  CC    aarch64-softmmu/hw/core/nmi.o
/tmp/qemu-test/src/hw/intc/ioapic.c: In function ‘ioapic_realize’:
/tmp/qemu-test/src/hw/intc/ioapic.c:403: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/hw/intc/ioapic.c:403: warning: nested extern declaration of ‘error_report_exit’
  CC    x86_64-softmmu/hw/net/vhost_net.o
  CC    aarch64-softmmu/hw/cpu/arm11mpcore.o
  CC    aarch64-softmmu/hw/cpu/realview_mpcore.o
  CC    aarch64-softmmu/hw/cpu/a9mpcore.o
  CC    aarch64-softmmu/hw/cpu/a15mpcore.o
  CC    aarch64-softmmu/hw/cpu/core.o
  CC    aarch64-softmmu/hw/display/omap_dss.o
/tmp/qemu-test/src/cpus.c: In function ‘qemu_kvm_destroy_vcpu’:
/tmp/qemu-test/src/cpus.c:978: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/cpus.c:978: warning: nested extern declaration of ‘error_report_exit’
  CC    aarch64-softmmu/hw/display/omap_lcdc.o
  CC    aarch64-softmmu/hw/display/pxa2xx_lcd.o
  CC    x86_64-softmmu/hw/scsi/virtio-scsi.o
  CC    x86_64-softmmu/hw/scsi/virtio-scsi-dataplane.o
/tmp/qemu-test/src/hw/block/virtio-blk.c: In function ‘virtio_blk_handle_request’:
/tmp/qemu-test/src/hw/block/virtio-blk.c:480: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/hw/block/virtio-blk.c:480: warning: nested extern declaration of ‘error_report_exit’
  CC    aarch64-softmmu/hw/display/bcm2835_fb.o
  CC    aarch64-softmmu/hw/display/vga.o
  CC    aarch64-softmmu/hw/display/virtio-gpu.o
  CC    x86_64-softmmu/hw/scsi/vhost-scsi.o
  CC    aarch64-softmmu/hw/display/virtio-gpu-3d.o
  CC    aarch64-softmmu/hw/display/virtio-gpu-pci.o
  CC    x86_64-softmmu/hw/timer/mc146818rtc.o
/tmp/qemu-test/src/hw/char/exynos4210_uart.c: In function ‘exynos4210_uart_create’:
/tmp/qemu-test/src/hw/char/exynos4210_uart.c:600: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/hw/char/exynos4210_uart.c:600: warning: nested extern declaration of ‘error_report_exit’
  CC    x86_64-softmmu/hw/vfio/common.o
  CC    x86_64-softmmu/hw/vfio/pci.o
  CC    x86_64-softmmu/hw/vfio/pci-quirks.o
  CC    x86_64-softmmu/hw/vfio/platform.o
  CC    x86_64-softmmu/hw/vfio/calxeda-xgmac.o
  CC    x86_64-softmmu/hw/vfio/amd-xgbe.o
  CC    x86_64-softmmu/hw/vfio/spapr.o
  CC    aarch64-softmmu/hw/display/dpcd.o
  CC    aarch64-softmmu/hw/display/xlnx_dp.o
  CC    aarch64-softmmu/hw/dma/xlnx_dpdma.o
  CC    x86_64-softmmu/hw/virtio/virtio.o
  CC    x86_64-softmmu/hw/virtio/virtio-balloon.o
  CC    x86_64-softmmu/hw/virtio/vhost.o
  CC    aarch64-softmmu/hw/dma/omap_dma.o
  CC    aarch64-softmmu/hw/dma/soc_dma.o
  CC    x86_64-softmmu/hw/virtio/vhost-backend.o
  CC    x86_64-softmmu/hw/virtio/vhost-user.o
  CC    x86_64-softmmu/hw/i386/multiboot.o
  CC    x86_64-softmmu/hw/i386/pc.o
  CC    x86_64-softmmu/hw/i386/pc_piix.o
  CC    x86_64-softmmu/hw/i386/pc_q35.o
  CC    x86_64-softmmu/hw/i386/pc_sysfw.o
  CC    x86_64-softmmu/hw/i386/x86-iommu.o
/tmp/qemu-test/src/hw/scsi/vhost-scsi.c: In function ‘vhost_scsi_set_config’:
/tmp/qemu-test/src/hw/scsi/vhost-scsi.c:174: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/hw/scsi/vhost-scsi.c:174: warning: nested extern declaration of ‘error_report_exit’
  CC    aarch64-softmmu/hw/dma/pxa2xx_dma.o
  CC    aarch64-softmmu/hw/dma/bcm2835_dma.o
  CC    aarch64-softmmu/hw/gpio/omap_gpio.o
  CC    aarch64-softmmu/hw/gpio/imx_gpio.o
/tmp/qemu-test/src/hw/net/virtio-net.c: In function ‘virtio_net_handle_ctrl’:
/tmp/qemu-test/src/hw/net/virtio-net.c:895: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/hw/net/virtio-net.c:895: warning: nested extern declaration of ‘error_report_exit’
  CC    aarch64-softmmu/hw/i2c/omap_i2c.o
  CC    aarch64-softmmu/hw/input/pxa2xx_keypad.o
  CC    aarch64-softmmu/hw/input/tsc210x.o
/tmp/qemu-test/src/hw/scsi/virtio-scsi.c: In function ‘virtio_scsi_bad_req’:
/tmp/qemu-test/src/hw/scsi/virtio-scsi.c:86: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/hw/scsi/virtio-scsi.c:86: warning: nested extern declaration of ‘error_report_exit’
  CC    x86_64-softmmu/hw/i386/intel_iommu.o
  CC    aarch64-softmmu/hw/intc/armv7m_nvic.o
  CC    x86_64-softmmu/hw/i386/kvmvapic.o
  CC    aarch64-softmmu/hw/intc/exynos4210_gic.o
  CC    aarch64-softmmu/hw/intc/exynos4210_combiner.o
  CC    aarch64-softmmu/hw/intc/omap_intc.o
  CC    aarch64-softmmu/hw/intc/bcm2835_ic.o
  CC    aarch64-softmmu/hw/intc/bcm2836_control.o
  CC    aarch64-softmmu/hw/intc/allwinner-a10-pic.o
  CC    aarch64-softmmu/hw/intc/aspeed_vic.o
  CC    aarch64-softmmu/hw/intc/arm_gicv3_cpuif.o
/tmp/qemu-test/src/hw/block/virtio-blk.c: In function ‘virtio_blk_handle_request’:
/tmp/qemu-test/src/hw/block/virtio-blk.c:480: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/hw/block/virtio-blk.c:480: warning: nested extern declaration of ‘error_report_exit’
  CC    aarch64-softmmu/hw/misc/ivshmem.o
  CC    x86_64-softmmu/hw/i386/acpi-build.o
  CC    aarch64-softmmu/hw/misc/arm_sysctl.o
  CC    x86_64-softmmu/hw/i386/pci-assign-load-rom.o
/tmp/qemu-test/src/hw/i386/acpi-build.c: In function ‘build_append_pci_bus_devices’:
/tmp/qemu-test/src/hw/i386/acpi-build.c:471: warning: ‘notify_method’ may be used uninitialized in this function
  CC    aarch64-softmmu/hw/misc/cbus.o
  CC    aarch64-softmmu/hw/misc/exynos4210_pmu.o
  CC    x86_64-softmmu/hw/i386/kvm/clock.o
  CC    aarch64-softmmu/hw/misc/imx_ccm.o
  CC    x86_64-softmmu/hw/i386/kvm/apic.o
  CC    aarch64-softmmu/hw/misc/imx31_ccm.o
  CC    aarch64-softmmu/hw/misc/imx25_ccm.o
  CC    x86_64-softmmu/hw/i386/kvm/i8259.o
  CC    x86_64-softmmu/hw/i386/kvm/ioapic.o
  CC    aarch64-softmmu/hw/misc/imx6_ccm.o
  CC    x86_64-softmmu/hw/i386/kvm/i8254.o
  CC    x86_64-softmmu/hw/i386/kvm/pci-assign.o
  CC    aarch64-softmmu/hw/misc/imx6_src.o
  CC    x86_64-softmmu/target-i386/translate.o
  CC    x86_64-softmmu/target-i386/helper.o
/tmp/qemu-test/src/hw/i386/x86-iommu.c: In function ‘x86_iommu_set_default’:
/tmp/qemu-test/src/hw/i386/x86-iommu.c:61: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/hw/i386/x86-iommu.c:61: warning: nested extern declaration of ‘error_report_exit’
  CC    x86_64-softmmu/target-i386/cpu.o
  CC    aarch64-softmmu/hw/misc/mst_fpga.o
  CC    x86_64-softmmu/target-i386/bpt_helper.o
  CC    aarch64-softmmu/hw/misc/omap_clk.o
  CC    aarch64-softmmu/hw/misc/omap_gpmc.o
  CC    aarch64-softmmu/hw/misc/omap_l4.o
  CC    x86_64-softmmu/target-i386/excp_helper.o
  CC    x86_64-softmmu/target-i386/fpu_helper.o
  CC    aarch64-softmmu/hw/misc/omap_sdrc.o
  CC    aarch64-softmmu/hw/misc/omap_tap.o
  CC    aarch64-softmmu/hw/misc/bcm2835_mbox.o
  CC    x86_64-softmmu/target-i386/cc_helper.o
  CC    x86_64-softmmu/target-i386/int_helper.o
  CC    aarch64-softmmu/hw/misc/bcm2835_property.o
/tmp/qemu-test/src/hw/i386/pc.c: In function ‘pc_cpus_init’:
/tmp/qemu-test/src/hw/i386/pc.c:1171: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/hw/i386/pc.c:1171: warning: nested extern declaration of ‘error_report_exit’
  CC    aarch64-softmmu/hw/misc/zynq_slcr.o
  CC    x86_64-softmmu/target-i386/svm_helper.o
  CC    x86_64-softmmu/target-i386/smm_helper.o
  CC    aarch64-softmmu/hw/misc/zynq-xadc.o
  CC    x86_64-softmmu/target-i386/misc_helper.o
  CC    x86_64-softmmu/target-i386/mem_helper.o
  CC    aarch64-softmmu/hw/misc/stm32f2xx_syscfg.o
  CC    x86_64-softmmu/target-i386/seg_helper.o
/tmp/qemu-test/src/hw/i386/pc_piix.c: In function ‘igd_passthrough_isa_bridge_create’:
/tmp/qemu-test/src/hw/i386/pc_piix.c:1036: warning: ‘pch_rev_id’ may be used uninitialized in this function
  CC    aarch64-softmmu/hw/misc/edu.o
  CC    aarch64-softmmu/hw/misc/auxbus.o
  CC    x86_64-softmmu/target-i386/mpx_helper.o
  CC    x86_64-softmmu/target-i386/gdbstub.o
  CC    x86_64-softmmu/target-i386/machine.o
  CC    aarch64-softmmu/hw/misc/aspeed_scu.o
  CC    aarch64-softmmu/hw/net/virtio-net.o
  CC    aarch64-softmmu/hw/net/vhost_net.o
  CC    aarch64-softmmu/hw/pcmcia/pxa2xx.o
  CC    x86_64-softmmu/target-i386/arch_memory_mapping.o
  CC    x86_64-softmmu/target-i386/arch_dump.o
  CC    x86_64-softmmu/target-i386/monitor.o
  CC    aarch64-softmmu/hw/scsi/virtio-scsi.o
  CC    x86_64-softmmu/target-i386/kvm.o
  CC    aarch64-softmmu/hw/scsi/virtio-scsi-dataplane.o
  CC    aarch64-softmmu/hw/scsi/vhost-scsi.o
/tmp/qemu-test/src/hw/i386/intel_iommu.c: In function ‘vtd_realize’:
/tmp/qemu-test/src/hw/i386/intel_iommu.c:2474: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/hw/i386/intel_iommu.c:2474: warning: nested extern declaration of ‘error_report_exit’
  CC    aarch64-softmmu/hw/sd/omap_mmc.o
  CC    aarch64-softmmu/hw/sd/pxa2xx_mmci.o
  CC    aarch64-softmmu/hw/ssi/omap_spi.o
/tmp/qemu-test/src/hw/virtio/virtio.c: In function ‘virtqueue_num_heads’:
/tmp/qemu-test/src/hw/virtio/virtio.c:317: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/hw/virtio/virtio.c:317: warning: nested extern declaration of ‘error_report_exit’
  CC    aarch64-softmmu/hw/ssi/imx_spi.o
  CC    aarch64-softmmu/hw/timer/exynos4210_mct.o
  CC    aarch64-softmmu/hw/timer/exynos4210_pwm.o
  CC    aarch64-softmmu/hw/timer/exynos4210_rtc.o
  CC    aarch64-softmmu/hw/timer/omap_gptimer.o
  CC    aarch64-softmmu/hw/timer/omap_synctimer.o
  CC    x86_64-softmmu/target-i386/hyperv.o
  CC    aarch64-softmmu/hw/timer/pxa2xx_timer.o
  CC    aarch64-softmmu/hw/timer/digic-timer.o
  CC    aarch64-softmmu/hw/timer/allwinner-a10-pit.o
  CC    aarch64-softmmu/hw/usb/tusb6010.o
  GEN   trace/generated-helpers.c
  CC    aarch64-softmmu/hw/vfio/common.o
  CC    x86_64-softmmu/trace/control-target.o
  CC    aarch64-softmmu/hw/vfio/pci.o
  CC    aarch64-softmmu/hw/vfio/pci-quirks.o
  CC    aarch64-softmmu/hw/vfio/platform.o
  CC    aarch64-softmmu/hw/vfio/calxeda-xgmac.o
  CC    aarch64-softmmu/hw/vfio/amd-xgbe.o
  CC    aarch64-softmmu/hw/vfio/spapr.o
  CC    aarch64-softmmu/hw/virtio/virtio.o
  CC    aarch64-softmmu/hw/virtio/virtio-balloon.o
  CC    aarch64-softmmu/hw/virtio/vhost.o
  CC    aarch64-softmmu/hw/virtio/vhost-backend.o
  CC    aarch64-softmmu/hw/virtio/vhost-user.o
  CC    aarch64-softmmu/hw/arm/boot.o
  CC    aarch64-softmmu/hw/arm/collie.o
/tmp/qemu-test/src/hw/scsi/vhost-scsi.c: In function ‘vhost_scsi_set_config’:
/tmp/qemu-test/src/hw/scsi/vhost-scsi.c:174: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/hw/scsi/vhost-scsi.c:174: warning: nested extern declaration of ‘error_report_exit’
  CC    aarch64-softmmu/hw/arm/exynos4_boards.o
  CC    aarch64-softmmu/hw/arm/gumstix.o
  CC    x86_64-softmmu/trace/generated-helpers.o
  CC    aarch64-softmmu/hw/arm/highbank.o
  CC    aarch64-softmmu/hw/arm/digic_boards.o
  CC    aarch64-softmmu/hw/arm/integratorcp.o
  CC    aarch64-softmmu/hw/arm/mainstone.o
  CC    aarch64-softmmu/hw/arm/musicpal.o
  CC    aarch64-softmmu/hw/arm/nseries.o
  CC    aarch64-softmmu/hw/arm/omap_sx1.o
  CC    aarch64-softmmu/hw/arm/palm.o
/tmp/qemu-test/src/hw/scsi/virtio-scsi.c: In function ‘virtio_scsi_bad_req’:
/tmp/qemu-test/src/hw/scsi/virtio-scsi.c:86: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/hw/scsi/virtio-scsi.c:86: warning: nested extern declaration of ‘error_report_exit’
  CC    aarch64-softmmu/hw/arm/realview.o
  CC    aarch64-softmmu/hw/arm/spitz.o
  CC    aarch64-softmmu/hw/arm/stellaris.o
  CC    aarch64-softmmu/hw/arm/tosa.o
  CC    aarch64-softmmu/hw/arm/versatilepb.o
  CC    aarch64-softmmu/hw/arm/vexpress.o
  CC    aarch64-softmmu/hw/arm/virt.o
  CC    aarch64-softmmu/hw/arm/xilinx_zynq.o
  CC    aarch64-softmmu/hw/arm/z2.o
  CC    aarch64-softmmu/hw/arm/virt-acpi-build.o
  CC    aarch64-softmmu/hw/arm/netduino2.o
/tmp/qemu-test/src/hw/net/virtio-net.c: In function ‘virtio_net_handle_ctrl’:
/tmp/qemu-test/src/hw/net/virtio-net.c:895: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/hw/net/virtio-net.c:895: warning: nested extern declaration of ‘error_report_exit’
  CC    aarch64-softmmu/hw/arm/sysbus-fdt.o
  CC    aarch64-softmmu/hw/arm/armv7m.o
/tmp/qemu-test/src/hw/arm/digic_boards.c: In function ‘digic_load_rom’:
/tmp/qemu-test/src/hw/arm/digic_boards.c:109: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/hw/arm/digic_boards.c:109: warning: nested extern declaration of ‘error_report_exit’
  CC    aarch64-softmmu/hw/arm/exynos4210.o
  CC    aarch64-softmmu/hw/arm/pxa2xx.o
  CC    aarch64-softmmu/hw/arm/pxa2xx_gpio.o
  CC    aarch64-softmmu/hw/arm/pxa2xx_pic.o
/tmp/qemu-test/src/hw/arm/highbank.c: In function ‘calxeda_init’:
/tmp/qemu-test/src/hw/arm/highbank.c:286: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/hw/arm/highbank.c:286: warning: nested extern declaration of ‘error_report_exit’
  CC    aarch64-softmmu/hw/arm/digic.o
  CC    aarch64-softmmu/hw/arm/omap1.o
  CC    aarch64-softmmu/hw/arm/omap2.o
  CC    aarch64-softmmu/hw/arm/strongarm.o
  CC    aarch64-softmmu/hw/arm/allwinner-a10.o
  CC    aarch64-softmmu/hw/arm/cubieboard.o
/tmp/qemu-test/src/hw/arm/vexpress.c: In function ‘vexpress_common_init’:
/tmp/qemu-test/src/hw/arm/vexpress.c:571: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/hw/arm/vexpress.c:571: warning: nested extern declaration of ‘error_report_exit’
  CC    aarch64-softmmu/hw/arm/bcm2835_peripherals.o
  CC    aarch64-softmmu/hw/arm/bcm2836.o
  CC    aarch64-softmmu/hw/arm/raspi.o
  CC    aarch64-softmmu/hw/arm/stm32f205_soc.o
/tmp/qemu-test/src/hw/arm/armv7m.c: In function ‘armv7m_init’:
/tmp/qemu-test/src/hw/arm/armv7m.c:223: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/hw/arm/armv7m.c:223: warning: nested extern declaration of ‘error_report_exit’
  CC    aarch64-softmmu/hw/arm/xlnx-zynqmp.o
  CC    aarch64-softmmu/hw/arm/xlnx-ep108.o
  CC    aarch64-softmmu/hw/arm/fsl-imx25.o
  CC    aarch64-softmmu/hw/arm/imx25_pdk.o
/tmp/qemu-test/src/hw/virtio/virtio.c: In function ‘virtqueue_num_heads’:
/tmp/qemu-test/src/hw/virtio/virtio.c:317: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/hw/virtio/virtio.c:317: warning: nested extern declaration of ‘error_report_exit’
  CC    aarch64-softmmu/hw/arm/fsl-imx31.o
  CC    aarch64-softmmu/hw/arm/kzm.o
  CC    aarch64-softmmu/hw/arm/fsl-imx6.o
/tmp/qemu-test/src/hw/arm/sysbus-fdt.c: In function ‘add_fdt_node’:
/tmp/qemu-test/src/hw/arm/sysbus-fdt.c:451: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/hw/arm/sysbus-fdt.c:451: warning: nested extern declaration of ‘error_report_exit’
/tmp/qemu-test/src/hw/arm/sysbus-fdt.c:453: warning: control reaches end of non-void function
  CC    aarch64-softmmu/hw/arm/sabrelite.o
  CC    aarch64-softmmu/hw/arm/ast2400.o
  CC    aarch64-softmmu/hw/arm/palmetto-bmc.o
  CC    aarch64-softmmu/target-arm/arm-semi.o
  CC    aarch64-softmmu/target-arm/machine.o
/tmp/qemu-test/src/hw/arm/virt.c: In function ‘create_fdt’:
/tmp/qemu-test/src/hw/arm/virt.c:243: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/hw/arm/virt.c:243: warning: nested extern declaration of ‘error_report_exit’
/tmp/qemu-test/src/target-i386/kvm.c: In function ‘kvm_arch_init_irq_routing’:
/tmp/qemu-test/src/target-i386/kvm.c:3240: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/target-i386/kvm.c:3240: warning: nested extern declaration of ‘error_report_exit’
/tmp/qemu-test/src/target-i386/kvm.c: In function ‘kvm_arch_irqchip_create’:
/tmp/qemu-test/src/target-i386/kvm.c:3262: warning: control reaches end of non-void function
  CC    aarch64-softmmu/target-arm/psci.o
  LINK  x86_64-softmmu/qemu-system-x86_64
  CC    aarch64-softmmu/target-arm/arch_dump.o
  CC    aarch64-softmmu/target-arm/monitor.o
  CC    aarch64-softmmu/target-arm/kvm-stub.o
  CC    aarch64-softmmu/target-arm/translate.o
  CC    aarch64-softmmu/target-arm/op_helper.o
  CC    aarch64-softmmu/target-arm/helper.o
/tmp/qemu-test/src/hw/arm/raspi.c: In function ‘setup_boot’:
/tmp/qemu-test/src/hw/arm/raspi.c:101: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/hw/arm/raspi.c:101: warning: nested extern declaration of ‘error_report_exit’
  CC    aarch64-softmmu/target-arm/cpu.o
/tmp/qemu-test/src/hw/arm/xlnx-ep108.c: In function ‘xlnx_ep108_init’:
/tmp/qemu-test/src/hw/arm/xlnx-ep108.c:43: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/hw/arm/xlnx-ep108.c:43: warning: nested extern declaration of ‘error_report_exit’
  CC    aarch64-softmmu/target-arm/neon_helper.o
  CC    aarch64-softmmu/target-arm/iwmmxt_helper.o
  CC    aarch64-softmmu/target-arm/gdbstub.o
/tmp/qemu-test/src/hw/arm/sabrelite.c: In function ‘sabrelite_init’:
/tmp/qemu-test/src/hw/arm/sabrelite.c:53: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/hw/arm/sabrelite.c:53: warning: nested extern declaration of ‘error_report_exit’
  CC    aarch64-softmmu/target-arm/cpu64.o
  CC    aarch64-softmmu/target-arm/translate-a64.o
  CC    aarch64-softmmu/target-arm/helper-a64.o
  CC    aarch64-softmmu/target-arm/gdbstub64.o
  CC    aarch64-softmmu/target-arm/crypto_helper.o
  CC    aarch64-softmmu/target-arm/arm-powerctl.o
/tmp/qemu-test/src/hw/arm/strongarm.c: In function ‘sa1110_init’:
/tmp/qemu-test/src/hw/arm/strongarm.c:1592: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/hw/arm/strongarm.c:1592: warning: nested extern declaration of ‘error_report_exit’
/tmp/qemu-test/src/hw/arm/fsl-imx6.c: In function ‘fsl_imx6_init’:
/tmp/qemu-test/src/hw/arm/fsl-imx6.c:39: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/hw/arm/fsl-imx6.c:39: warning: nested extern declaration of ‘error_report_exit’
/tmp/qemu-test/src/target-arm/translate-a64.c: In function ‘handle_shri_with_rndacc’:
/tmp/qemu-test/src/target-arm/translate-a64.c:6308: warning: ‘tcg_src_hi’ may be used uninitialized in this function
/tmp/qemu-test/src/target-arm/translate-a64.c: In function ‘disas_simd_scalar_two_reg_misc’:
/tmp/qemu-test/src/target-arm/translate-a64.c:8035: warning: ‘rmode’ may be used uninitialized in this function
  GEN   trace/generated-helpers.c
  CC    aarch64-softmmu/trace/control-target.o
  CC    aarch64-softmmu/gdbstub-xml.o
  CC    aarch64-softmmu/trace/generated-helpers.o
  LINK  aarch64-softmmu/qemu-system-aarch64
arch_init.o: In function `audio_init':
/tmp/qemu-test/src/arch_init.c:223: undefined reference to `error_report_exit'
/tmp/qemu-test/src/arch_init.c:228: undefined reference to `error_report_exit'
cpus.o: In function `qemu_kvm_destroy_vcpu':
/tmp/qemu-test/src/cpus.c:978: undefined reference to `error_report_exit'
numa.o: In function `memory_region_allocate_system_memory':
/tmp/qemu-test/src/numa.c:458: undefined reference to `error_report_exit'
numa.o: In function `parse_numa_opts':
/tmp/qemu-test/src/numa.c:309: undefined reference to `error_report_exit'
numa.o:/tmp/qemu-test/src/numa.c:350: more undefined references to `error_report_exit' follow
collect2: ld returned 1 exit status
make[1]: *** [qemu-system-x86_64] Error 1
make: *** [subdir-x86_64-softmmu] Error 2
arch_init.o: In function `audio_init':
/tmp/qemu-test/src/arch_init.c:223: undefined reference to `error_report_exit'
/tmp/qemu-test/src/arch_init.c:228: undefined reference to `error_report_exit'
numa.o: In function `memory_region_allocate_system_memory':
/tmp/qemu-test/src/numa.c:458: undefined reference to `error_report_exit'
numa.o: In function `parse_numa_opts':
/tmp/qemu-test/src/numa.c:309: undefined reference to `error_report_exit'
/tmp/qemu-test/src/numa.c:350: undefined reference to `error_report_exit'
numa.o:/tmp/qemu-test/src/numa.c:277: more undefined references to `error_report_exit' follow
collect2: ld returned 1 exit status
make[1]: *** [qemu-system-aarch64] Error 1
make: *** [subdir-aarch64-softmmu] Error 2
tests/docker/Makefile.include:104: recipe for target 'docker-run-test-quick@centos6' failed
make: *** [docker-run-test-quick@centos6] Error 1
=== OUTPUT END ===

Test command exited with code: 2


---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to patchew-devel@freelists.org
Fam Zheng Aug. 11, 2016, 8:45 a.m. UTC | #2
On Thu, 08/11 16:47, Peter Xu wrote:
> On Thu, Aug 11, 2016 at 01:01:58AM -0700, no-reply@ec2-52-6-146-230.compute-1.amazonaws.com wrote:
> > Hi,
> > 
> > Your series failed automatic build test. Please find the testing commands and
> > their output below. If you have docker installed, you can probably reproduce it
> > locally.
> 
> This fault should be caused by not applying the first patch.
> 

It is preferrable to send full incremental revisions as top level thread
instead of replying individual patches to an old one.

Fam
Peter Xu Aug. 11, 2016, 8:47 a.m. UTC | #3
On Thu, Aug 11, 2016 at 01:01:58AM -0700, no-reply@ec2-52-6-146-230.compute-1.amazonaws.com wrote:
> Hi,
> 
> Your series failed automatic build test. Please find the testing commands and
> their output below. If you have docker installed, you can probably reproduce it
> locally.

This fault should be caused by not applying the first patch.

-- peterx
Peter Xu Aug. 11, 2016, 8:58 a.m. UTC | #4
On Thu, Aug 11, 2016 at 04:45:00PM +0800, Fam Zheng wrote:
> On Thu, 08/11 16:47, Peter Xu wrote:
> > On Thu, Aug 11, 2016 at 01:01:58AM -0700, no-reply@ec2-52-6-146-230.compute-1.amazonaws.com wrote:
> > > Hi,
> > > 
> > > Your series failed automatic build test. Please find the testing commands and
> > > their output below. If you have docker installed, you can probably reproduce it
> > > locally.
> > 
> > This fault should be caused by not applying the first patch.
> > 
> 
> It is preferrable to send full incremental revisions as top level thread
> instead of replying individual patches to an old one.

Okay. Next time will do.
diff mbox

Patch

diff --git a/arch_init.c b/arch_init.c
index fa05973..abb661d 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -220,14 +220,12 @@  void audio_init(void)
         if (c->enabled) {
             if (c->isa) {
                 if (!isa_bus) {
-                    error_report("ISA bus not available for %s", c->name);
-                    exit(1);
+                    error_report_exit("ISA bus not available for %s", c->name);
                 }
                 c->init.init_isa(isa_bus);
             } else {
                 if (!pci_bus) {
-                    error_report("PCI bus not available for %s", c->name);
-                    exit(1);
+                    error_report_exit("PCI bus not available for %s", c->name);
                 }
                 c->init.init_pci(pci_bus);
             }
diff --git a/bootdevice.c b/bootdevice.c
index 33e3029..f493477 100644
--- a/bootdevice.c
+++ b/bootdevice.c
@@ -172,8 +172,8 @@  void add_boot_device_path(int32_t bootindex, DeviceState *dev,
 
     QTAILQ_FOREACH(i, &fw_boot_order, link) {
         if (i->bootindex == bootindex) {
-            error_report("Two devices with same boot index %d", bootindex);
-            exit(1);
+            error_report_exit("Two devices with same boot index %d",
+                              bootindex);
         } else if (i->bootindex < bootindex) {
             continue;
         }
diff --git a/cpus.c b/cpus.c
index 84c3520..66e2a5c 100644
--- a/cpus.c
+++ b/cpus.c
@@ -975,8 +975,7 @@  void async_run_on_cpu(CPUState *cpu, void (*func)(void *data), void *data)
 static void qemu_kvm_destroy_vcpu(CPUState *cpu)
 {
     if (kvm_destroy_vcpu(cpu) < 0) {
-        error_report("kvm_destroy_vcpu failed");
-        exit(EXIT_FAILURE);
+        error_report_exit("kvm_destroy_vcpu failed");
     }
 }
 
diff --git a/device_tree.c b/device_tree.c
index 6e06320..6a924e0 100644
--- a/device_tree.c
+++ b/device_tree.c
@@ -60,14 +60,13 @@  void *create_device_tree(int *sizep)
     }
     ret = fdt_open_into(fdt, fdt, *sizep);
     if (ret) {
-        error_report("Unable to copy device tree in memory");
-        exit(1);
+        error_report_exit("Unable to copy device tree in memory");
     }
 
     return fdt;
 fail:
-    error_report("%s Couldn't create dt: %s", __func__, fdt_strerror(ret));
-    exit(1);
+    error_report_exit("%s Couldn't create dt: %s", __func__,
+                      fdt_strerror(ret));
 }
 
 void *load_device_tree(const char *filename_path, int *sizep)
@@ -220,9 +219,8 @@  static int findnode_nofail(void *fdt, const char *node_path)
 
     offset = fdt_path_offset(fdt, node_path);
     if (offset < 0) {
-        error_report("%s Couldn't find node %s: %s", __func__, node_path,
-                     fdt_strerror(offset));
-        exit(1);
+        error_report_exit("%s Couldn't find node %s: %s", __func__, node_path,
+                          fdt_strerror(offset));
     }
 
     return offset;
@@ -289,9 +287,8 @@  int qemu_fdt_setprop(void *fdt, const char *node_path,
 
     r = fdt_setprop(fdt, findnode_nofail(fdt, node_path), property, val, size);
     if (r < 0) {
-        error_report("%s: Couldn't set %s/%s: %s", __func__, node_path,
-                     property, fdt_strerror(r));
-        exit(1);
+        error_report_exit("%s: Couldn't set %s/%s: %s", __func__, node_path,
+                          property, fdt_strerror(r));
     }
 
     return r;
@@ -304,9 +301,8 @@  int qemu_fdt_setprop_cell(void *fdt, const char *node_path,
 
     r = fdt_setprop_cell(fdt, findnode_nofail(fdt, node_path), property, val);
     if (r < 0) {
-        error_report("%s: Couldn't set %s/%s = %#08x: %s", __func__,
-                     node_path, property, val, fdt_strerror(r));
-        exit(1);
+        error_report_exit("%s: Couldn't set %s/%s = %#08x: %s", __func__,
+                          node_path, property, val, fdt_strerror(r));
     }
 
     return r;
@@ -326,9 +322,8 @@  int qemu_fdt_setprop_string(void *fdt, const char *node_path,
 
     r = fdt_setprop_string(fdt, findnode_nofail(fdt, node_path), property, string);
     if (r < 0) {
-        error_report("%s: Couldn't set %s/%s = %s: %s", __func__,
-                     node_path, property, string, fdt_strerror(r));
-        exit(1);
+        error_report_exit("%s: Couldn't set %s/%s = %s: %s", __func__,
+                          node_path, property, string, fdt_strerror(r));
     }
 
     return r;
@@ -378,9 +373,8 @@  uint32_t qemu_fdt_get_phandle(void *fdt, const char *path)
 
     r = fdt_get_phandle(fdt, findnode_nofail(fdt, path));
     if (r == 0) {
-        error_report("%s: Couldn't get phandle for %s: %s", __func__,
-                     path, fdt_strerror(r));
-        exit(1);
+        error_report_exit("%s: Couldn't get phandle for %s: %s", __func__,
+                          path, fdt_strerror(r));
     }
 
     return r;
@@ -423,9 +417,8 @@  int qemu_fdt_nop_node(void *fdt, const char *node_path)
 
     r = fdt_nop_node(fdt, findnode_nofail(fdt, node_path));
     if (r < 0) {
-        error_report("%s: Couldn't nop node %s: %s", __func__, node_path,
-                     fdt_strerror(r));
-        exit(1);
+        error_report_exit("%s: Couldn't nop node %s: %s", __func__, node_path,
+                          fdt_strerror(r));
     }
 
     return r;
@@ -452,9 +445,8 @@  int qemu_fdt_add_subnode(void *fdt, const char *name)
 
     retval = fdt_add_subnode(fdt, parent, basename);
     if (retval < 0) {
-        error_report("FDT: Failed to create subnode %s: %s", name,
-                     fdt_strerror(retval));
-        exit(1);
+        error_report_exit("FDT: Failed to create subnode %s: %s", name,
+                          fdt_strerror(retval));
     }
 
     g_free(dupname);
diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c
index b6b02b4..f896631 100644
--- a/hw/9pfs/9p.c
+++ b/hw/9pfs/9p.c
@@ -3383,8 +3383,7 @@  static void __attribute__((__constructor__)) v9fs_set_fd_limit(void)
 {
     struct rlimit rlim;
     if (getrlimit(RLIMIT_NOFILE, &rlim) < 0) {
-        error_report("Failed to get the resource limit");
-        exit(1);
+        error_report_exit("Failed to get the resource limit");
     }
     open_fd_hw = rlim.rlim_cur - MIN(400, rlim.rlim_cur/3);
     open_fd_rc = rlim.rlim_cur/2;
diff --git a/hw/alpha/dp264.c b/hw/alpha/dp264.c
index f1267b5..eae6fde 100644
--- a/hw/alpha/dp264.c
+++ b/hw/alpha/dp264.c
@@ -109,15 +109,13 @@  static void clipper_init(MachineState *machine)
     palcode_filename = qemu_find_file(QEMU_FILE_TYPE_BIOS,
                                 bios_name ? bios_name : "palcode-clipper");
     if (palcode_filename == NULL) {
-        error_report("no palcode provided");
-        exit(1);
+        error_report_exit("no palcode provided");
     }
     size = load_elf(palcode_filename, cpu_alpha_superpage_to_phys,
                     NULL, &palcode_entry, &palcode_low, &palcode_high,
                     0, EM_ALPHA, 0, 0);
     if (size < 0) {
-        error_report("could not load palcode '%s'", palcode_filename);
-        exit(1);
+        error_report_exit("could not load palcode '%s'", palcode_filename);
     }
     g_free(palcode_filename);
 
@@ -136,8 +134,7 @@  static void clipper_init(MachineState *machine)
                         NULL, &kernel_entry, &kernel_low, &kernel_high,
                         0, EM_ALPHA, 0, 0);
         if (size < 0) {
-            error_report("could not load kernel '%s'", kernel_filename);
-            exit(1);
+            error_report_exit("could not load kernel '%s'", kernel_filename);
         }
 
         cpus[0]->env.trap_arg1 = kernel_entry;
@@ -153,9 +150,8 @@  static void clipper_init(MachineState *machine)
 
             initrd_size = get_image_size(initrd_filename);
             if (initrd_size < 0) {
-                error_report("could not load initial ram disk '%s'",
-                             initrd_filename);
-                exit(1);
+                error_report_exit("could not load initial ram disk '%s'",
+                                  initrd_filename);
             }
 
             /* Put the initrd image as high in memory as possible.  */
diff --git a/hw/arm/armv7m.c b/hw/arm/armv7m.c
index 49d3078..446ce18 100644
--- a/hw/arm/armv7m.c
+++ b/hw/arm/armv7m.c
@@ -220,8 +220,7 @@  DeviceState *armv7m_init(MemoryRegion *system_memory, int mem_size, int num_irq,
             lowaddr = 0;
         }
         if (image_size < 0) {
-            error_report("Could not load kernel '%s'", kernel_filename);
-            exit(1);
+            error_report_exit("Could not load kernel '%s'", kernel_filename);
         }
     }
 
diff --git a/hw/arm/digic_boards.c b/hw/arm/digic_boards.c
index 520c8e9..9474980 100644
--- a/hw/arm/digic_boards.c
+++ b/hw/arm/digic_boards.c
@@ -106,14 +106,12 @@  static void digic_load_rom(DigicBoardState *s, hwaddr addr,
         char *fn = qemu_find_file(QEMU_FILE_TYPE_BIOS, filename);
 
         if (!fn) {
-            error_report("Couldn't find rom image '%s'.", filename);
-            exit(1);
+            error_report_exit("Couldn't find rom image '%s'.", filename);
         }
 
         rom_size = load_image_targphys(fn, addr, max_size);
         if (rom_size < 0 || rom_size > max_size) {
-            error_report("Couldn't load rom image '%s'.", filename);
-            exit(1);
+            error_report_exit("Couldn't load rom image '%s'.", filename);
         }
         g_free(fn);
     }
diff --git a/hw/arm/fsl-imx6.c b/hw/arm/fsl-imx6.c
index 6a1bf26..ab1d845 100644
--- a/hw/arm/fsl-imx6.c
+++ b/hw/arm/fsl-imx6.c
@@ -36,9 +36,8 @@  static void fsl_imx6_init(Object *obj)
     int i;
 
     if (smp_cpus > FSL_IMX6_NUM_CPUS) {
-        error_report("%s: Only %d CPUs are supported (%d requested)",
-                     TYPE_FSL_IMX6, FSL_IMX6_NUM_CPUS, smp_cpus);
-        exit(1);
+        error_report_exit("%s: Only %d CPUs are supported (%d requested)",
+                          TYPE_FSL_IMX6, FSL_IMX6_NUM_CPUS, smp_cpus);
     }
 
     for (i = 0; i < smp_cpus; i++) {
diff --git a/hw/arm/highbank.c b/hw/arm/highbank.c
index 80e5fd4..efacaa6 100644
--- a/hw/arm/highbank.c
+++ b/hw/arm/highbank.c
@@ -283,13 +283,11 @@  static void calxeda_init(MachineState *machine, enum cxmachines machine_id)
         sysboot_filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
         if (sysboot_filename != NULL) {
             if (load_image_targphys(sysboot_filename, 0xfff88000, 0x8000) < 0) {
-                error_report("Unable to load %s", bios_name);
-                exit(1);
+                error_report_exit("Unable to load %s", bios_name);
             }
             g_free(sysboot_filename);
         } else {
-            error_report("Unable to find %s", bios_name);
-            exit(1);
+            error_report_exit("Unable to find %s", bios_name);
         }
     }
 
diff --git a/hw/arm/raspi.c b/hw/arm/raspi.c
index 2b295f1..ef40879 100644
--- a/hw/arm/raspi.c
+++ b/hw/arm/raspi.c
@@ -98,8 +98,8 @@  static void setup_boot(MachineState *machine, int version, size_t ram_size)
         r = load_image_targphys(machine->firmware, FIRMWARE_ADDR,
                                 ram_size - FIRMWARE_ADDR);
         if (r < 0) {
-            error_report("Failed to load firmware from %s", machine->firmware);
-            exit(1);
+            error_report_exit("Failed to load firmware from %s",
+                              machine->firmware);
         }
 
         binfo.entry = FIRMWARE_ADDR;
@@ -146,8 +146,7 @@  static void raspi2_init(MachineState *machine)
     blk = di ? blk_by_legacy_dinfo(di) : NULL;
     bus = qdev_get_child_bus(DEVICE(&s->soc), "sd-bus");
     if (bus == NULL) {
-        error_report("No SD bus found in SOC object");
-        exit(1);
+        error_report_exit("No SD bus found in SOC object");
     }
     carddev = qdev_create(bus, TYPE_SD_CARD);
     qdev_prop_set_drive(carddev, "drive", blk, &error_fatal);
diff --git a/hw/arm/sabrelite.c b/hw/arm/sabrelite.c
index 4e7ac8c..26a7ac3 100644
--- a/hw/arm/sabrelite.c
+++ b/hw/arm/sabrelite.c
@@ -50,9 +50,8 @@  static void sabrelite_init(MachineState *machine)
 
     /* Check the amount of memory is compatible with the SOC */
     if (machine->ram_size > FSL_IMX6_MMDC_SIZE) {
-        error_report("RAM size " RAM_ADDR_FMT " above max supported (%08x)",
-                     machine->ram_size, FSL_IMX6_MMDC_SIZE);
-        exit(1);
+        error_report_exit("RAM size " RAM_ADDR_FMT " above max supported "
+                          "(%08x)", machine->ram_size, FSL_IMX6_MMDC_SIZE);
     }
 
     object_initialize(&s->soc, sizeof(s->soc), TYPE_FSL_IMX6);
@@ -61,8 +60,7 @@  static void sabrelite_init(MachineState *machine)
 
     object_property_set_bool(OBJECT(&s->soc), true, "realized", &err);
     if (err != NULL) {
-        error_report("%s", error_get_pretty(err));
-        exit(1);
+        error_report_exit("%s", error_get_pretty(err));
     }
 
     memory_region_allocate_system_memory(&s->ram, NULL, "sabrelite.ram",
diff --git a/hw/arm/strongarm.c b/hw/arm/strongarm.c
index f1b2c6c..2c2c283 100644
--- a/hw/arm/strongarm.c
+++ b/hw/arm/strongarm.c
@@ -1589,15 +1589,13 @@  StrongARMState *sa1110_init(MemoryRegion *sysmem,
     }
 
     if (strncmp(rev, "sa1110", 6)) {
-        error_report("Machine requires a SA1110 processor.");
-        exit(1);
+        error_report_exit("Machine requires a SA1110 processor.");
     }
 
     s->cpu = cpu_arm_init(rev);
 
     if (!s->cpu) {
-        error_report("Unable to find CPU definition");
-        exit(1);
+        error_report_exit("Unable to find CPU definition");
     }
 
     memory_region_allocate_system_memory(&s->sdram, NULL, "strongarm.sdram",
diff --git a/hw/arm/sysbus-fdt.c b/hw/arm/sysbus-fdt.c
index 5debb33..be5245d 100644
--- a/hw/arm/sysbus-fdt.c
+++ b/hw/arm/sysbus-fdt.c
@@ -448,9 +448,8 @@  static int add_fdt_node(SysBusDevice *sbdev, void *opaque)
             return 0;
         }
     }
-    error_report("Device %s can not be dynamically instantiated",
-                     qdev_fw_name(DEVICE(sbdev)));
-    exit(1);
+    error_report_exit("Device %s can not be dynamically instantiated",
+                      qdev_fw_name(DEVICE(sbdev)));
 }
 
 /**
diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c
index 58760f4..2e98554 100644
--- a/hw/arm/vexpress.c
+++ b/hw/arm/vexpress.c
@@ -568,22 +568,20 @@  static void vexpress_common_init(MachineState *machine)
         int image_size;
 
         if (drive_get(IF_PFLASH, 0, 0)) {
-            error_report("The contents of the first flash device may be "
-                         "specified with -bios or with -drive if=pflash... "
-                         "but you cannot use both options at once");
-            exit(1);
+            error_report_exit("The contents of the first flash device may "
+                              "be specified with -bios or with -drive "
+                              "if=pflash... but you cannot use both "
+                              "options at once");
         }
         fn = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
         if (!fn) {
-            error_report("Could not find ROM image '%s'", bios_name);
-            exit(1);
+            error_report_exit("Could not find ROM image '%s'", bios_name);
         }
         image_size = load_image_targphys(fn, map[VE_NORFLASH0],
                                          VEXPRESS_FLASH_SIZE);
         g_free(fn);
         if (image_size < 0) {
-            error_report("Could not load ROM image '%s'", bios_name);
-            exit(1);
+            error_report_exit("Could not load ROM image '%s'", bios_name);
         }
     }
 
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index a193b5a..7b6df77 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -240,8 +240,7 @@  static void create_fdt(VirtBoardInfo *vbi)
     void *fdt = create_device_tree(&vbi->fdt_size);
 
     if (!fdt) {
-        error_report("create_device_tree() failed");
-        exit(1);
+        error_report_exit("create_device_tree() failed");
     }
 
     vbi->fdt = fdt;
@@ -814,21 +813,18 @@  static void create_one_flash(const char *name, hwaddr flashbase,
         int image_size;
 
         if (drive_get(IF_PFLASH, 0, 0)) {
-            error_report("The contents of the first flash device may be "
-                         "specified with -bios or with -drive if=pflash... "
-                         "but you cannot use both options at once");
-            exit(1);
+            error_report_exit("The contents of the first flash device may be "
+                              "specified with -bios or with -drive if=pflash"
+                              "... but you cannot use both options at once");
         }
         fn = qemu_find_file(QEMU_FILE_TYPE_BIOS, file);
         if (!fn) {
-            error_report("Could not find ROM image '%s'", file);
-            exit(1);
+            error_report_exit("Could not find ROM image '%s'", file);
         }
         image_size = load_image_mr(fn, sysbus_mmio_get_region(sbd, 0));
         g_free(fn);
         if (image_size < 0) {
-            error_report("Could not load ROM image '%s'", file);
-            exit(1);
+            error_report_exit("Could not load ROM image '%s'", file);
         }
     }
 }
@@ -1195,14 +1191,13 @@  static void machvirt_init(MachineState *machine)
      */
     if (!gic_version) {
         if (!kvm_enabled()) {
-            error_report("gic-version=host requires KVM");
-            exit(1);
+            error_report_exit("gic-version=host requires KVM");
         }
 
         gic_version = kvm_arm_vgic_probe();
         if (!gic_version) {
-            error_report("Unable to determine GIC version supported by host");
-            exit(1);
+            error_report_exit("Unable to determine GIC version "
+                              "supported by host");
         }
     }
 
@@ -1212,8 +1207,7 @@  static void machvirt_init(MachineState *machine)
     vbi = find_machine_info(cpustr[0]);
 
     if (!vbi) {
-        error_report("mach-virt: CPU %s not supported", cpustr[0]);
-        exit(1);
+        error_report_exit("mach-virt: CPU %s not supported", cpustr[0]);
     }
 
     /* If we have an EL3 boot ROM then the assumption is that it will
@@ -1237,23 +1231,22 @@  static void machvirt_init(MachineState *machine)
     }
 
     if (max_cpus > virt_max_cpus) {
-        error_report("Number of SMP CPUs requested (%d) exceeds max CPUs "
-                     "supported by machine 'mach-virt' (%d)",
-                     max_cpus, virt_max_cpus);
-        exit(1);
+        error_report_exit("Number of SMP CPUs requested (%d) exceeds max CPUs "
+                          "supported by machine 'mach-virt' (%d)",
+                          max_cpus, virt_max_cpus);
     }
 
     vbi->smp_cpus = smp_cpus;
 
     if (machine->ram_size > vbi->memmap[VIRT_MEM].size) {
-        error_report("mach-virt: cannot model more than %dGB RAM", RAMLIMIT_GB);
-        exit(1);
+        error_report_exit("mach-virt: cannot model more than %dGB RAM",
+                          RAMLIMIT_GB);
     }
 
     if (vms->secure) {
         if (kvm_enabled()) {
-            error_report("mach-virt: KVM does not support Security extensions");
-            exit(1);
+            error_report_exit("mach-virt: KVM does not support "
+                              "Security extensions");
         }
 
         /* The Secure view of the world is the same as the NonSecure,
@@ -1271,8 +1264,7 @@  static void machvirt_init(MachineState *machine)
 
     oc = cpu_class_by_name(TYPE_ARM_CPU, cpustr[0]);
     if (!oc) {
-        error_report("Unable to find CPU definition");
-        exit(1);
+        error_report_exit("Unable to find CPU definition");
     }
     typename = object_class_get_name(oc);
 
diff --git a/hw/arm/xlnx-ep108.c b/hw/arm/xlnx-ep108.c
index 4ec590a..d2aca6e 100644
--- a/hw/arm/xlnx-ep108.c
+++ b/hw/arm/xlnx-ep108.c
@@ -40,10 +40,8 @@  static void xlnx_ep108_init(MachineState *machine)
 
     /* Create the memory region to pass to the SoC */
     if (ram_size > XLNX_ZYNQMP_MAX_RAM_SIZE) {
-        error_report("ERROR: RAM size 0x%" PRIx64 " above max supported of "
-                     "0x%llx", ram_size,
-                     XLNX_ZYNQMP_MAX_RAM_SIZE);
-        exit(1);
+        error_report_exit("ERROR: RAM size 0x%" PRIx64 " above max supported "
+                          "of 0x%llx", ram_size, XLNX_ZYNQMP_MAX_RAM_SIZE);
     }
 
     if (ram_size < 0x08000000) {
@@ -75,8 +73,7 @@  static void xlnx_ep108_init(MachineState *machine)
         bus = qdev_get_child_bus(DEVICE(&s->soc), bus_name);
         g_free(bus_name);
         if (!bus) {
-            error_report("No SD bus found for SD card %d", i);
-            exit(1);
+            error_report_exit("No SD bus found for SD card %d", i);
         }
         carddev = qdev_create(bus, TYPE_SD_CARD);
         qdev_prop_set_drive(carddev, "drive", blk, &error_fatal);
diff --git a/hw/block/tc58128.c b/hw/block/tc58128.c
index 1d9f7ee..e408b42 100644
--- a/hw/block/tc58128.c
+++ b/hw/block/tc58128.c
@@ -40,8 +40,7 @@  static void init_dev(tc58128_dev * dev, const char *filename)
 	ret = load_image(filename, dev->flash_contents + 528 * 32);
 	if (ret < 0) {
             if (!qtest_enabled()) {
-                error_report("Could not load flash image %s", filename);
-                exit(1);
+                error_report_exit("Could not load flash image %s", filename);
             }
 	} else {
 	    /* Build first block with number of blocks */
diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
index 331d766..0f4f99f 100644
--- a/hw/block/virtio-blk.c
+++ b/hw/block/virtio-blk.c
@@ -477,21 +477,18 @@  void virtio_blk_handle_request(VirtIOBlockReq *req, MultiReqBuffer *mrb)
     unsigned out_num = req->elem.out_num;
 
     if (req->elem.out_num < 1 || req->elem.in_num < 1) {
-        error_report("virtio-blk missing headers");
-        exit(1);
+        error_report_exit("virtio-blk missing headers");
     }
 
     if (unlikely(iov_to_buf(iov, out_num, 0, &req->out,
                             sizeof(req->out)) != sizeof(req->out))) {
-        error_report("virtio-blk request outhdr too short");
-        exit(1);
+        error_report_exit("virtio-blk request outhdr too short");
     }
 
     iov_discard_front(&iov, &out_num, sizeof(req->out));
 
     if (in_iov[in_num - 1].iov_len < sizeof(struct virtio_blk_inhdr)) {
-        error_report("virtio-blk request inhdr too short");
-        exit(1);
+        error_report_exit("virtio-blk request inhdr too short");
     }
 
     /* We always touch the last byte, so just see how big in_iov is.  */
diff --git a/hw/char/exynos4210_uart.c b/hw/char/exynos4210_uart.c
index 885ecc0..dce0acf 100644
--- a/hw/char/exynos4210_uart.c
+++ b/hw/char/exynos4210_uart.c
@@ -597,17 +597,16 @@  DeviceState *exynos4210_uart_create(hwaddr addr,
 
     if (!chr) {
         if (channel >= MAX_SERIAL_PORTS) {
-            error_report("Only %d serial ports are supported by QEMU",
-                         MAX_SERIAL_PORTS);
-            exit(1);
+            error_report_exit("Only %d serial ports are supported by QEMU",
+                              MAX_SERIAL_PORTS);
         }
         chr = serial_hds[channel];
         if (!chr) {
             snprintf(label, ARRAY_SIZE(label), "%s%d", chr_name, channel);
             chr = qemu_chr_new(label, "null", NULL);
             if (!(chr)) {
-                error_report("Can't assign serial port to UART%d", channel);
-                exit(1);
+                error_report_exit("Can't assign serial port to UART%d",
+                                  channel);
             }
         }
     }
diff --git a/hw/core/machine.c b/hw/core/machine.c
index e5a456f..4d7fdb6 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -334,9 +334,8 @@  static bool machine_get_enforce_config_section(Object *obj, Error **errp)
 
 static int error_on_sysbus_device(SysBusDevice *sbdev, void *opaque)
 {
-    error_report("Option '-device %s' cannot be handled by this machine",
-                 object_class_get_name(object_get_class(OBJECT(sbdev))));
-    exit(1);
+    error_report_exit("Option '-device %s' cannot be handled by this machine",
+                      object_class_get_name(object_get_class(OBJECT(sbdev))));
 }
 
 static void machine_init_notify(Notifier *notifier, void *data)
diff --git a/hw/core/platform-bus.c b/hw/core/platform-bus.c
index 36f84ab..4f7bcae 100644
--- a/hw/core/platform-bus.c
+++ b/hw/core/platform-bus.c
@@ -121,8 +121,7 @@  static void platform_bus_map_irq(PlatformBusDevice *pbus, SysBusDevice *sbdev,
 
     irqn = find_first_zero_bit(pbus->used_irqs, max_irqs);
     if (irqn >= max_irqs) {
-        error_report("Platform Bus: Can not fit IRQ line");
-        exit(1);
+        error_report_exit("Platform Bus: Can not fit IRQ line");
     }
 
     set_bit(irqn, pbus->used_irqs);
@@ -155,9 +154,8 @@  static void platform_bus_map_mmio(PlatformBusDevice *pbus, SysBusDevice *sbdev,
     }
 
     if (!found_region) {
-        error_report("Platform Bus: Can not fit MMIO region of size %"PRIx64,
-                     size);
-        exit(1);
+        error_report_exit("Platform Bus: Can not fit MMIO region of "
+                          "size %" PRIx64, size);
     }
 
     /* Map the device's region into our Platform Bus MMIO space */
diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
index 28c31a2..a763c7a 100644
--- a/hw/i386/intel_iommu.c
+++ b/hw/i386/intel_iommu.c
@@ -2471,9 +2471,8 @@  static void vtd_realize(DeviceState *dev, Error **errp)
     /* Currently Intel IOMMU IR only support "kernel-irqchip={off|split}" */
     if (x86_iommu->intr_supported && kvm_irqchip_in_kernel() &&
         !kvm_irqchip_is_split()) {
-        error_report("Intel Interrupt Remapping cannot work with "
-                     "kernel-irqchip=on, please use 'split|off'.");
-        exit(1);
+        error_report_exit("Intel Interrupt Remapping cannot work with "
+                          "kernel-irqchip=on, please use 'split|off'.");
     }
 }
 
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 022dd1b..5cd77c2 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1168,14 +1168,13 @@  void pc_cpus_init(PCMachineState *pcms)
 
     model_pieces = g_strsplit(machine->cpu_model, ",", 2);
     if (!model_pieces[0]) {
-        error_report("Invalid/empty CPU model name");
-        exit(1);
+        error_report_exit("Invalid/empty CPU model name");
     }
 
     oc = cpu_class_by_name(TYPE_X86_CPU, model_pieces[0]);
     if (oc == NULL) {
-        error_report("Unable to find CPU definition: %s", model_pieces[0]);
-        exit(1);
+        error_report_exit("Unable to find CPU definition: %s",
+                          model_pieces[0]);
     }
     typename = object_class_get_name(oc);
     cc = CPU_CLASS(oc);
@@ -1191,9 +1190,8 @@  void pc_cpus_init(PCMachineState *pcms)
      */
     pcms->apic_id_limit = x86_cpu_apic_id_from_index(max_cpus - 1) + 1;
     if (pcms->apic_id_limit > ACPI_CPU_HOTPLUG_ID_LIMIT) {
-        error_report("max_cpus is too large. APIC ID of last CPU is %u",
-                     pcms->apic_id_limit - 1);
-        exit(1);
+        error_report_exit("max_cpus is too large. APIC ID of last CPU is %u",
+                          pcms->apic_id_limit - 1);
     }
 
     pcms->possible_cpus = g_malloc0(sizeof(CPUArchIdList) +
@@ -1392,9 +1390,8 @@  void pc_memory_init(PCMachineState *pcms,
          (machine->maxram_size > machine->ram_size))) {
         MachineClass *mc = MACHINE_GET_CLASS(machine);
 
-        error_report("\"-memory 'slots|maxmem'\" is not supported by: %s",
-                     mc->name);
-        exit(EXIT_FAILURE);
+        error_report_exit("\"-memory 'slots|maxmem'\" is not supported by: %s",
+                          mc->name);
     }
 
     /* initialize hotplug memory address space */
@@ -1404,16 +1401,14 @@  void pc_memory_init(PCMachineState *pcms,
             machine->maxram_size - machine->ram_size;
 
         if (machine->ram_slots > ACPI_MAX_RAM_SLOTS) {
-            error_report("unsupported amount of memory slots: %"PRIu64,
-                         machine->ram_slots);
-            exit(EXIT_FAILURE);
+            error_report_exit("unsupported amount of memory slots: %" PRIu64,
+                              machine->ram_slots);
         }
 
         if (QEMU_ALIGN_UP(machine->maxram_size,
                           TARGET_PAGE_SIZE) != machine->maxram_size) {
-            error_report("maximum memory size must by aligned to multiple of "
-                         "%d bytes", TARGET_PAGE_SIZE);
-            exit(EXIT_FAILURE);
+            error_report_exit("maximum memory size must by aligned to multiple"
+                              " of %d bytes", TARGET_PAGE_SIZE);
         }
 
         pcms->hotplug_memory.base =
@@ -1426,9 +1421,8 @@  void pc_memory_init(PCMachineState *pcms,
 
         if ((pcms->hotplug_memory.base + hotplug_mem_size) <
             hotplug_mem_size) {
-            error_report("unsupported amount of maximum memory: " RAM_ADDR_FMT,
-                         machine->maxram_size);
-            exit(EXIT_FAILURE);
+            error_report_exit("unsupported amount of maximum memory: "
+                              RAM_ADDR_FMT, machine->maxram_size);
         }
 
         memory_region_init(&pcms->hotplug_memory.mr, OBJECT(pcms),
@@ -2092,8 +2086,8 @@  bool pc_machine_is_smm_enabled(PCMachineState *pcms)
     }
 
     if (pcms->smm == ON_OFF_AUTO_ON) {
-        error_report("System Management Mode not supported by this hypervisor.");
-        exit(1);
+        error_report_exit("System Management Mode not supported "
+                          "by this hypervisor.");
     }
     return false;
 }
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index a07dc81..f4d15ef 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -404,8 +404,7 @@  static void pc_xen_hvm_init(MachineState *machine)
     PCIBus *bus;
 
     if (!xen_enabled()) {
-        error_report("xenfv machine requires the xen accelerator");
-        exit(1);
+        error_report_exit("xenfv machine requires the xen accelerator");
     }
 
     pc_xen_hvm_init_pci(machine);
diff --git a/hw/i386/x86-iommu.c b/hw/i386/x86-iommu.c
index ce26b2a..12429a6 100644
--- a/hw/i386/x86-iommu.c
+++ b/hw/i386/x86-iommu.c
@@ -58,9 +58,8 @@  static void x86_iommu_set_default(X86IOMMUState *x86_iommu)
     assert(x86_iommu);
 
     if (x86_iommu_default) {
-        error_report("QEMU does not support multiple vIOMMUs "
-                     "for x86 yet.");
-        exit(1);
+        error_report_exit("QEMU does not support multiple vIOMMUs "
+                          "for x86 yet.");
     }
 
     x86_iommu_default = x86_iommu;
diff --git a/hw/ide/core.c b/hw/ide/core.c
index 45b6df1..aa85502 100644
--- a/hw/ide/core.c
+++ b/hw/ide/core.c
@@ -2851,9 +2851,8 @@  void ide_drive_get(DriveInfo **hd, int n)
      */
 
     if (highest_bus > n_buses) {
-        error_report("Too many IDE buses defined (%d > %d)",
-                     highest_bus, n_buses);
-        exit(1);
+        error_report_exit("Too many IDE buses defined (%d > %d)", highest_bus,
+                          n_buses);
     }
 
     for (i = 0; i < n; i++) {
diff --git a/hw/intc/ioapic.c b/hw/intc/ioapic.c
index 31791b0..aaa06fe 100644
--- a/hw/intc/ioapic.c
+++ b/hw/intc/ioapic.c
@@ -400,9 +400,8 @@  static void ioapic_realize(DeviceState *dev, Error **errp)
     IOAPICCommonState *s = IOAPIC_COMMON(dev);
 
     if (s->version != 0x11 && s->version != 0x20) {
-        error_report("IOAPIC only supports version 0x11 or 0x20 "
-                     "(default: 0x11).");
-        exit(1);
+        error_report_exit("IOAPIC only supports version 0x11 or 0x20 "
+                          "(default: 0x11).");
     }
 
     memory_region_init_io(&s->io_memory, OBJECT(s), &ioapic_io_ops, s,
diff --git a/hw/intc/xics_kvm.c b/hw/intc/xics_kvm.c
index edbd62f..3ae72b0 100644
--- a/hw/intc/xics_kvm.c
+++ b/hw/intc/xics_kvm.c
@@ -65,9 +65,9 @@  static void icp_get_kvm_state(ICPState *ss)
 
     ret = kvm_vcpu_ioctl(ss->cs, KVM_GET_ONE_REG, &reg);
     if (ret != 0) {
-        error_report("Unable to retrieve KVM interrupt controller state"
-                " for CPU %ld: %s", kvm_arch_vcpu_id(ss->cs), strerror(errno));
-        exit(1);
+        error_report_exit("Unable to retrieve KVM interrupt controller state"
+                          " for CPU %ld: %s",
+                          kvm_arch_vcpu_id(ss->cs), strerror(errno));
     }
 
     ss->xirr = state >> KVM_REG_PPC_ICP_XISR_SHIFT;
@@ -162,9 +162,9 @@  static void ics_get_kvm_state(ICSState *ics)
 
         ret = ioctl(xicskvm->kernel_xics_fd, KVM_GET_DEVICE_ATTR, &attr);
         if (ret != 0) {
-            error_report("Unable to retrieve KVM interrupt controller state"
-                    " for IRQ %d: %s", i + ics->offset, strerror(errno));
-            exit(1);
+            error_report_exit("Unable to retrieve KVM interrupt controller "
+                              "state for IRQ %d: %s",
+                              i + ics->offset, strerror(errno));
         }
 
         irq->server = state & KVM_XICS_DESTINATION_MASK;
@@ -354,9 +354,8 @@  static void xics_kvm_cpu_setup(XICSState *xics, PowerPCCPU *cpu)
                                   xicskvm->kernel_xics_fd,
                                   kvm_arch_vcpu_id(cs));
         if (ret < 0) {
-            error_report("Unable to connect CPU%ld to kernel XICS: %s",
-                    kvm_arch_vcpu_id(cs), strerror(errno));
-            exit(1);
+            error_report_exit("Unable to connect CPU%ld to kernel XICS: %s",
+                              kvm_arch_vcpu_id(cs), strerror(errno));
         }
         ss->cap_irq_xics_enabled = true;
     }
diff --git a/hw/m68k/an5206.c b/hw/m68k/an5206.c
index 142bab9..03879c5 100644
--- a/hw/m68k/an5206.c
+++ b/hw/m68k/an5206.c
@@ -44,8 +44,7 @@  static void an5206_init(MachineState *machine)
     }
     cpu = cpu_m68k_init(cpu_model);
     if (!cpu) {
-        error_report("Unable to find m68k CPU definition");
-        exit(1);
+        error_report_exit("Unable to find m68k CPU definition");
     }
     env = &cpu->env;
 
diff --git a/hw/microblaze/boot.c b/hw/microblaze/boot.c
index 9eebb1a..f5132c0 100644
--- a/hw/microblaze/boot.c
+++ b/hw/microblaze/boot.c
@@ -190,9 +190,8 @@  void microblaze_load_kernel(MicroBlazeCPU *cpu, hwaddr ddr_base,
                                                   ram_size - initrd_offset);
             }
             if (initrd_size < 0) {
-                error_report("qemu: could not load initrd '%s'",
-                             initrd_filename);
-                exit(EXIT_FAILURE);
+                error_report_exit("qemu: could not load initrd '%s'",
+                                  initrd_filename);
             }
             boot_info.initrd_end = boot_info.initrd_start + initrd_size;
             high = ROUND_UP(high + initrd_size, 4);
diff --git a/hw/mips/mips_fulong2e.c b/hw/mips/mips_fulong2e.c
index 889cdc7..75fe1a3 100644
--- a/hw/mips/mips_fulong2e.c
+++ b/hw/mips/mips_fulong2e.c
@@ -328,8 +328,7 @@  static void mips_fulong2e_init(MachineState *machine)
 
         if ((bios_size < 0 || bios_size > BIOS_SIZE) &&
             !kernel_filename && !qtest_enabled()) {
-            error_report("Could not load MIPS bios '%s'", bios_name);
-            exit(1);
+            error_report_exit("Could not load MIPS bios '%s'", bios_name);
         }
     }
 
diff --git a/hw/mips/mips_jazz.c b/hw/mips/mips_jazz.c
index 73f6c9f..5d46691 100644
--- a/hw/mips/mips_jazz.c
+++ b/hw/mips/mips_jazz.c
@@ -196,8 +196,7 @@  static void mips_jazz_init(MachineState *machine,
         bios_size = -1;
     }
     if ((bios_size < 0 || bios_size > MAGNUM_BIOS_SIZE) && !qtest_enabled()) {
-        error_report("Could not load MIPS bios '%s'", bios_name);
-        exit(1);
+        error_report_exit("Could not load MIPS bios '%s'", bios_name);
     }
 
     /* Init CPU internal devices */
diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c
index e90857e..404046d 100644
--- a/hw/mips/mips_malta.c
+++ b/hw/mips/mips_malta.c
@@ -809,17 +809,16 @@  static int64_t load_kernel (void)
     /* Sanity check where the kernel has been linked */
     if (kvm_enabled()) {
         if (kernel_entry & 0x80000000ll) {
-            error_report("KVM guest kernels must be linked in useg. "
-                         "Did you forget to enable CONFIG_KVM_GUEST?");
-            exit(1);
+            error_report_exit("KVM guest kernels must be linked in useg. "
+                              "Did you forget to enable CONFIG_KVM_GUEST?");
         }
 
         xlate_to_kseg0 = cpu_mips_kvm_um_phys_to_kseg0;
     } else {
         if (!(kernel_entry & 0x80000000ll)) {
-            error_report("KVM guest kernels aren't supported with TCG. "
-                         "Did you unintentionally enable CONFIG_KVM_GUEST?");
-            exit(1);
+            error_report_exit("KVM guest kernels aren't supported with TCG. "
+                              "Did you unintentionally enable "
+                              "CONFIG_KVM_GUEST?");
         }
 
         xlate_to_kseg0 = cpu_mips_phys_to_kseg0;
@@ -949,8 +948,7 @@  static void create_cps(MaltaState *s, const char *cpu_model,
     object_property_set_int(OBJECT(s->cps), smp_cpus, "num-vp", &err);
     object_property_set_bool(OBJECT(s->cps), true, "realized", &err);
     if (err != NULL) {
-        error_report("%s", error_get_pretty(err));
-        exit(1);
+        error_report_exit("%s", error_get_pretty(err));
     }
 
     sysbus_mmio_map_overlap(SYS_BUS_DEVICE(s->cps), 0, 0, 1);
@@ -1119,9 +1117,9 @@  void mips_malta_init(MachineState *machine)
     } else {
         /* The flash region isn't executable from a KVM guest */
         if (kvm_enabled()) {
-            error_report("KVM enabled but no -kernel argument was specified. "
-                         "Booting from flash is not supported with KVM.");
-            exit(1);
+            error_report_exit("KVM enabled but no -kernel argument was "
+                              "specified. Booting from flash is not "
+                              "supported with KVM.");
         }
         /* Load firmware from flash. */
         if (!dinfo) {
@@ -1139,9 +1137,9 @@  void mips_malta_init(MachineState *machine)
             }
             if ((bios_size < 0 || bios_size > BIOS_SIZE) &&
                 !kernel_filename && !qtest_enabled()) {
-                error_report("Could not load MIPS bios '%s', and no "
-                             "-kernel argument was specified", bios_name);
-                exit(1);
+                error_report_exit("Could not load MIPS bios '%s', and no "
+                                  "-kernel argument was specified",
+                                  bios_name);
             }
         }
         /* In little endian mode the 32bit words in the bios are swapped,
diff --git a/hw/mips/mips_mipssim.c b/hw/mips/mips_mipssim.c
index 1b91195..8c8f09b 100644
--- a/hw/mips/mips_mipssim.c
+++ b/hw/mips/mips_mipssim.c
@@ -199,9 +199,8 @@  mips_mipssim_init(MachineState *machine)
     if ((bios_size < 0 || bios_size > BIOS_SIZE) &&
         !kernel_filename && !qtest_enabled()) {
         /* Bail out if we have neither a kernel image nor boot vector code. */
-        error_report("Could not load MIPS bios '%s', and no "
-                     "-kernel argument was specified", bios_name);
-        exit(1);
+        error_report_exit("Could not load MIPS bios '%s', and no "
+                          "-kernel argument was specified", bios_name);
     } else {
         /* We have a boot vector start address. */
         env->active_tc.PC = (target_long)(int32_t)0xbfc00000;
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 01f1351..cd6d981 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -892,8 +892,7 @@  static void virtio_net_handle_ctrl(VirtIODevice *vdev, VirtQueue *vq)
         }
         if (iov_size(elem->in_sg, elem->in_num) < sizeof(status) ||
             iov_size(elem->out_sg, elem->out_num) < sizeof(ctrl)) {
-            error_report("virtio-net ctrl missing headers");
-            exit(1);
+            error_report_exit("virtio-net ctrl missing headers");
         }
 
         iov_cnt = elem->out_num;
@@ -1124,19 +1123,18 @@  static ssize_t virtio_net_receive(NetClientState *nc, const uint8_t *buf, size_t
         if (!elem) {
             if (i == 0)
                 return -1;
-            error_report("virtio-net unexpected empty queue: "
-                         "i %zd mergeable %d offset %zd, size %zd, "
-                         "guest hdr len %zd, host hdr len %zd "
-                         "guest features 0x%" PRIx64,
-                         i, n->mergeable_rx_bufs, offset, size,
-                         n->guest_hdr_len, n->host_hdr_len,
-                         vdev->guest_features);
-            exit(1);
+            error_report_exit("virtio-net unexpected empty queue: "
+                              "i %zd mergeable %d offset %zd, size %zd, "
+                              "guest hdr len %zd, host hdr len %zd "
+                              "guest features 0x%" PRIx64,
+                              i, n->mergeable_rx_bufs, offset, size,
+                              n->guest_hdr_len, n->host_hdr_len,
+                              vdev->guest_features);
         }
 
         if (elem->in_num < 1) {
-            error_report("virtio-net receive queue contains no in buffers");
-            exit(1);
+            error_report_exit("virtio-net receive queue contains "
+                              "no in buffers");
         }
 
         sg = elem->in_sg;
@@ -1238,15 +1236,13 @@  static int32_t virtio_net_flush_tx(VirtIONetQueue *q)
         out_num = elem->out_num;
         out_sg = elem->out_sg;
         if (out_num < 1) {
-            error_report("virtio-net header not in first element");
-            exit(1);
+            error_report_exit("virtio-net header not in first element");
         }
 
         if (n->has_vnet_hdr) {
             if (iov_to_buf(out_sg, out_num, 0, &mhdr, n->guest_hdr_len) <
                 n->guest_hdr_len) {
-                error_report("virtio-net header incorrect");
-                exit(1);
+                error_report_exit("virtio-net header incorrect");
             }
             if (n->needs_vnet_hdr_swap) {
                 virtio_net_hdr_swap(vdev, (void *) &mhdr);
diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c
index 6a68e59..19ca9e0 100644
--- a/hw/nvram/fw_cfg.c
+++ b/hw/nvram/fw_cfg.c
@@ -805,9 +805,8 @@  void fw_cfg_add_file_callback(FWCfgState *s,  const char *filename,
     for (i = 0; i <= count; i++) {
         if (i != index &&
             strcmp(s->files->f[index].name, s->files->f[i].name) == 0) {
-            error_report("duplicate fw_cfg file name: %s",
-                         s->files->f[index].name);
-            exit(1);
+            error_report_exit("duplicate fw_cfg file name: %s",
+                              s->files->f[index].name);
         }
     }
 
diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index 24fae16..f2893e5 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -1797,9 +1797,8 @@  PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,
 
     bus = pci_get_bus_devfn(&devfn, rootbus, devaddr);
     if (!bus) {
-        error_report("Invalid PCI device address %s for device %s",
-                     devaddr, pci_nic_names[i]);
-        exit(1);
+        error_report_exit("Invalid PCI device address %s for device %s",
+                          devaddr, pci_nic_names[i]);
     }
 
     pci_dev = pci_create(bus, devfn, pci_nic_names[i]);
diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c
index 0cd534d..a864e81 100644
--- a/hw/ppc/e500.c
+++ b/hw/ppc/e500.c
@@ -207,9 +207,8 @@  static int sysbus_device_create_devtree(SysBusDevice *sbdev, void *opaque)
     }
 
     if (!matched) {
-        error_report("Device %s is not supported by this machine yet.",
-                     qdev_fw_name(DEVICE(sbdev)));
-        exit(1);
+        error_report_exit("Device %s is not supported by this machine yet.",
+                          qdev_fw_name(DEVICE(sbdev)));
     }
 
     return 0;
diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c
index 7d25106..4e6c310 100644
--- a/hw/ppc/mac_newworld.c
+++ b/hw/ppc/mac_newworld.c
@@ -230,8 +230,7 @@  static void ppc_core99_init(MachineState *machine)
         bios_size = -1;
     }
     if (bios_size < 0 || bios_size > BIOS_SIZE) {
-        error_report("could not load PowerPC bios '%s'", bios_name);
-        exit(1);
+        error_report_exit("could not load PowerPC bios '%s'", bios_name);
     }
 
     if (linux_boot) {
@@ -257,8 +256,7 @@  static void ppc_core99_init(MachineState *machine)
                                               kernel_base,
                                               ram_size - kernel_base);
         if (kernel_size < 0) {
-            error_report("could not load kernel '%s'", kernel_filename);
-            exit(1);
+            error_report_exit("could not load kernel '%s'", kernel_filename);
         }
         /* load initrd */
         if (initrd_filename) {
@@ -266,9 +264,8 @@  static void ppc_core99_init(MachineState *machine)
             initrd_size = load_image_targphys(initrd_filename, initrd_base,
                                               ram_size - initrd_base);
             if (initrd_size < 0) {
-                error_report("could not load initial ram disk '%s'",
-                             initrd_filename);
-                exit(1);
+                error_report_exit("could not load initial ram disk '%s'",
+                                  initrd_filename);
             }
             cmdline_base = round_page(initrd_base + initrd_size);
         } else {
@@ -349,8 +346,7 @@  static void ppc_core99_init(MachineState *machine)
             break;
 #endif /* defined(TARGET_PPC64) */
         default:
-            error_report("Bus model not supported on mac99 machine");
-            exit(1);
+            error_report_exit("Bus model not supported on mac99 machine");
         }
     }
 
diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c
index 4479487..b96114c 100644
--- a/hw/ppc/mac_oldworld.c
+++ b/hw/ppc/mac_oldworld.c
@@ -157,8 +157,7 @@  static void ppc_heathrow_init(MachineState *machine)
         bios_size = -1;
     }
     if (bios_size < 0 || bios_size > BIOS_SIZE) {
-        error_report("could not load PowerPC bios '%s'", bios_name);
-        exit(1);
+        error_report_exit("could not load PowerPC bios '%s'", bios_name);
     }
 
     if (linux_boot) {
@@ -183,8 +182,7 @@  static void ppc_heathrow_init(MachineState *machine)
                                               kernel_base,
                                               ram_size - kernel_base);
         if (kernel_size < 0) {
-            error_report("could not load kernel '%s'", kernel_filename);
-            exit(1);
+            error_report_exit("could not load kernel '%s'", kernel_filename);
         }
         /* load initrd */
         if (initrd_filename) {
@@ -192,9 +190,8 @@  static void ppc_heathrow_init(MachineState *machine)
             initrd_size = load_image_targphys(initrd_filename, initrd_base,
                                               ram_size - initrd_base);
             if (initrd_size < 0) {
-                error_report("could not load initial ram disk '%s'",
-                             initrd_filename);
-                exit(1);
+                error_report_exit("could not load initial ram disk '%s'",
+                                  initrd_filename);
             }
             cmdline_base = round_page(initrd_base + initrd_size);
         } else {
@@ -250,8 +247,8 @@  static void ppc_heathrow_init(MachineState *machine)
                 ((qemu_irq *)env->irq_inputs)[PPC6xx_INPUT_INT];
             break;
         default:
-            error_report("Bus model not supported on OldWorld Mac machine");
-            exit(1);
+            error_report_exit("Bus model not supported on "
+                              "OldWorld Mac machine");
         }
     }
 
@@ -264,8 +261,7 @@  static void ppc_heathrow_init(MachineState *machine)
 
     /* init basic PC hardware */
     if (PPC_INPUT(env) != PPC_FLAGS_INPUT_6xx) {
-        error_report("Only 6xx bus is supported on heathrow machine");
-        exit(1);
+        error_report_exit("Only 6xx bus is supported on heathrow machine");
     }
     pic = heathrow_pic_init(&pic_mem, 1, heathrow_irqs);
     pci_bus = pci_grackle_init(0xfec00000, pic,
diff --git a/hw/ppc/mpc8544ds.c b/hw/ppc/mpc8544ds.c
index 27b8289..a8d5604 100644
--- a/hw/ppc/mpc8544ds.c
+++ b/hw/ppc/mpc8544ds.c
@@ -42,8 +42,7 @@  static void mpc8544ds_init(MachineState *machine)
     };
 
     if (machine->ram_size > 0xc0000000) {
-        error_report("The MPC8544DS board only supports up to 3GB of RAM");
-        exit(1);
+        error_report_exit("The MPC8544DS board only supports up to 3GB of RAM");
     }
 
     ppce500_init(machine, &params);
diff --git a/hw/ppc/ppc405_boards.c b/hw/ppc/ppc405_boards.c
index 4b2f07a..3eb96b9 100644
--- a/hw/ppc/ppc405_boards.c
+++ b/hw/ppc/ppc405_boards.c
@@ -265,14 +265,13 @@  static void ref405ep_init(MachineState *machine)
             bios_size = load_image(filename, memory_region_get_ram_ptr(bios));
             g_free(filename);
             if (bios_size < 0 || bios_size > BIOS_SIZE) {
-                error_report("Could not load PowerPC BIOS '%s'", bios_name);
-                exit(1);
+                error_report_exit("Could not load PowerPC BIOS '%s'",
+                                  bios_name);
             }
             bios_size = (bios_size + 0xfff) & ~0xfff;
             memory_region_add_subregion(sysmem, (uint32_t)(-bios_size), bios);
         } else if (!qtest_enabled() || kernel_filename != NULL) {
-            error_report("Could not load PowerPC BIOS '%s'", bios_name);
-            exit(1);
+            error_report_exit("Could not load PowerPC BIOS '%s'", bios_name);
         } else {
             /* Avoid an uninitialized variable warning */
             bios_size = -1;
@@ -563,14 +562,13 @@  static void taihu_405ep_init(MachineState *machine)
             bios_size = load_image(filename, memory_region_get_ram_ptr(bios));
             g_free(filename);
             if (bios_size < 0 || bios_size > BIOS_SIZE) {
-                error_report("Could not load PowerPC BIOS '%s'", bios_name);
-                exit(1);
+                error_report_exit("Could not load PowerPC BIOS '%s'",
+                                  bios_name);
             }
             bios_size = (bios_size + 0xfff) & ~0xfff;
             memory_region_add_subregion(sysmem, (uint32_t)(-bios_size), bios);
         } else if (!qtest_enabled()) {
-            error_report("Could not load PowerPC BIOS '%s'", bios_name);
-            exit(1);
+            error_report_exit("Could not load PowerPC BIOS '%s'", bios_name);
         }
         memory_region_set_readonly(bios, true);
     }
diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c
index 054af1e..08bb268 100644
--- a/hw/ppc/prep.c
+++ b/hw/ppc/prep.c
@@ -536,8 +536,7 @@  static void ppc_prep_init(MachineState *machine)
         kernel_size = load_image_targphys(kernel_filename, kernel_base,
                                           ram_size - kernel_base);
         if (kernel_size < 0) {
-            error_report("could not load kernel '%s'", kernel_filename);
-            exit(1);
+            error_report_exit("could not load kernel '%s'", kernel_filename);
         }
         /* load initrd */
         if (initrd_filename) {
@@ -545,9 +544,8 @@  static void ppc_prep_init(MachineState *machine)
             initrd_size = load_image_targphys(initrd_filename, initrd_base,
                                               ram_size - initrd_base);
             if (initrd_size < 0) {
-                error_report("could not load initial ram disk '%s'",
-                             initrd_filename);
-                exit(1);
+                error_report_exit("could not load initial ram disk '%s'",
+                                  initrd_filename);
             }
         } else {
             initrd_base = 0;
@@ -574,8 +572,7 @@  static void ppc_prep_init(MachineState *machine)
     }
 
     if (PPC_INPUT(env) != PPC_FLAGS_INPUT_6xx) {
-        error_report("Only 6xx bus is supported on PREP machine");
-        exit(1);
+        error_report_exit("Only 6xx bus is supported on PREP machine");
     }
 
     dev = qdev_create(NULL, "raven-pcihost");
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 0787c66..4fb1b8f 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -975,8 +975,7 @@  static void spapr_finalize_fdt(sPAPRMachineState *spapr,
     QLIST_FOREACH(phb, &spapr->phbs, list) {
         ret = spapr_populate_pci_dt(phb, PHANDLE_XICP, fdt);
         if (ret < 0) {
-            error_report("couldn't setup PCI devices in fdt");
-            exit(1);
+            error_report_exit("couldn't setup PCI devices in fdt");
         }
     }
 
@@ -1026,17 +1025,15 @@  static void spapr_finalize_fdt(sPAPRMachineState *spapr,
         ret = spapr_drc_populate_dt(fdt, offset, NULL,
                                     SPAPR_DR_CONNECTOR_TYPE_CPU);
         if (ret < 0) {
-            error_report("Couldn't set up CPU DR device tree properties");
-            exit(1);
+            error_report_exit("Couldn't set up CPU DR device tree properties");
         }
     }
 
     _FDT((fdt_pack(fdt)));
 
     if (fdt_totalsize(fdt) > FDT_MAX_SIZE) {
-        error_report("FDT too big ! 0x%x bytes (max is 0x%x)",
-                     fdt_totalsize(fdt), FDT_MAX_SIZE);
-        exit(1);
+        error_report_exit("FDT too big ! 0x%x bytes (max is 0x%x)",
+                          fdt_totalsize(fdt), FDT_MAX_SIZE);
     }
 
     qemu_fdt_dumpdtb(fdt, fdt_totalsize(fdt));
@@ -1167,9 +1164,8 @@  static int find_unknown_sysbus_device(SysBusDevice *sbdev, void *opaque)
     }
 
     if (!matched) {
-        error_report("Device %s is not supported by this machine yet.",
-                     qdev_fw_name(DEVICE(sbdev)));
-        exit(1);
+        error_report_exit("Device %s is not supported by this machine yet.",
+                          qdev_fw_name(DEVICE(sbdev)));
     }
 
     return 0;
@@ -1737,14 +1733,12 @@  static void ppc_spapr_init(MachineState *machine)
 
     if (mc->query_hotpluggable_cpus) {
         if (smp_cpus % smp_threads) {
-            error_report("smp_cpus (%u) must be multiple of threads (%u)",
-                         smp_cpus, smp_threads);
-            exit(1);
+            error_report_exit("smp_cpus (%u) must be multiple of threads (%u)",
+                              smp_cpus, smp_threads);
         }
         if (max_cpus % smp_threads) {
-            error_report("max_cpus (%u) must be multiple of threads (%u)",
-                         max_cpus, smp_threads);
-            exit(1);
+            error_report_exit("max_cpus (%u) must be multiple of threads (%u)",
+                              max_cpus, smp_threads);
         }
     }
 
@@ -1758,8 +1752,7 @@  static void ppc_spapr_init(MachineState *machine)
     rma_alloc_size = kvmppc_alloc_rma(&rma);
 
     if (rma_alloc_size == -1) {
-        error_report("Unable to create RMA");
-        exit(1);
+        error_report_exit("Unable to create RMA");
     }
 
     if (rma_alloc_size && (rma_alloc_size < node0_size)) {
@@ -1790,9 +1783,8 @@  static void ppc_spapr_init(MachineState *machine)
     }
 
     if (spapr->rma_size > node0_size) {
-        error_report("Numa node 0 has to span the RMA (%#08"HWADDR_PRIx")",
-                     spapr->rma_size);
-        exit(1);
+        error_report_exit("Numa node 0 has to span the RMA (%#08"
+                          HWADDR_PRIx ")", spapr->rma_size);
     }
 
     /* Setup a load limit for the ramdisk leaving room for SLOF and FDT */
@@ -1816,8 +1808,7 @@  static void ppc_spapr_init(MachineState *machine)
         char *type = spapr_get_cpu_core_type(machine->cpu_model);
 
         if (type == NULL) {
-            error_report("Unable to find sPAPR CPU Core definition");
-            exit(1);
+            error_report_exit("Unable to find sPAPR CPU Core definition");
         }
 
         spapr->cores = g_new0(Object *, spapr_max_cores);
@@ -1844,8 +1835,7 @@  static void ppc_spapr_init(MachineState *machine)
         for (i = 0; i < smp_cpus; i++) {
             PowerPCCPU *cpu = cpu_ppc_init(machine->cpu_model);
             if (cpu == NULL) {
-                error_report("Unable to find PowerPC CPU definition");
-                exit(1);
+                error_report_exit("Unable to find PowerPC CPU definition");
             }
             spapr_cpu_init(spapr, cpu, &error_fatal);
        }
@@ -1885,10 +1875,9 @@  static void ppc_spapr_init(MachineState *machine)
             max_memslots = SPAPR_MAX_RAM_SLOTS;
         }
         if (machine->ram_slots > max_memslots) {
-            error_report("Specified number of memory slots %"
-                         PRIu64" exceeds max supported %d",
-                         machine->ram_slots, max_memslots);
-            exit(1);
+            error_report_exit("Specified number of memory slots %" PRIu64
+                              " exceeds max supported %d",
+                              machine->ram_slots, max_memslots);
         }
 
         spapr->hotplug_memory.base = ROUND_UP(machine->ram_size,
@@ -1905,23 +1894,19 @@  static void ppc_spapr_init(MachineState *machine)
 
     filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, "spapr-rtas.bin");
     if (!filename) {
-        error_report("Could not find LPAR rtas '%s'", "spapr-rtas.bin");
-        exit(1);
+        error_report_exit("Could not find LPAR rtas '%s'", "spapr-rtas.bin");
     }
     spapr->rtas_size = get_image_size(filename);
     if (spapr->rtas_size < 0) {
-        error_report("Could not get size of LPAR rtas '%s'", filename);
-        exit(1);
+        error_report_exit("Could not get size of LPAR rtas '%s'", filename);
     }
     spapr->rtas_blob = g_malloc(spapr->rtas_size);
     if (load_image_size(filename, spapr->rtas_blob, spapr->rtas_size) < 0) {
-        error_report("Could not load LPAR rtas '%s'", filename);
-        exit(1);
+        error_report_exit("Could not load LPAR rtas '%s'", filename);
     }
     if (spapr->rtas_size > RTAS_MAX_SIZE) {
-        error_report("RTAS too big ! 0x%zx bytes (max is 0x%x)",
-                     (size_t)spapr->rtas_size, RTAS_MAX_SIZE);
-        exit(1);
+        error_report_exit("RTAS too big ! 0x%zx bytes (max is 0x%x)",
+                          (size_t)spapr->rtas_size, RTAS_MAX_SIZE);
     }
     g_free(filename);
 
@@ -1988,10 +1973,9 @@  static void ppc_spapr_init(MachineState *machine)
     }
 
     if (spapr->rma_size < (MIN_RMA_SLOF << 20)) {
-        error_report(
-            "pSeries SLOF firmware requires >= %ldM guest RMA (Real Mode Area memory)",
-            MIN_RMA_SLOF);
-        exit(1);
+        error_report_exit("pSeries SLOF firmware requires >= %ldM "
+                          "guest RMA (Real Mode Area memory)",
+                          MIN_RMA_SLOF);
     }
 
     if (kernel_filename) {
@@ -2008,9 +1992,8 @@  static void ppc_spapr_init(MachineState *machine)
             kernel_le = kernel_size > 0;
         }
         if (kernel_size < 0) {
-            error_report("error loading %s: %s",
-                         kernel_filename, load_elf_strerror(kernel_size));
-            exit(1);
+            error_report_exit("error loading %s: %s", kernel_filename,
+                              load_elf_strerror(kernel_size));
         }
 
         /* load initrd */
@@ -2022,9 +2005,8 @@  static void ppc_spapr_init(MachineState *machine)
             initrd_size = load_image_targphys(initrd_filename, initrd_base,
                                               load_limit - initrd_base);
             if (initrd_size < 0) {
-                error_report("could not load initial ram disk '%s'",
-                             initrd_filename);
-                exit(1);
+                error_report_exit("could not load initial ram disk '%s'",
+                                  initrd_filename);
             }
         } else {
             initrd_base = 0;
@@ -2037,13 +2019,11 @@  static void ppc_spapr_init(MachineState *machine)
     }
     filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
     if (!filename) {
-        error_report("Could not find LPAR firmware '%s'", bios_name);
-        exit(1);
+        error_report_exit("Could not find LPAR firmware '%s'", bios_name);
     }
     fw_size = load_image_targphys(filename, 0, FW_MAX_SIZE);
     if (fw_size <= 0) {
-        error_report("Could not load LPAR firmware '%s'", filename);
-        exit(1);
+        error_report_exit("Could not load LPAR firmware '%s'", filename);
     }
     g_free(filename);
 
@@ -2082,8 +2062,7 @@  static int spapr_kvm_type(const char *vm_type)
         return 2;
     }
 
-    error_report("Unknown kvm-type specified '%s'", vm_type);
-    exit(1);
+    error_report_exit("Unknown kvm-type specified '%s'", vm_type);
 }
 
 /*
diff --git a/hw/ppc/virtex_ml507.c b/hw/ppc/virtex_ml507.c
index b97d966..1031113 100644
--- a/hw/ppc/virtex_ml507.c
+++ b/hw/ppc/virtex_ml507.c
@@ -282,9 +282,8 @@  static void virtex_init(MachineState *machine)
                                               high, ram_size - high);
 
             if (initrd_size < 0) {
-                error_report("couldn't load ram disk '%s'",
-                             machine->initrd_filename);
-                exit(1);
+                error_report_exit("couldn't load ram disk '%s'",
+                                  machine->initrd_filename);
             }
             high = ROUND_UP(high + initrd_size, 4);
         }
diff --git a/hw/scsi/vhost-scsi.c b/hw/scsi/vhost-scsi.c
index 5b26946..3160921 100644
--- a/hw/scsi/vhost-scsi.c
+++ b/hw/scsi/vhost-scsi.c
@@ -171,8 +171,8 @@  static void vhost_scsi_set_config(VirtIODevice *vdev,
 
     if ((uint32_t) virtio_ldl_p(vdev, &scsiconf->sense_size) != vs->sense_size ||
         (uint32_t) virtio_ldl_p(vdev, &scsiconf->cdb_size) != vs->cdb_size) {
-        error_report("vhost-scsi does not support changing the sense data and CDB sizes");
-        exit(1);
+        error_report_exit("vhost-scsi does not support changing "
+                          "the sense data and CDB sizes");
     }
 }
 
@@ -190,11 +190,8 @@  static void vhost_scsi_set_status(VirtIODevice *vdev, uint8_t val)
 
         ret = vhost_scsi_start(s);
         if (ret < 0) {
-            error_report("virtio-scsi: unable to start vhost: %s",
-                         strerror(-ret));
-
-            /* There is no userspace virtio-scsi fallback so exit */
-            exit(1);
+            error_report_exit("virtio-scsi: unable to start vhost: %s",
+                              strerror(-ret));
         }
     } else {
         vhost_scsi_stop(s);
diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c
index ce57ef6..048f569 100644
--- a/hw/scsi/virtio-scsi.c
+++ b/hw/scsi/virtio-scsi.c
@@ -83,8 +83,7 @@  static void virtio_scsi_complete_req(VirtIOSCSIReq *req)
 
 static void virtio_scsi_bad_req(void)
 {
-    error_report("wrong size for virtio-scsi headers");
-    exit(1);
+    error_report_exit("wrong size for virtio-scsi headers");
 }
 
 static size_t qemu_sgl_concat(VirtIOSCSIReq *req, struct iovec *iov,
@@ -207,8 +206,7 @@  static void *virtio_scsi_load_request(QEMUFile *f, SCSIRequest *sreq)
 
     if (virtio_scsi_parse_req(req, sizeof(VirtIOSCSICmdReq) + vs->cdb_size,
                               sizeof(VirtIOSCSICmdResp) + vs->sense_size) < 0) {
-        error_report("invalid SCSI request migration data");
-        exit(1);
+        error_report_exit("invalid SCSI request migration data");
     }
 
     scsi_req_ref(sreq);
@@ -624,8 +622,8 @@  static void virtio_scsi_set_config(VirtIODevice *vdev,
 
     if ((uint32_t) virtio_ldl_p(vdev, &scsiconf->sense_size) >= 65536 ||
         (uint32_t) virtio_ldl_p(vdev, &scsiconf->cdb_size) >= 256) {
-        error_report("bad data written to virtio-scsi configuration space");
-        exit(1);
+        error_report_exit("bad data written to virtio-scsi "
+                          "configuration space");
     }
 
     vs->sense_size = virtio_ldl_p(vdev, &scsiconf->sense_size);
diff --git a/hw/sh4/shix.c b/hw/sh4/shix.c
index ccc9e75..b388189 100644
--- a/hw/sh4/shix.c
+++ b/hw/sh4/shix.c
@@ -81,8 +81,7 @@  static void shix_init(MachineState *machine)
         bios_name = BIOS_FILENAME;
     ret = load_image_targphys(bios_name, 0, 0x4000);
     if (ret < 0 && !qtest_enabled()) {
-        error_report("Could not load SHIX bios '%s'", bios_name);
-        exit(1);
+        error_report_exit("Could not load SHIX bios '%s'", bios_name);
     }
 
     /* Register peripherals */
diff --git a/hw/smbios/smbios.c b/hw/smbios/smbios.c
index 74c7102..4ebd647 100644
--- a/hw/smbios/smbios.c
+++ b/hw/smbios/smbios.c
@@ -330,9 +330,8 @@  static void smbios_validate_table(void)
     uint32_t expect_t4_count = smbios_legacy ? smp_cpus : smbios_smp_sockets;
 
     if (smbios_type4_count && smbios_type4_count != expect_t4_count) {
-        error_report("Expected %d SMBIOS Type 4 tables, got %d instead",
-                     expect_t4_count, smbios_type4_count);
-        exit(1);
+        error_report_exit("Expected %d SMBIOS Type 4 tables, got %d instead",
+                          expect_t4_count, smbios_type4_count);
     }
 }
 
@@ -731,9 +730,8 @@  void smbios_set_defaults(const char *manufacturer, const char *product,
         /* in legacy mode, also complain if fields were given for types > 1 */
         if (find_next_bit(have_fields_bitmap,
                           SMBIOS_MAX_TYPE+1, 2) < SMBIOS_MAX_TYPE+1) {
-            error_report("can't process fields for smbios "
-                         "types > 1 on machine versions < 2.1!");
-            exit(1);
+            error_report_exit("can't process fields for smbios "
+                              "types > 1 on machine versions < 2.1!");
         }
     } else {
         g_free(smbios_entries);
@@ -897,8 +895,7 @@  void smbios_entry_add(QemuOpts *opts)
 
         size = get_image_size(val);
         if (size == -1 || size < sizeof(struct smbios_structure_header)) {
-            error_report("Cannot read SMBIOS file %s", val);
-            exit(1);
+            error_report_exit("Cannot read SMBIOS file %s", val);
         }
 
         /*
@@ -911,14 +908,12 @@  void smbios_entry_add(QemuOpts *opts)
                                                     smbios_tables_len);
 
         if (load_image(val, (uint8_t *)header) != size) {
-            error_report("Failed to load SMBIOS file %s", val);
-            exit(1);
+            error_report_exit("Failed to load SMBIOS file %s", val);
         }
 
         if (test_bit(header->type, have_fields_bitmap)) {
-            error_report("can't load type %d struct, fields already specified!",
-                         header->type);
-            exit(1);
+            error_report_exit("can't load type %d struct, fields "
+                              "already specified!", header->type);
         }
         set_bit(header->type, have_binfile_bitmap);
 
@@ -963,13 +958,11 @@  void smbios_entry_add(QemuOpts *opts)
         unsigned long type = strtoul(val, NULL, 0);
 
         if (type > SMBIOS_MAX_TYPE) {
-            error_report("out of range!");
-            exit(1);
+            error_report_exit("out of range!");
         }
 
         if (test_bit(type, have_binfile_bitmap)) {
-            error_report("can't add fields, binary file already loaded!");
-            exit(1);
+            error_report_exit("can't add fields, binary file already loaded!");
         }
         set_bit(type, have_fields_bitmap);
 
@@ -984,8 +977,7 @@  void smbios_entry_add(QemuOpts *opts)
             val = qemu_opt_get(opts, "release");
             if (val) {
                 if (sscanf(val, "%hhu.%hhu", &type0.major, &type0.minor) != 2) {
-                    error_report("Invalid release");
-                    exit(1);
+                    error_report_exit("Invalid release");
                 }
                 type0.have_major_minor = true;
             }
@@ -1002,8 +994,7 @@  void smbios_entry_add(QemuOpts *opts)
             val = qemu_opt_get(opts, "uuid");
             if (val) {
                 if (qemu_uuid_parse(val, qemu_uuid) != 0) {
-                    error_report("Invalid UUID");
-                    exit(1);
+                    error_report_exit("Invalid UUID");
                 }
                 qemu_uuid_set = true;
             }
@@ -1045,12 +1036,10 @@  void smbios_entry_add(QemuOpts *opts)
             type17.speed = qemu_opt_get_number(opts, "speed", 0);
             return;
         default:
-            error_report("Don't know how to build fields for SMBIOS type %ld",
-                         type);
-            exit(1);
+            error_report_exit("Don't know how to build fields for "
+                              "SMBIOS type %ld", type);
         }
     }
 
-    error_report("Must specify type= or file=");
-    exit(1);
+    error_report_exit("Must specify type= or file=");
 }
diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c
index 478fda8..51d3bad 100644
--- a/hw/sparc/sun4m.c
+++ b/hw/sparc/sun4m.c
@@ -943,22 +943,19 @@  static void sun4m_hw_init(const struct sun4m_hwdef *hwdef,
                              slavio_irq[16], iommu, &ledma_irq, 1);
 
     if (graphic_depth != 8 && graphic_depth != 24) {
-        error_report("Unsupported depth: %d", graphic_depth);
-        exit (1);
+        error_report_exit("Unsupported depth: %d", graphic_depth);
     }
     num_vsimms = 0;
     if (num_vsimms == 0) {
         if (vga_interface_type == VGA_CG3) {
             if (graphic_depth != 8) {
-                error_report("Unsupported depth: %d", graphic_depth);
-                exit(1);
+                error_report_exit("Unsupported depth: %d", graphic_depth);
             }
 
             if (!(graphic_width == 1024 && graphic_height == 768) &&
                 !(graphic_width == 1152 && graphic_height == 900)) {
-                error_report("Unsupported resolution: %d x %d", graphic_width,
-                             graphic_height);
-                exit(1);
+                error_report_exit("Unsupported resolution: %d x %d",
+                                  graphic_width, graphic_height);
             }
 
             /* sbus irq 5 */
@@ -967,14 +964,12 @@  static void sun4m_hw_init(const struct sun4m_hwdef *hwdef,
         } else {
             /* If no display specified, default to TCX */
             if (graphic_depth != 8 && graphic_depth != 24) {
-                error_report("Unsupported depth: %d", graphic_depth);
-                exit(1);
+                error_report_exit("Unsupported depth: %d", graphic_depth);
             }
 
             if (!(graphic_width == 1024 && graphic_height == 768)) {
-                error_report("Unsupported resolution: %d x %d",
-                             graphic_width, graphic_height);
-                exit(1);
+                error_report_exit("Unsupported resolution: %d x %d",
+                                  graphic_width, graphic_height);
             }
 
             tcx_init(hwdef->tcx_base, slavio_irq[11], 0x00100000,
diff --git a/hw/tricore/tricore_testboard.c b/hw/tricore/tricore_testboard.c
index 8d3520f..e987c9f 100644
--- a/hw/tricore/tricore_testboard.c
+++ b/hw/tricore/tricore_testboard.c
@@ -50,9 +50,8 @@  static void tricore_load_kernel(CPUTriCoreState *env)
                            NULL, 0,
                            EM_TRICORE, 1, 0);
     if (kernel_size <= 0) {
-        error_report("qemu: no kernel file '%s'",
-                tricoretb_binfo.kernel_filename);
-        exit(1);
+        error_report_exit("qemu: no kernel file '%s'",
+                          tricoretb_binfo.kernel_filename);
     }
     env->PC = entry;
 
@@ -76,8 +75,7 @@  static void tricore_testboard_init(MachineState *machine, int board_id)
     }
     cpu = cpu_tricore_init(machine->cpu_model);
     if (!cpu) {
-        error_report("Unable to find CPU definition");
-        exit(1);
+        error_report_exit("Unable to find CPU definition");
     }
     env = &cpu->env;
     memory_region_init_ram(ext_cram, NULL, "powerlink_ext_c.ram", 2*1024*1024,
diff --git a/hw/unicore32/puv3.c b/hw/unicore32/puv3.c
index 31cd171..b21c6c3 100644
--- a/hw/unicore32/puv3.c
+++ b/hw/unicore32/puv3.c
@@ -100,8 +100,7 @@  static void puv3_load_kernel(const char *kernel_filename)
     size = load_image_targphys(kernel_filename, KERNEL_LOAD_ADDR,
             KERNEL_MAX_SIZE);
     if (size < 0) {
-        error_report("Load kernel error: '%s'", kernel_filename);
-        exit(1);
+        error_report_exit("Load kernel error: '%s'", kernel_filename);
     }
 
     /* cheat curses that we have a graphic console, only under ocd console */
@@ -118,8 +117,7 @@  static void puv3_init(MachineState *machine)
     UniCore32CPU *cpu;
 
     if (initrd_filename) {
-        error_report("Please use kernel built-in initramdisk");
-        exit(1);
+        error_report_exit("Please use kernel built-in initramdisk");
     }
 
     if (!cpu_model) {
@@ -128,8 +126,7 @@  static void puv3_init(MachineState *machine)
 
     cpu = uc32_cpu_init(cpu_model);
     if (!cpu) {
-        error_report("Unable to find CPU definition");
-        exit(1);
+        error_report_exit("Unable to find CPU definition");
     }
     env = &cpu->env;
 
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index 15ee3a7..3c9d383 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -314,9 +314,8 @@  static int virtqueue_num_heads(VirtQueue *vq, unsigned int idx)
 
     /* Check it isn't doing very strange things with descriptor numbers. */
     if (num_heads > vq->vring.num) {
-        error_report("Guest moved used index from %u to %u",
-                     idx, vq->shadow_avail_idx);
-        exit(1);
+        error_report_exit("Guest moved used index from %u to %u", idx,
+                          vq->shadow_avail_idx);
     }
     /* On success, callers read a descriptor at vq->last_avail_idx.
      * Make sure descriptor read does not bypass avail index read. */
@@ -337,8 +336,7 @@  static unsigned int virtqueue_get_head(VirtQueue *vq, unsigned int idx)
 
     /* If their number is silly, that's a fatal mistake. */
     if (head >= vq->vring.num) {
-        error_report("Guest says index %u is available", head);
-        exit(1);
+        error_report_exit("Guest says index %u is available", head);
     }
 
     return head;
@@ -360,8 +358,7 @@  static unsigned virtqueue_read_next_desc(VirtIODevice *vdev, VRingDesc *desc,
     smp_wmb();
 
     if (next >= max) {
-        error_report("Desc next is %u", next);
-        exit(1);
+        error_report_exit("Desc next is %u", next);
     }
 
     vring_desc_read(vdev, desc, desc_pa, next);
@@ -393,14 +390,12 @@  void virtqueue_get_avail_bytes(VirtQueue *vq, unsigned int *in_bytes,
 
         if (desc.flags & VRING_DESC_F_INDIRECT) {
             if (desc.len % sizeof(VRingDesc)) {
-                error_report("Invalid size for indirect buffer table");
-                exit(1);
+                error_report_exit("Invalid size for indirect buffer table");
             }
 
             /* If we've got too many, that implies a descriptor loop. */
             if (num_bufs >= max) {
-                error_report("Looped descriptor");
-                exit(1);
+                error_report_exit("Looped descriptor");
             }
 
             /* loop over the indirect descriptor table */
@@ -414,8 +409,7 @@  void virtqueue_get_avail_bytes(VirtQueue *vq, unsigned int *in_bytes,
         do {
             /* If we've got too many, that implies a descriptor loop. */
             if (++num_bufs > max) {
-                error_report("Looped descriptor");
-                exit(1);
+                error_report_exit("Looped descriptor");
             }
 
             if (desc.flags & VRING_DESC_F_WRITE) {
@@ -459,16 +453,15 @@  static void virtqueue_map_desc(unsigned int *p_num_sg, hwaddr *addr, struct iove
     assert(num_sg <= max_num_sg);
 
     if (!sz) {
-        error_report("virtio: zero sized buffers are not allowed");
-        exit(1);
+        error_report_exit("virtio: zero sized buffers are not allowed");
     }
 
     while (sz) {
         hwaddr len = sz;
 
         if (num_sg == max_num_sg) {
-            error_report("virtio: too many write descriptors in indirect table");
-            exit(1);
+            error_report_exit("virtio: too many write descriptors "
+                              "in indirect table");
         }
 
         iov[num_sg].iov_base = cpu_physical_memory_map(pa, &len, is_write);
@@ -505,12 +498,10 @@  static void virtqueue_map_iovec(struct iovec *sg, hwaddr *addr,
         len = sg[i].iov_len;
         sg[i].iov_base = cpu_physical_memory_map(addr[i], &len, is_write);
         if (!sg[i].iov_base) {
-            error_report("virtio: error trying to map MMIO memory");
-            exit(1);
+            error_report_exit("virtio: error trying to map MMIO memory");
         }
         if (len != sg[i].iov_len) {
-            error_report("virtio: unexpected memory split");
-            exit(1);
+            error_report_exit("virtio: unexpected memory split");
         }
     }
 }
@@ -568,8 +559,7 @@  void *virtqueue_pop(VirtQueue *vq, size_t sz)
     max = vq->vring.num;
 
     if (vq->inuse >= vq->vring.num) {
-        error_report("Virtqueue size exceeded");
-        exit(1);
+        error_report_exit("Virtqueue size exceeded");
     }
 
     i = head = virtqueue_get_head(vq, vq->last_avail_idx++);
@@ -580,8 +570,7 @@  void *virtqueue_pop(VirtQueue *vq, size_t sz)
     vring_desc_read(vdev, &desc, desc_pa, i);
     if (desc.flags & VRING_DESC_F_INDIRECT) {
         if (desc.len % sizeof(VRingDesc)) {
-            error_report("Invalid size for indirect buffer table");
-            exit(1);
+            error_report_exit("Invalid size for indirect buffer table");
         }
 
         /* loop over the indirect descriptor table */
@@ -598,8 +587,7 @@  void *virtqueue_pop(VirtQueue *vq, size_t sz)
                                VIRTQUEUE_MAX_SIZE - out_num, true, desc.addr, desc.len);
         } else {
             if (in_num) {
-                error_report("Incorrect order for descriptors");
-                exit(1);
+                error_report_exit("Incorrect order for descriptors");
             }
             virtqueue_map_desc(&out_num, addr, iov,
                                VIRTQUEUE_MAX_SIZE, false, desc.addr, desc.len);
@@ -607,8 +595,7 @@  void *virtqueue_pop(VirtQueue *vq, size_t sz)
 
         /* If we've got too many, that implies a descriptor loop. */
         if ((in_num + out_num) > max) {
-            error_report("Looped descriptor");
-            exit(1);
+            error_report_exit("Looped descriptor");
         }
     } while ((i = virtqueue_read_next_desc(vdev, &desc, desc_pa, max)) != max);
 
diff --git a/hw/xtensa/sim.c b/hw/xtensa/sim.c
index 5e94004..9c8408e 100644
--- a/hw/xtensa/sim.c
+++ b/hw/xtensa/sim.c
@@ -68,9 +68,7 @@  static void xtensa_sim_init(MachineState *machine)
     for (n = 0; n < smp_cpus; n++) {
         cpu = cpu_xtensa_init(cpu_model);
         if (cpu == NULL) {
-            error_report("unable to find CPU definition '%s'",
-                         cpu_model);
-            exit(EXIT_FAILURE);
+            error_report_exit("unable to find CPU definition '%s'", cpu_model);
         }
         env = &cpu->env;
 
diff --git a/hw/xtensa/xtfpga.c b/hw/xtensa/xtfpga.c
index ac75949..1ec19e8 100644
--- a/hw/xtensa/xtfpga.c
+++ b/hw/xtensa/xtfpga.c
@@ -234,9 +234,7 @@  static void lx_init(const LxBoardDesc *board, MachineState *machine)
     for (n = 0; n < smp_cpus; n++) {
         cpu = cpu_xtensa_init(cpu_model);
         if (cpu == NULL) {
-            error_report("unable to find CPU definition '%s'",
-                         cpu_model);
-            exit(EXIT_FAILURE);
+            error_report_exit("unable to find CPU definition '%s'", cpu_model);
         }
         env = &cpu->env;
 
@@ -323,8 +321,7 @@  static void lx_init(const LxBoardDesc *board, MachineState *machine)
             uint32_t dtb_addr = tswap32(cur_lowmem);
 
             if (!fdt) {
-                error_report("could not load DTB '%s'", dtb_filename);
-                exit(EXIT_FAILURE);
+                error_report_exit("could not load DTB '%s'", dtb_filename);
             }
 
             cpu_physical_memory_write(cur_lowmem, fdt, fdt_size);
@@ -343,8 +340,8 @@  static void lx_init(const LxBoardDesc *board, MachineState *machine)
                                                   lowmem_end - cur_lowmem);
             }
             if (initrd_size < 0) {
-                error_report("could not load initrd '%s'", initrd_filename);
-                exit(EXIT_FAILURE);
+                error_report_exit("could not load initrd '%s'",
+                                  initrd_filename);
             }
             initrd_location.start = tswap32(cur_lowmem);
             initrd_location.end = tswap32(cur_lowmem + initrd_size);
@@ -369,9 +366,8 @@  static void lx_init(const LxBoardDesc *board, MachineState *machine)
             if (success > 0 && is_linux) {
                 entry_point = ep;
             } else {
-                error_report("could not load kernel '%s'",
-                             kernel_filename);
-                exit(EXIT_FAILURE);
+                error_report_exit("could not load kernel '%s'",
+                                  kernel_filename);
             }
         }
         if (entry_point != env->pc) {
diff --git a/numa.c b/numa.c
index 6289f46..8dc3565 100644
--- a/numa.c
+++ b/numa.c
@@ -274,9 +274,8 @@  static void validate_numa_cpus(void)
                               MAX_CPUMASK_BITS)) {
             bitmap_and(seen_cpus, seen_cpus,
                        numa_info[i].node_cpu, MAX_CPUMASK_BITS);
-            error_report("CPU(s) present in multiple NUMA nodes: %s",
-                         enumerate_cpus(seen_cpus, max_cpus));
-            exit(EXIT_FAILURE);
+            error_report_exit("CPU(s) present in multiple NUMA nodes: %s",
+                              enumerate_cpus(seen_cpus, max_cpus));
         }
         bitmap_or(seen_cpus, seen_cpus,
                   numa_info[i].node_cpu, MAX_CPUMASK_BITS);
@@ -307,8 +306,7 @@  void parse_numa_opts(MachineClass *mc)
     for (i = max_numa_nodeid - 1; i >= 0; i--) {
         /* Report large node IDs first, to make mistakes easier to spot */
         if (!numa_info[i].present) {
-            error_report("numa: Node ID missing: %d", i);
-            exit(1);
+            error_report_exit("numa: Node ID missing: %d", i);
         }
     }
 
@@ -349,10 +347,9 @@  void parse_numa_opts(MachineClass *mc)
             numa_total += numa_info[i].node_mem;
         }
         if (numa_total != ram_size) {
-            error_report("total memory for NUMA nodes (0x%" PRIx64 ")"
-                         " should equal RAM size (0x" RAM_ADDR_FMT ")",
-                         numa_total, ram_size);
-            exit(1);
+            error_report_exit("total memory for NUMA nodes (0x%" PRIx64 ")"
+                              " should equal RAM size (0x" RAM_ADDR_FMT ")",
+                              numa_total, ram_size);
         }
 
         for (i = 0; i < nb_numa_nodes; i++) {
@@ -458,10 +455,9 @@  void memory_region_allocate_system_memory(MemoryRegion *mr, Object *owner,
 
         if (memory_region_is_mapped(seg)) {
             char *path = object_get_canonical_path_component(OBJECT(backend));
-            error_report("memory backend %s is used multiple times. Each "
-                         "-numa option must use a different memdev value.",
-                         path);
-            exit(1);
+            error_report_exit("memory backend %s is used multiple times. Each "
+                              "-numa option must use a different memdev value.",
+                              path);
         }
 
         host_memory_backend_set_mapped(backend, true);
diff --git a/qemu-img.c b/qemu-img.c
index d2865a5..4bd6b79 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -2415,8 +2415,8 @@  static void dump_map_entry(OutputFormat output_format, MapEntry *e,
     switch (output_format) {
     case OFORMAT_HUMAN:
         if (e->data && !e->has_offset) {
-            error_report("File contains external, encrypted or compressed clusters.");
-            exit(1);
+            error_report_exit("File contains external, encrypted "
+                              "or compressed clusters.");
         }
         if (e->data && !e->zero) {
             printf("%#-16"PRIx64"%#-16"PRIx64"%#-16"PRIx64"%s\n",
@@ -3490,8 +3490,7 @@  typedef struct BenchData {
 static void bench_undrained_flush_cb(void *opaque, int ret)
 {
     if (ret < 0) {
-        error_report("Failed flush request: %s", strerror(-ret));
-        exit(EXIT_FAILURE);
+        error_report_exit("Failed flush request: %s", strerror(-ret));
     }
 }
 
@@ -3501,8 +3500,7 @@  static void bench_cb(void *opaque, int ret)
     BlockAIOCB *acb;
 
     if (ret < 0) {
-        error_report("Failed request: %s", strerror(-ret));
-        exit(EXIT_FAILURE);
+        error_report_exit("Failed request: %s", strerror(-ret));
     }
 
     if (b->in_flush) {
@@ -3529,8 +3527,7 @@  static void bench_cb(void *opaque, int ret)
 
                 acb = blk_aio_flush(b->blk, cb, b);
                 if (!acb) {
-                    error_report("Failed to issue flush request");
-                    exit(EXIT_FAILURE);
+                    error_report_exit("Failed to issue flush request");
                 }
             }
             if (b->drain_on_flush) {
@@ -3548,8 +3545,7 @@  static void bench_cb(void *opaque, int ret)
                                  bench_cb, b);
         }
         if (!acb) {
-            error_report("Failed to issue request");
-            exit(EXIT_FAILURE);
+            error_report_exit("Failed to issue request");
         }
         b->in_flight++;
         b->offset += b->step;
diff --git a/qemu-io.c b/qemu-io.c
index db129ea..d7b4c5a 100644
--- a/qemu-io.c
+++ b/qemu-io.c
@@ -488,8 +488,7 @@  int main(int argc, char **argv)
             break;
         case 'd':
             if (bdrv_parse_discard_flags(optarg, &flags) < 0) {
-                error_report("Invalid discard option: %s", optarg);
-                exit(1);
+                error_report_exit("Invalid discard option: %s", optarg);
             }
             break;
         case 'f':
@@ -509,8 +508,7 @@  int main(int argc, char **argv)
             break;
         case 't':
             if (bdrv_parse_cache_mode(optarg, &flags, &writethrough) < 0) {
-                error_report("Invalid cache option: %s", optarg);
-                exit(1);
+                error_report_exit("Invalid cache option: %s", optarg);
             }
             break;
         case 'T':
@@ -546,8 +544,7 @@  int main(int argc, char **argv)
     }
 
     if (format && imageOpts) {
-        error_report("--image-opts and -f are mutually exclusive");
-        exit(1);
+        error_report_exit("--image-opts and -f are mutually exclusive");
     }
 
     if (qemu_init_main_loop(&local_error)) {
diff --git a/qemu-nbd.c b/qemu-nbd.c
index e3571c2..c85b3b2 100644
--- a/qemu-nbd.c
+++ b/qemu-nbd.c
@@ -173,8 +173,7 @@  static int find_partition(BlockBackend *blk, int partition,
 
     ret = blk_pread(blk, 0, data, sizeof(data));
     if (ret < 0) {
-        error_report("error while reading: %s", strerror(-ret));
-        exit(EXIT_FAILURE);
+        error_report_exit("error while reading: %s", strerror(-ret));
     }
 
     if (data[510] != 0x55 || data[511] != 0xaa) {
@@ -196,8 +195,7 @@  static int find_partition(BlockBackend *blk, int partition,
             ret = blk_pread(blk, mbr[i].start_sector_abs * MBR_SIZE,
                             data1, sizeof(data1));
             if (ret < 0) {
-                error_report("error while reading: %s", strerror(-ret));
-                exit(EXIT_FAILURE);
+                error_report_exit("error while reading: %s", strerror(-ret));
             }
 
             for (j = 0; j < 4; j++) {
@@ -550,19 +548,16 @@  int main(int argc, char **argv)
             /* fallthrough */
         case QEMU_NBD_OPT_CACHE:
             if (seen_cache) {
-                error_report("-n and --cache can only be specified once");
-                exit(EXIT_FAILURE);
+                error_report_exit("-n and --cache can only be specified once");
             }
             seen_cache = true;
             if (bdrv_parse_cache_mode(optarg, &flags, &writethrough) == -1) {
-                error_report("Invalid cache mode `%s'", optarg);
-                exit(EXIT_FAILURE);
+                error_report_exit("Invalid cache mode `%s'", optarg);
             }
             break;
         case QEMU_NBD_OPT_AIO:
             if (seen_aio) {
-                error_report("--aio can only be specified once");
-                exit(EXIT_FAILURE);
+                error_report_exit("--aio can only be specified once");
             }
             seen_aio = true;
             if (!strcmp(optarg, "native")) {
@@ -570,19 +565,16 @@  int main(int argc, char **argv)
             } else if (!strcmp(optarg, "threads")) {
                 /* this is the default */
             } else {
-               error_report("invalid aio mode `%s'", optarg);
-               exit(EXIT_FAILURE);
+               error_report_exit("invalid aio mode `%s'", optarg);
             }
             break;
         case QEMU_NBD_OPT_DISCARD:
             if (seen_discard) {
-                error_report("--discard can only be specified once");
-                exit(EXIT_FAILURE);
+                error_report_exit("--discard can only be specified once");
             }
             seen_discard = true;
             if (bdrv_parse_discard_flags(optarg, &flags) == -1) {
-                error_report("Invalid discard mode `%s'", optarg);
-                exit(EXIT_FAILURE);
+                error_report_exit("Invalid discard mode `%s'", optarg);
             }
             break;
         case QEMU_NBD_OPT_DETECT_ZEROES:
@@ -599,9 +591,9 @@  int main(int argc, char **argv)
             }
             if (detect_zeroes == BLOCKDEV_DETECT_ZEROES_OPTIONS_UNMAP &&
                 !(flags & BDRV_O_UNMAP)) {
-                error_report("setting detect-zeroes to unmap is not allowed "
-                             "without setting discard operation to unmap");
-                exit(EXIT_FAILURE);
+                error_report_exit("setting detect-zeroes to unmap is not "
+                                  "allowed without setting discard "
+                                  "operation to unmap");
             }
             break;
         case 'b':
@@ -613,12 +605,10 @@  int main(int argc, char **argv)
         case 'o':
                 dev_offset = strtoll (optarg, &end, 0);
             if (*end) {
-                error_report("Invalid offset `%s'", optarg);
-                exit(EXIT_FAILURE);
+                error_report_exit("Invalid offset `%s'", optarg);
             }
             if (dev_offset < 0) {
-                error_report("Offset must be positive `%s'", optarg);
-                exit(EXIT_FAILURE);
+                error_report_exit("Offset must be positive `%s'", optarg);
             }
             break;
         case 'l':
@@ -626,9 +616,8 @@  int main(int argc, char **argv)
                 sn_opts = qemu_opts_parse_noisily(&internal_snapshot_opts,
                                                   optarg, false);
                 if (!sn_opts) {
-                    error_report("Failed in parsing snapshot param `%s'",
-                                 optarg);
-                    exit(EXIT_FAILURE);
+                    error_report_exit("Failed in parsing snapshot param `%s'",
+                                      optarg);
                 }
             } else {
                 sn_id_or_name = optarg;
@@ -641,19 +630,16 @@  int main(int argc, char **argv)
         case 'P':
             partition = strtol(optarg, &end, 0);
             if (*end) {
-                error_report("Invalid partition `%s'", optarg);
-                exit(EXIT_FAILURE);
+                error_report_exit("Invalid partition `%s'", optarg);
             }
             if (partition < 1 || partition > 8) {
-                error_report("Invalid partition %d", partition);
-                exit(EXIT_FAILURE);
+                error_report_exit("Invalid partition %d", partition);
             }
             break;
         case 'k':
             sockpath = optarg;
             if (sockpath[0] != '/') {
-                error_report("socket path must be absolute");
-                exit(EXIT_FAILURE);
+                error_report_exit("socket path must be absolute");
             }
             break;
         case 'd':
@@ -665,12 +651,11 @@  int main(int argc, char **argv)
         case 'e':
             shared = strtol(optarg, &end, 0);
             if (*end) {
-                error_report("Invalid shared device number '%s'", optarg);
-                exit(EXIT_FAILURE);
+                error_report_exit("Invalid shared device number '%s'", optarg);
             }
             if (shared < 1) {
-                error_report("Shared device number must be greater than 0");
-                exit(EXIT_FAILURE);
+                error_report_exit("Shared device number must be "
+                                  "greater than 0");
             }
             break;
         case 'f':
@@ -694,8 +679,8 @@  int main(int argc, char **argv)
             exit(0);
             break;
         case '?':
-            error_report("Try `%s --help' for more information.", argv[0]);
-            exit(EXIT_FAILURE);
+            error_report_exit("Try `%s --help' for more information.",
+                              argv[0]);
         case QEMU_NBD_OPT_OBJECT: {
             QemuOpts *opts;
             opts = qemu_opts_parse_noisily(&qemu_object_opts,
@@ -737,12 +722,10 @@  int main(int argc, char **argv)
 
     if (tlscredsid) {
         if (sockpath) {
-            error_report("TLS is only supported with IPv4/IPv6");
-            exit(EXIT_FAILURE);
+            error_report_exit("TLS is only supported with IPv4/IPv6");
         }
         if (device) {
-            error_report("TLS is not supported with a host device");
-            exit(EXIT_FAILURE);
+            error_report_exit("TLS is not supported with a host device");
         }
         if (!export_name) {
             /* Set the default NBD protocol export name, since
@@ -751,18 +734,16 @@  int main(int argc, char **argv)
         }
         tlscreds = nbd_get_tls_creds(tlscredsid, &local_err);
         if (local_err) {
-            error_report("Failed to get TLS creds %s",
-                         error_get_pretty(local_err));
-            exit(EXIT_FAILURE);
+            error_report_exit("Failed to get TLS creds %s",
+                              error_get_pretty(local_err));
         }
     }
 
     if (disconnect) {
         int nbdfd = open(argv[optind], O_RDWR);
         if (nbdfd < 0) {
-            error_report("Cannot open %s: %s", argv[optind],
-                         strerror(errno));
-            exit(EXIT_FAILURE);
+            error_report_exit("Cannot open %s: %s", argv[optind],
+                              strerror(errno));
         }
         nbd_disconnect(nbdfd);
 
@@ -779,9 +760,8 @@  int main(int argc, char **argv)
         int ret;
 
         if (qemu_pipe(stderr_fd) < 0) {
-            error_report("Error setting up communication pipe: %s",
-                         strerror(errno));
-            exit(EXIT_FAILURE);
+            error_report_exit("Error setting up communication pipe: %s",
+                              strerror(errno));
         }
 
         /* Now daemonize, but keep a communication channel open to
@@ -789,8 +769,7 @@  int main(int argc, char **argv)
          */
         pid = fork();
         if (pid < 0) {
-            error_report("Failed to fork: %s", strerror(errno));
-            exit(EXIT_FAILURE);
+            error_report_exit("Failed to fork: %s", strerror(errno));
         } else if (pid == 0) {
             close(stderr_fd[0]);
             ret = qemu_daemon(1, 0);
@@ -798,8 +777,7 @@  int main(int argc, char **argv)
             /* Temporarily redirect stderr to the parent's pipe...  */
             dup2(stderr_fd[1], STDERR_FILENO);
             if (ret < 0) {
-                error_report("Failed to daemonize: %s", strerror(errno));
-                exit(EXIT_FAILURE);
+                error_report_exit("Failed to daemonize: %s", strerror(errno));
             }
 
             /* ... close the descriptor we inherited and go on.  */
@@ -821,9 +799,8 @@  int main(int argc, char **argv)
                 }
             }
             if (ret < 0) {
-                error_report("Cannot read from daemon: %s",
-                             strerror(errno));
-                exit(EXIT_FAILURE);
+                error_report_exit("Cannot read from daemon: %s",
+                                  strerror(errno));
             }
 
             /* Usually the daemon should not print any message.
@@ -851,8 +828,7 @@  int main(int argc, char **argv)
     if (imageOpts) {
         QemuOpts *opts;
         if (fmt) {
-            error_report("--image-opts and -f are mutually exclusive");
-            exit(EXIT_FAILURE);
+            error_report_exit("--image-opts and -f are mutually exclusive");
         }
         opts = qemu_opts_parse_noisily(&file_opts, srcpath, true);
         if (!opts) {
@@ -896,17 +872,15 @@  int main(int argc, char **argv)
     bs->detect_zeroes = detect_zeroes;
     fd_size = blk_getlength(blk);
     if (fd_size < 0) {
-        error_report("Failed to determine the image length: %s",
-                     strerror(-fd_size));
-        exit(EXIT_FAILURE);
+        error_report_exit("Failed to determine the image length: %s",
+                          strerror(-fd_size));
     }
 
     if (partition != -1) {
         ret = find_partition(blk, partition, &dev_offset, &fd_size);
         if (ret < 0) {
-            error_report("Could not find partition %d: %s", partition,
-                         strerror(-ret));
-            exit(EXIT_FAILURE);
+            error_report_exit("Could not find partition %d: %s", partition,
+                              strerror(-ret));
         }
     }
 
@@ -933,8 +907,8 @@  int main(int argc, char **argv)
 
         ret = pthread_create(&client_thread, NULL, nbd_client_thread, device);
         if (ret != 0) {
-            error_report("Failed to create client thread: %s", strerror(ret));
-            exit(EXIT_FAILURE);
+            error_report_exit("Failed to create client thread: %s",
+                              strerror(ret));
         }
     } else {
         /* Shut up GCC warnings.  */
@@ -946,9 +920,8 @@  int main(int argc, char **argv)
     /* now when the initialization is (almost) complete, chdir("/")
      * to free any busy filesystems */
     if (chdir("/") < 0) {
-        error_report("Could not chdir to root directory: %s",
-                     strerror(errno));
-        exit(EXIT_FAILURE);
+        error_report_exit("Could not chdir to root directory: %s",
+                          strerror(errno));
     }
 
     state = RUNNING;
diff --git a/replay/replay-char.c b/replay/replay-char.c
index edf46ab..209c9c0 100755
--- a/replay/replay-char.c
+++ b/replay/replay-char.c
@@ -115,8 +115,7 @@  void replay_char_write_event_load(int *res, int *offset)
         replay_mutex_unlock();
     } else {
         replay_mutex_unlock();
-        error_report("Missing character write event in the replay log");
-        exit(1);
+        error_report_exit("Missing character write event in the replay log");
     }
 }
 
@@ -139,8 +138,7 @@  int replay_char_read_all_load(uint8_t *buf)
         return res;
     } else {
         replay_mutex_unlock();
-        error_report("Missing character read all event in the replay log");
-        exit(1);
+        error_report_exit("Missing character read all event in the replay log");
     }
 }
 
diff --git a/replay/replay-events.c b/replay/replay-events.c
index 3807245..cffaa08 100644
--- a/replay/replay-events.c
+++ b/replay/replay-events.c
@@ -55,9 +55,8 @@  static void replay_run_event(Event *event)
         aio_bh_call(event->opaque);
         break;
     default:
-        error_report("Replay: invalid async event ID (%d) in the queue",
-                    event->event_kind);
-        exit(1);
+        error_report_exit("Replay: invalid async event ID (%d) in the queue",
+                          event->event_kind);
         break;
     }
 }
@@ -190,8 +189,8 @@  static void replay_save_event(Event *event, int checkpoint)
             replay_put_qword(event->id);
             break;
         default:
-            error_report("Unknown ID %" PRId64 " of replay event", event->id);
-            exit(1);
+            error_report_exit("Unknown ID %" PRId64 " of replay event",
+                              event->id);
         }
     }
 }
@@ -253,8 +252,7 @@  static Event *replay_read_event(int checkpoint)
         }
         break;
     default:
-        error_report("Unknown ID %d of replay event", read_event_kind);
-        exit(1);
+        error_report_exit("Unknown ID %d of replay event", read_event_kind);
         break;
     }
 
diff --git a/replay/replay-internal.c b/replay/replay-internal.c
index 5835e8d..9bb4a1c 100644
--- a/replay/replay-internal.c
+++ b/replay/replay-internal.c
@@ -158,8 +158,8 @@  void replay_fetch_data_kind(void)
             replay_check_error();
             replay_has_unread_data = 1;
             if (replay_data_kind >= EVENT_COUNT) {
-                error_report("Replay: unknown event kind %d", replay_data_kind);
-                exit(1);
+                error_report_exit("Replay: unknown event kind %d",
+                                  replay_data_kind);
             }
         }
     }
diff --git a/replay/replay-time.c b/replay/replay-time.c
index fffe072..c074e25 100644
--- a/replay/replay-time.c
+++ b/replay/replay-time.c
@@ -60,6 +60,5 @@  int64_t replay_read_clock(ReplayClockKind kind)
         return ret;
     }
 
-    error_report("REPLAY INTERNAL ERROR %d", __LINE__);
-    exit(1);
+    error_report_exit("REPLAY INTERNAL ERROR %d", __LINE__);
 }
diff --git a/replay/replay.c b/replay/replay.c
index 167fd29..f4d96aa 100644
--- a/replay/replay.c
+++ b/replay/replay.c
@@ -281,14 +281,12 @@  void replay_configure(QemuOpts *opts)
     } else if (!strcmp(rr, "replay")) {
         mode = REPLAY_MODE_PLAY;
     } else {
-        error_report("Invalid icount rr option: %s", rr);
-        exit(1);
+        error_report_exit("Invalid icount rr option: %s", rr);
     }
 
     fname = qemu_opt_get(opts, "rrfile");
     if (!fname) {
-        error_report("File name not specified for replay");
-        exit(1);
+        error_report_exit("File name not specified for replay");
     }
 
     replay_enable(fname, mode);
@@ -308,8 +306,7 @@  void replay_start(void)
         exit(1);
     }
     if (!use_icount) {
-        error_report("Please enable icount to use record/replay");
-        exit(1);
+        error_report_exit("Please enable icount to use record/replay");
     }
 
     /* Timer for snapshotting will be set up here. */
diff --git a/target-arm/machine.c b/target-arm/machine.c
index 7a6ca31..39fd251 100644
--- a/target-arm/machine.c
+++ b/target-arm/machine.c
@@ -338,9 +338,8 @@  const char *gicv3_class_name(void)
 #ifdef TARGET_AARCH64
         return "kvm-arm-gicv3";
 #else
-        error_report("KVM GICv3 acceleration is not supported on this "
-                     "platform");
-        exit(1);
+        error_report_exit("KVM GICv3 acceleration is not supported on this "
+                          "platform");
 #endif
     } else {
         return "arm-gicv3";
diff --git a/target-i386/kvm.c b/target-i386/kvm.c
index 0b2016a..04f542b 100644
--- a/target-i386/kvm.c
+++ b/target-i386/kvm.c
@@ -3237,8 +3237,7 @@  void kvm_arch_init_irq_routing(KVMState *s)
            MSI routes for signaling interrupts to the local apics. */
         for (i = 0; i < IOAPIC_NUM_PINS; i++) {
             if (kvm_irqchip_add_msi_route(s, 0, NULL) < 0) {
-                error_report("Could not enable split IRQ mode.");
-                exit(1);
+                error_report_exit("Could not enable split IRQ mode.");
             }
         }
     }
@@ -3250,9 +3249,8 @@  int kvm_arch_irqchip_create(MachineState *ms, KVMState *s)
     if (machine_kernel_irqchip_split(ms)) {
         ret = kvm_vm_enable_cap(s, KVM_CAP_SPLIT_IRQCHIP, 0, 24);
         if (ret) {
-            error_report("Could not enable split irqchip mode: %s",
-                         strerror(-ret));
-            exit(1);
+            error_report_exit("Could not enable split irqchip mode: %s",
+                              strerror(-ret));
         } else {
             DPRINTF("Enabled KVM_CAP_SPLIT_IRQCHIP\n");
             kvm_split_irqchip = true;
diff --git a/target-ppc/kvm.c b/target-ppc/kvm.c
index dcb68b9..3e1d6dd 100644
--- a/target-ppc/kvm.c
+++ b/target-ppc/kvm.c
@@ -2062,8 +2062,8 @@  void kvmppc_set_papr(PowerPCCPU *cpu)
 
     ret = kvm_vcpu_enable_cap(cs, KVM_CAP_PPC_PAPR, 0);
     if (ret) {
-        error_report("This vCPU type or KVM version does not support PAPR");
-        exit(1);
+        error_report_exit("This vCPU type or KVM version does "
+                          "not support PAPR");
     }
 
     /* Update the capability flag so we sync the right information
@@ -2083,8 +2083,7 @@  void kvmppc_set_mpic_proxy(PowerPCCPU *cpu, int mpic_proxy)
 
     ret = kvm_vcpu_enable_cap(cs, KVM_CAP_PPC_EPR, 0, mpic_proxy);
     if (ret && mpic_proxy) {
-        error_report("This KVM version does not support EPR");
-        exit(1);
+        error_report_exit("This KVM version does not support EPR");
     }
 }
 
diff --git a/target-s390x/cpu.c b/target-s390x/cpu.c
index e43e2d6..247c08e 100644
--- a/target-s390x/cpu.c
+++ b/target-s390x/cpu.c
@@ -400,9 +400,8 @@  unsigned int s390_cpu_set_state(uint8_t cpu_state, S390CPU *cpu)
         s390_cpu_unhalt(cpu);
         break;
     default:
-        error_report("Requested CPU state is not a valid S390 CPU state: %u",
-                     cpu_state);
-        exit(1);
+        error_report_exit("Requested CPU state is not a valid "
+                          "S390 CPU state: %u", cpu_state);
     }
     if (kvm_enabled() && cpu->env.cpu_state != cpu_state) {
         kvm_s390_set_cpu_state(cpu, cpu_state);
diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c
index 80ac621..0b4501a 100644
--- a/target-s390x/kvm.c
+++ b/target-s390x/kvm.c
@@ -909,8 +909,7 @@  void kvm_s390_vcpu_interrupt(S390CPU *cpu, struct kvm_s390_irq *irq)
         if (!r) {
             return;
         }
-        error_report("KVM failed to inject interrupt %llx", irq->type);
-        exit(1);
+        error_report_exit("KVM failed to inject interrupt %llx", irq->type);
     }
 
     inject_vcpu_irq_legacy(cs, irq);
@@ -2181,9 +2180,8 @@  int kvm_s390_set_cpu_state(S390CPU *cpu, uint8_t cpu_state)
         mp_state.mp_state = KVM_MP_STATE_LOAD;
         break;
     default:
-        error_report("Requested CPU state is not a valid S390 CPU state: %u",
-                     cpu_state);
-        exit(1);
+        error_report_exit("Requested CPU state is not a valid "
+                          "S390 CPU state: %u", cpu_state);
     }
 
     ret = kvm_vcpu_ioctl(CPU(cpu), KVM_SET_MP_STATE, &mp_state);
diff --git a/target-s390x/mmu_helper.c b/target-s390x/mmu_helper.c
index b11a027..a410bfa 100644
--- a/target-s390x/mmu_helper.c
+++ b/target-s390x/mmu_helper.c
@@ -413,8 +413,7 @@  static bool lowprot_enabled(const CPUS390XState *env)
         return !(env->cregs[13] & _ASCE_PRIVATE_SPACE);
     default:
         /* We don't support access register mode */
-        error_report("unsupported addressing mode");
-        exit(1);
+        error_report_exit("unsupported addressing mode");
     }
 }
 
diff --git a/trace/control.c b/trace/control.c
index d173c09..16b0705 100644
--- a/trace/control.c
+++ b/trace/control.c
@@ -192,8 +192,7 @@  static void trace_init_events(const char *fname)
     loc_set_file(fname, 0);
     fp = fopen(fname, "r");
     if (!fp) {
-        error_report("%s", strerror(errno));
-        exit(1);
+        error_report_exit("%s", strerror(errno));
     }
     while (fgets(line_buf, sizeof(line_buf), fp)) {
         loc_set_file(fname, ++line_idx);
@@ -208,8 +207,7 @@  static void trace_init_events(const char *fname)
     }
     if (fclose(fp) != 0) {
         loc_set_file(fname, 0);
-        error_report("%s", strerror(errno));
-        exit(1);
+        error_report_exit("%s", strerror(errno));
     }
     loc_pop(&loc);
 }
diff --git a/ui/spice-core.c b/ui/spice-core.c
index da05054..e4cdeb2 100644
--- a/ui/spice-core.c
+++ b/ui/spice-core.c
@@ -332,8 +332,7 @@  static int parse_name(const char *string, const char *optname,
     if (value != -1) {
         return value;
     }
-    error_report("spice: invalid %s: %s", optname, string);
-    exit(1);
+    error_report_exit("spice: invalid %s: %s", optname, string);
 }
 
 static const char *stream_video_names[] = {
@@ -603,9 +602,8 @@  static int add_channel(void *opaque, const char *name, const char *value,
     if (strcmp(name, "tls-channel") == 0) {
         int *tls_port = opaque;
         if (!*tls_port) {
-            error_report("spice: tried to setup tls-channel"
-                         " without specifying a TLS port");
-            exit(1);
+            error_report_exit("spice: tried to setup tls-channel"
+                              " without specifying a TLS port");
         }
         security = SPICE_CHANNEL_SECURITY_SSL;
     }
@@ -621,8 +619,8 @@  static int add_channel(void *opaque, const char *name, const char *value,
         rc = spice_server_set_channel_security(spice_server, value, security);
     }
     if (rc != 0) {
-        error_report("spice: failed to set channel security for %s", value);
-        exit(1);
+        error_report_exit("spice: failed to set channel security for %s",
+                          value);
     }
     return 0;
 }
@@ -660,12 +658,10 @@  void qemu_spice_init(void)
     port = qemu_opt_get_number(opts, "port", 0);
     tls_port = qemu_opt_get_number(opts, "tls-port", 0);
     if (port < 0 || port > 65535) {
-        error_report("spice port is out of range");
-        exit(1);
+        error_report_exit("spice port is out of range");
     }
     if (tls_port < 0 || tls_port > 65535) {
-        error_report("spice tls-port is out of range");
-        exit(1);
+        error_report_exit("spice tls-port is out of range");
     }
     password = qemu_opt_get(opts, "password");
 
@@ -735,8 +731,7 @@  void qemu_spice_init(void)
     }
     if (qemu_opt_get_bool(opts, "sasl", 0)) {
         if (spice_server_set_sasl(spice_server, 1) == -1) {
-            error_report("spice: failed to enable sasl");
-            exit(1);
+            error_report_exit("spice: failed to enable sasl");
         }
         auth = "sasl";
     }
@@ -753,9 +748,8 @@  void qemu_spice_init(void)
 #if SPICE_SERVER_VERSION >= 0x000c04
         spice_server_set_agent_file_xfer(spice_server, false);
 #else
-        error_report("this qemu build does not support the "
-                     "\"disable-agent-file-xfer\" option");
-        exit(1);
+        error_report_exit("this qemu build does not support the "
+                          "\"disable-agent-file-xfer\" option");
 #endif
     }
 
@@ -802,8 +796,7 @@  void qemu_spice_init(void)
     spice_server_set_seamless_migration(spice_server, seamless_migration);
     spice_server_set_sasl_appname(spice_server, "qemu");
     if (spice_server_init(spice_server, &core_interface) != 0) {
-        error_report("failed to initialize spice server");
-        exit(1);
+        error_report_exit("failed to initialize spice server");
     };
     using_spice = 1;
 
@@ -829,13 +822,12 @@  void qemu_spice_init(void)
 #ifdef HAVE_SPICE_GL
     if (qemu_opt_get_bool(opts, "gl", 0)) {
         if ((port != 0) || (tls_port != 0)) {
-            error_report("SPICE GL support is local-only for now and "
-                         "incompatible with -spice port/tls-port");
-            exit(1);
+            error_report_exit("SPICE GL support is local-only for now and "
+                              "incompatible with -spice port/tls-port");
         }
         if (egl_rendernode_init() != 0) {
-            error_report("Failed to initialize EGL render node for SPICE GL");
-            exit(1);
+            error_report_exit("Failed to initialize EGL render "
+                              "node for SPICE GL");
         }
         display_opengl = 1;
     }
@@ -846,8 +838,7 @@  int qemu_spice_add_interface(SpiceBaseInstance *sin)
 {
     if (!spice_server) {
         if (QTAILQ_FIRST(&qemu_spice_opts.head) != NULL) {
-            error_report("Oops: spice configured but not active");
-            exit(1);
+            error_report_exit("Oops: spice configured but not active");
         }
         /*
          * Create a spice server instance.
diff --git a/vl.c b/vl.c
index c4eeaff..7f14ab0 100644
--- a/vl.c
+++ b/vl.c
@@ -866,8 +866,7 @@  static void configure_rtc(QemuOpts *opts)
         } else if (!strcmp(value, "vm")) {
             rtc_clock = QEMU_CLOCK_VIRTUAL;
         } else {
-            error_report("invalid option value '%s'", value);
-            exit(1);
+            error_report_exit("invalid option value '%s'", value);
         }
     }
     value = qemu_opt_get(opts, "driftfix");
@@ -883,8 +882,7 @@  static void configure_rtc(QemuOpts *opts)
         } else if (!strcmp(value, "none")) {
             /* discard is default */
         } else {
-            error_report("invalid option value '%s'", value);
-            exit(1);
+            error_report_exit("invalid option value '%s'", value);
         }
     }
 }
@@ -1219,31 +1217,26 @@  static void smp_parse(QemuOpts *opts)
             threads = cpus / (cores * sockets);
             threads = threads > 0 ? threads : 1;
         } else if (sockets * cores * threads < cpus) {
-            error_report("cpu topology: "
-                         "sockets (%u) * cores (%u) * threads (%u) < "
-                         "smp_cpus (%u)",
-                         sockets, cores, threads, cpus);
-            exit(1);
+            error_report_exit("cpu topology: "
+                              "sockets (%u) * cores (%u) * threads (%u) < "
+                              "smp_cpus (%u)", sockets, cores, threads, cpus);
         }
 
         max_cpus = qemu_opt_get_number(opts, "maxcpus", cpus);
 
         if (max_cpus > MAX_CPUMASK_BITS) {
-            error_report("unsupported number of maxcpus");
-            exit(1);
+            error_report_exit("unsupported number of maxcpus");
         }
 
         if (max_cpus < cpus) {
-            error_report("maxcpus must be equal to or greater than smp");
-            exit(1);
+            error_report_exit("maxcpus must be equal to or greater than smp");
         }
 
         if (sockets * cores * threads > max_cpus) {
-            error_report("cpu topology: "
-                         "sockets (%u) * cores (%u) * threads (%u) > "
-                         "maxcpus (%u)",
-                         sockets, cores, threads, max_cpus);
-            exit(1);
+            error_report_exit("cpu topology: "
+                              "sockets (%u) * cores (%u) * threads (%u) > "
+                              "maxcpus (%u)", sockets, cores,
+                              threads, max_cpus);
         }
 
         smp_cpus = cpus;
@@ -1262,8 +1255,7 @@  static void realtime_init(void)
 {
     if (enable_mlock) {
         if (os_mlock() < 0) {
-            error_report("locking memory failed");
-            exit(1);
+            error_report_exit("locking memory failed");
         }
     }
 }
@@ -2025,8 +2017,7 @@  static void select_vgahw(const char *p)
         VGAInterfaceInfo *ti = &vga_interfaces[t];
         if (ti->opt_name && strstart(p, ti->opt_name, &opts)) {
             if (!vga_interface_available(t)) {
-                error_report("%s not available", ti->name);
-                exit(1);
+                error_report_exit("%s not available", ti->name);
             }
             vga_interface_type = t;
             break;
@@ -2034,8 +2025,7 @@  static void select_vgahw(const char *p)
     }
     if (t == VGA_TYPE_MAX) {
     invalid_vga:
-        error_report("unknown vga type: %s", p);
-        exit(1);
+        error_report_exit("unknown vga type: %s", p);
     }
     while (*opts) {
         const char *nextopt;
@@ -2119,28 +2109,24 @@  static DisplayType select_display(const char *p)
                 }
             } else {
             invalid_sdl_args:
-                error_report("invalid SDL option string");
-                exit(1);
+                error_report_exit("invalid SDL option string");
             }
             opts = nextopt;
         }
 #else
-        error_report("SDL support is disabled");
-        exit(1);
+        error_report_exit("SDL support is disabled");
 #endif
     } else if (strstart(p, "vnc", &opts)) {
         if (*opts == '=') {
             vnc_parse(opts + 1, &error_fatal);
         } else {
-            error_report("VNC requires a display argument vnc=<display>");
-            exit(1);
+            error_report_exit("VNC requires a display argument vnc=<display>");
         }
     } else if (strstart(p, "curses", &opts)) {
 #ifdef CONFIG_CURSES
         display = DT_CURSES;
 #else
-        error_report("curses support is disabled");
-        exit(1);
+        error_report_exit("curses support is disabled");
 #endif
     } else if (strstart(p, "gtk", &opts)) {
 #ifdef CONFIG_GTK
@@ -2168,20 +2154,17 @@  static DisplayType select_display(const char *p)
                 }
             } else {
             invalid_gtk_args:
-                error_report("invalid GTK option string");
-                exit(1);
+                error_report_exit("invalid GTK option string");
             }
             opts = nextopt;
         }
 #else
-        error_report("GTK support is disabled");
-        exit(1);
+        error_report_exit("GTK support is disabled");
 #endif
     } else if (strstart(p, "none", &opts)) {
         display = DT_NONE;
     } else {
-        error_report("unknown display type");
-        exit(1);
+        error_report_exit("unknown display type");
     }
 
     return display;
@@ -2355,8 +2338,7 @@  static int mon_init_func(void *opaque, QemuOpts *opts, Error **errp)
     } else if (strcmp(mode, "control") == 0) {
         flags = MONITOR_USE_CONTROL;
     } else {
-        error_report("unknown monitor mode \"%s\"", mode);
-        exit(1);
+        error_report_exit("unknown monitor mode \"%s\"", mode);
     }
 
     if (qemu_opt_get_bool(opts, "pretty", 0))
@@ -2368,8 +2350,7 @@  static int mon_init_func(void *opaque, QemuOpts *opts, Error **errp)
     chardev = qemu_opt_get(opts, "chardev");
     chr = qemu_chr_find(chardev);
     if (chr == NULL) {
-        error_report("chardev \"%s\" not found", chardev);
-        exit(1);
+        error_report_exit("chardev \"%s\" not found", chardev);
     }
 
     qemu_chr_fe_claim_no_fail(chr);
@@ -2395,8 +2376,7 @@  static void monitor_parse(const char *optarg, const char *mode, bool pretty)
         }
         opts = qemu_chr_parse_compat(label, optarg);
         if (!opts) {
-            error_report("parse error: %s", optarg);
-            exit(1);
+            error_report_exit("parse error: %s", optarg);
         }
     }
 
@@ -2465,8 +2445,7 @@  static int serial_parse(const char *devname)
     if (strcmp(devname, "none") == 0)
         return 0;
     if (index == MAX_SERIAL_PORTS) {
-        error_report("too many serial ports");
-        exit(1);
+        error_report_exit("too many serial ports");
     }
     snprintf(label, sizeof(label), "serial%d", index);
     serial_hds[index] = qemu_chr_new(label, devname, NULL);
@@ -2487,8 +2466,7 @@  static int parallel_parse(const char *devname)
     if (strcmp(devname, "none") == 0)
         return 0;
     if (index == MAX_PARALLEL_PORTS) {
-        error_report("too many parallel ports");
-        exit(1);
+        error_report_exit("too many parallel ports");
     }
     snprintf(label, sizeof(label), "parallel%d", index);
     parallel_hds[index] = qemu_chr_new(label, devname, NULL);
@@ -2511,8 +2489,7 @@  static int virtcon_parse(const char *devname)
     if (strcmp(devname, "none") == 0)
         return 0;
     if (index == MAX_VIRTIO_CONSOLES) {
-        error_report("too many virtio consoles");
-        exit(1);
+        error_report_exit("too many virtio consoles");
     }
 
     bus_opts = qemu_opts_create(device, NULL, 0, &error_abort);
@@ -2545,8 +2522,7 @@  static int sclp_parse(const char *devname)
         return 0;
     }
     if (index == MAX_SCLP_CONSOLES) {
-        error_report("too many sclp consoles");
-        exit(1);
+        error_report_exit("too many sclp consoles");
     }
 
     assert(arch_type == QEMU_ARCH_S390X);
@@ -2576,8 +2552,7 @@  static int debugcon_parse(const char *devname)
     }
     opts = qemu_opts_create(qemu_find_opts("device"), "debugcon", 1, NULL);
     if (!opts) {
-        error_report("already have a debugcon device");
-        exit(1);
+        error_report_exit("already have a debugcon device");
     }
     qemu_opt_set(opts, "driver", "isa-debugcon", &error_abort);
     qemu_opt_set(opts, "chardev", "debugcon", &error_abort);
@@ -2702,8 +2677,7 @@  static const QEMUOption *lookup_opt(int argc, char **argv,
     popt = qemu_options;
     for(;;) {
         if (!popt->name) {
-            error_report("invalid option");
-            exit(1);
+            error_report_exit("invalid option");
         }
         if (!strcmp(popt->name, r + 1))
             break;
@@ -2711,8 +2685,7 @@  static const QEMUOption *lookup_opt(int argc, char **argv,
     }
     if (popt->flags & HAS_ARG) {
         if (optind >= argc) {
-            error_report("requires an argument");
-            exit(1);
+            error_report_exit("requires an argument");
         }
         optarg = argv[optind++];
         loc_set_cmdline(argv, optind - 2, 2);
@@ -2840,8 +2813,7 @@  static void set_memory_options(uint64_t *ram_slots, ram_addr_t *maxram_size,
     mem_str = qemu_opt_get(opts, "size");
     if (mem_str) {
         if (!*mem_str) {
-            error_report("missing 'size' option value");
-            exit(EXIT_FAILURE);
+            error_report_exit("missing 'size' option value");
         }
 
         sz = qemu_opt_get_size(opts, "size", ram_size);
@@ -2852,8 +2824,7 @@  static void set_memory_options(uint64_t *ram_slots, ram_addr_t *maxram_size,
 
             sz <<= 20;
             if ((sz >> 20) != overflow_check) {
-                error_report("too large 'size' option value");
-                exit(EXIT_FAILURE);
+                error_report_exit("too large 'size' option value");
             }
         }
     }
@@ -2866,8 +2837,7 @@  static void set_memory_options(uint64_t *ram_slots, ram_addr_t *maxram_size,
     sz = QEMU_ALIGN_UP(sz, 8192);
     ram_size = sz;
     if (ram_size != sz) {
-        error_report("ram size too large");
-        exit(EXIT_FAILURE);
+        error_report_exit("ram size too large");
     }
 
     /* store value for the future use */
@@ -2882,32 +2852,30 @@  static void set_memory_options(uint64_t *ram_slots, ram_addr_t *maxram_size,
         sz = qemu_opt_get_size(opts, "maxmem", 0);
         slots = qemu_opt_get_number(opts, "slots", 0);
         if (sz < ram_size) {
-            error_report("invalid value of -m option maxmem: "
-                         "maximum memory size (0x%" PRIx64 ") must be at least "
-                         "the initial memory size (0x" RAM_ADDR_FMT ")",
-                         sz, ram_size);
-            exit(EXIT_FAILURE);
+            error_report_exit("invalid value of -m option maxmem: "
+                              "maximum memory size (0x%" PRIx64 ") must "
+                              "be at least the initial memory size (0x"
+                              RAM_ADDR_FMT ")", sz, ram_size);
         } else if (sz > ram_size) {
             if (!slots) {
-                error_report("invalid value of -m option: maxmem was "
-                             "specified, but no hotplug slots were specified");
-                exit(EXIT_FAILURE);
+                error_report_exit("invalid value of -m option: maxmem was "
+                                  "specified, but no hotplug slots were "
+                                  "specified");
             }
         } else if (slots) {
-            error_report("invalid value of -m option maxmem: "
-                         "memory slots were specified but maximum memory size "
-                         "(0x%" PRIx64 ") is equal to the initial memory size "
-                         "(0x" RAM_ADDR_FMT ")", sz, ram_size);
-            exit(EXIT_FAILURE);
+            error_report_exit("invalid value of -m option maxmem: "
+                              "memory slots were specified but maximum "
+                              "memory size (0x%" PRIx64 ") is equal to "
+                              "the initial memory size (0x" RAM_ADDR_FMT
+                              ")", sz, ram_size);
         }
 
         *maxram_size = sz;
         *ram_slots = slots;
     } else if ((!maxmem_str && slots_str) ||
             (maxmem_str && !slots_str)) {
-        error_report("invalid -m option value: missing "
-                "'%s' option", slots_str ? "maxmem" : "slots");
-        exit(EXIT_FAILURE);
+        error_report_exit("invalid -m option value: missing '%s' option",
+                          slots_str ? "maxmem" : "slots");
     }
 
     loc_pop(&loc);
@@ -3066,8 +3034,7 @@  int main(int argc, char **argv, char **envp)
 
             popt = lookup_opt(argc, argv, &optarg, &optind);
             if (!(popt->arch_mask & arch_type)) {
-                error_report("Option not supported for this target");
-                exit(1);
+                error_report_exit("Option not supported for this target");
             }
             switch(popt->index) {
             case QEMU_OPTION_no_kvm_irqchip: {
@@ -3162,8 +3129,7 @@  int main(int argc, char **argv, char **envp)
                         }
                     } else if (*p != '\0') {
                     chs_fail:
-                        error_report("invalid physical CHS format");
-                        exit(1);
+                        error_report_exit("invalid physical CHS format");
                     }
                     if (hda_opts != NULL) {
                         qemu_opt_set_number(hda_opts, "cyls", cyls,
@@ -3208,8 +3174,7 @@  int main(int argc, char **argv, char **envp)
 #ifdef CONFIG_CURSES
                 display_type = DT_CURSES;
 #else
-                error_report("curses support is disabled");
-                exit(1);
+                error_report_exit("curses support is disabled");
 #endif
                 break;
             case QEMU_OPTION_portrait:
@@ -3219,8 +3184,8 @@  int main(int argc, char **argv, char **envp)
                 graphic_rotate = strtol(optarg, (char **) &optarg, 10);
                 if (graphic_rotate != 0 && graphic_rotate != 90 &&
                     graphic_rotate != 180 && graphic_rotate != 270) {
-                    error_report("only 90, 180, 270 deg rotation is available");
-                    exit(1);
+                    error_report_exit("only 90, 180, 270 deg rotation "
+                                      "is available");
                 }
                 break;
             case QEMU_OPTION_kernel:
@@ -3383,8 +3348,7 @@  int main(int argc, char **argv, char **envp)
                     w = strtol(p, (char **)&p, 10);
                     if (w <= 0) {
                     graphic_error:
-                        error_report("invalid resolution or depth");
-                        exit(1);
+                        error_report_exit("invalid resolution or depth");
                     }
                     if (*p != 'x')
                         goto graphic_error;
@@ -3449,8 +3413,7 @@  int main(int argc, char **argv, char **envp)
             case QEMU_OPTION_fsdev:
                 olist = qemu_find_opts("fsdev");
                 if (!olist) {
-                    error_report("fsdev support is disabled");
-                    exit(1);
+                    error_report_exit("fsdev support is disabled");
                 }
                 opts = qemu_opts_parse_noisily(olist, optarg, true);
                 if (!opts) {
@@ -3464,8 +3427,7 @@  int main(int argc, char **argv, char **envp)
 
                 olist = qemu_find_opts("virtfs");
                 if (!olist) {
-                    error_report("virtfs support is disabled");
-                    exit(1);
+                    error_report_exit("virtfs support is disabled");
                 }
                 opts = qemu_opts_parse_noisily(olist, optarg, true);
                 if (!opts) {
@@ -3474,16 +3436,14 @@  int main(int argc, char **argv, char **envp)
 
                 if (qemu_opt_get(opts, "fsdriver") == NULL ||
                     qemu_opt_get(opts, "mount_tag") == NULL) {
-                    error_report("Usage: -virtfs fsdriver,mount_tag=tag");
-                    exit(1);
+                    error_report_exit("Usage: -virtfs fsdriver,mount_tag=tag");
                 }
                 fsdev = qemu_opts_create(qemu_find_opts("fsdev"),
                                          qemu_opt_get(opts, "mount_tag"),
                                          1, NULL);
                 if (!fsdev) {
-                    error_report("duplicate fsdev id: %s",
-                                 qemu_opt_get(opts, "mount_tag"));
-                    exit(1);
+                    error_report_exit("duplicate fsdev id: %s",
+                                      qemu_opt_get(opts, "mount_tag"));
                 }
 
                 writeout = qemu_opt_get(opts, "writeout");
@@ -3491,9 +3451,8 @@  int main(int argc, char **argv, char **envp)
 #ifdef CONFIG_SYNC_FILE_RANGE
                     qemu_opt_set(fsdev, "writeout", writeout, &error_abort);
 #else
-                    error_report("writeout=immediate not supported "
-                                 "on this platform");
-                    exit(1);
+                    error_report_exit("writeout=immediate not supported "
+                                      "on this platform");
 #endif
                 }
                 qemu_opt_set(fsdev, "fsdriver",
@@ -3531,8 +3490,7 @@  int main(int argc, char **argv, char **envp)
                 fsdev = qemu_opts_create(qemu_find_opts("fsdev"), "v_synth",
                                          1, NULL);
                 if (!fsdev) {
-                    error_report("duplicate option: %s", "virtfs_synth");
-                    exit(1);
+                    error_report_exit("duplicate option: %s", "virtfs_synth");
                 }
                 qemu_opt_set(fsdev, "fsdriver", "synth", &error_abort);
 
@@ -3559,8 +3517,7 @@  int main(int argc, char **argv, char **envp)
                 break;
             case QEMU_OPTION_watchdog_action:
                 if (select_watchdog_action(optarg) == -1) {
-                    error_report("unknown -watchdog-action parameter");
-                    exit(1);
+                    error_report_exit("unknown -watchdog-action parameter");
                 }
                 break;
             case QEMU_OPTION_virtiocon:
@@ -3603,8 +3560,7 @@  int main(int argc, char **argv, char **envp)
                 display_type = DT_SDL;
                 break;
 #else
-                error_report("SDL support is disabled");
-                exit(1);
+                error_report_exit("SDL support is disabled");
 #endif
             case QEMU_OPTION_pidfile:
                 pid_file = optarg;
@@ -3709,8 +3665,7 @@  int main(int argc, char **argv, char **envp)
                 break;
             case QEMU_OPTION_balloon:
                 if (balloon_parse(optarg) < 0) {
-                    error_report("unknown -balloon argument %s", optarg);
-                    exit(1);
+                    error_report_exit("unknown -balloon argument %s", optarg);
                 }
                 break;
             case QEMU_OPTION_no_reboot:
@@ -3724,15 +3679,14 @@  int main(int argc, char **argv, char **envp)
                 break;
             case QEMU_OPTION_uuid:
                 if(qemu_uuid_parse(optarg, qemu_uuid) < 0) {
-                    error_report("failed to parse UUID string: wrong format");
-                    exit(1);
+                    error_report_exit("failed to parse UUID string: "
+                                      "wrong format");
                 }
                 qemu_uuid_set = true;
                 break;
             case QEMU_OPTION_option_rom:
                 if (nb_option_roms >= MAX_OPTION_ROMS) {
-                    error_report("too many option ROMs");
-                    exit(1);
+                    error_report_exit("too many option ROMs");
                 }
                 opts = qemu_opts_parse_noisily(qemu_find_opts("option-rom"),
                                                optarg, true);
@@ -3743,8 +3697,7 @@  int main(int argc, char **argv, char **envp)
                 option_rom[nb_option_roms].bootindex =
                     qemu_opt_get_number(opts, "bootindex", -1);
                 if (!option_rom[nb_option_roms].name) {
-                    error_report("Option ROM file is not specified");
-                    exit(1);
+                    error_report_exit("Option ROM file is not specified");
                 }
                 nb_option_roms++;
                 break;
@@ -3768,9 +3721,8 @@  int main(int argc, char **argv, char **envp)
                         } else  if (strcmp("auto", target) == 0) {
                             semihosting.target = SEMIHOSTING_TARGET_AUTO;
                         } else {
-                            error_report("unsupported semihosting-config %s",
-                                         optarg);
-                            exit(1);
+                            error_report_exit("unsupported semihosting-config "
+                                              "%s", optarg);
                         }
                     } else {
                         semihosting.target = SEMIHOSTING_TARGET_AUTO;
@@ -3779,8 +3731,8 @@  int main(int argc, char **argv, char **envp)
                     qemu_opt_foreach(opts, add_semihosting_arg,
                                      &semihosting, NULL);
                 } else {
-                    error_report("unsupported semihosting-config %s", optarg);
-                    exit(1);
+                    error_report_exit("unsupported semihosting-config %s",
+                                      optarg);
                 }
                 break;
             case QEMU_OPTION_tdf:
@@ -3795,8 +3747,7 @@  int main(int argc, char **argv, char **envp)
                 break;
             case QEMU_OPTION_prom_env:
                 if (nb_prom_envs >= MAX_PROM_ENVS) {
-                    error_report("too many prom variables");
-                    exit(1);
+                    error_report_exit("too many prom variables");
                 }
                 prom_envs[nb_prom_envs] = optarg;
                 nb_prom_envs++;
@@ -3844,22 +3795,19 @@  int main(int argc, char **argv, char **envp)
                 break;
             case QEMU_OPTION_xen_domid:
                 if (!(xen_available())) {
-                    error_report("Option not supported for this target");
-                    exit(1);
+                    error_report_exit("Option not supported for this target");
                 }
                 xen_domid = atoi(optarg);
                 break;
             case QEMU_OPTION_xen_create:
                 if (!(xen_available())) {
-                    error_report("Option not supported for this target");
-                    exit(1);
+                    error_report_exit("Option not supported for this target");
                 }
                 xen_mode = XEN_CREATE;
                 break;
             case QEMU_OPTION_xen_attach:
                 if (!(xen_available())) {
-                    error_report("Option not supported for this target");
-                    exit(1);
+                    error_report_exit("Option not supported for this target");
                 }
                 xen_mode = XEN_ATTACH;
                 break;
@@ -3871,17 +3819,15 @@  int main(int argc, char **argv, char **envp)
                 {
                     int ret = qemu_read_config_file(optarg);
                     if (ret < 0) {
-                        error_report("read config %s: %s", optarg,
-                                     strerror(-ret));
-                        exit(1);
+                        error_report_exit("read config %s: %s", optarg,
+                                          strerror(-ret));
                     }
                     break;
                 }
             case QEMU_OPTION_spice:
                 olist = qemu_find_opts("spice");
                 if (!olist) {
-                    error_report("spice support is disabled");
-                    exit(1);
+                    error_report_exit("spice support is disabled");
                 }
                 opts = qemu_opts_parse_noisily(olist, optarg, false);
                 if (!opts) {
@@ -3897,9 +3843,8 @@  int main(int argc, char **argv, char **envp)
                     } else {
                         fp = fopen(optarg, "w");
                         if (fp == NULL) {
-                            error_report("open %s: %s", optarg,
-                                         strerror(errno));
-                            exit(1);
+                            error_report_exit("open %s: %s", optarg,
+                                              strerror(errno));
                         }
                     }
                     qemu_config_write(fp);
@@ -3929,9 +3874,8 @@  int main(int argc, char **argv, char **envp)
                     exit(1);
                 }
 #else
-                error_report("File descriptor passing is disabled on this "
-                             "platform");
-                exit(1);
+                error_report_exit("File descriptor passing is disabled on this "
+                                  "platform");
 #endif
                 break;
             case QEMU_OPTION_object:
@@ -3959,14 +3903,12 @@  int main(int argc, char **argv, char **envp)
                 break;
             case QEMU_OPTION_dump_vmstate:
                 if (vmstate_dump_file) {
-                    error_report("only one '-dump-vmstate' "
-                                 "option may be given");
-                    exit(1);
+                    error_report_exit("only one '-dump-vmstate' "
+                                      "option may be given");
                 }
                 vmstate_dump_file = fopen(optarg, "w");
                 if (vmstate_dump_file == NULL) {
-                    error_report("open %s: %s", optarg, strerror(errno));
-                    exit(1);
+                    error_report_exit("open %s: %s", optarg, strerror(errno));
                 }
                 break;
             default:
@@ -4081,10 +4023,10 @@  int main(int argc, char **argv, char **envp)
 
     machine_class->max_cpus = machine_class->max_cpus ?: 1; /* Default to UP */
     if (max_cpus > machine_class->max_cpus) {
-        error_report("Number of SMP CPUs requested (%d) exceeds max CPUs "
-                     "supported by machine '%s' (%d)", max_cpus,
-                     machine_class->name, machine_class->max_cpus);
-        exit(1);
+        error_report_exit("Number of SMP CPUs requested (%d) exceeds max CPUs "
+                          "supported by machine '%s' (%d)",
+                          max_cpus, machine_class->name,
+                          machine_class->max_cpus);
     }
 
     /*
@@ -4144,13 +4086,11 @@  int main(int argc, char **argv, char **envp)
         if (nographic
             && (default_parallel || default_serial
                 || default_monitor || default_virtcon)) {
-            error_report("-nographic cannot be used with -daemonize");
-            exit(1);
+            error_report_exit("-nographic cannot be used with -daemonize");
         }
 #ifdef CONFIG_CURSES
         if (display_type == DT_CURSES) {
-            error_report("curses display cannot be used with -daemonize");
-            exit(1);
+            error_report_exit("curses display cannot be used with -daemonize");
         }
 #endif
     }
@@ -4229,9 +4169,8 @@  int main(int argc, char **argv, char **envp)
 #if defined(CONFIG_OPENGL)
         error_report("OpenGL is not supported by the display");
 #else
-        error_report("OpenGL support is disabled");
+        error_report_exit("OpenGL support is disabled");
 #endif
-        exit(1);
     }
 
     page_size_init();
@@ -4256,8 +4195,7 @@  int main(int argc, char **argv, char **envp)
 #endif
 
     if (pid_file && qemu_create_pidfile(pid_file) != 0) {
-        error_report("could not acquire pid file: %s", strerror(errno));
-        exit(1);
+        error_report_exit("could not acquire pid file: %s", strerror(errno));
     }
 
     if (qemu_opts_foreach(qemu_find_opts("device"),
@@ -4312,18 +4250,15 @@  int main(int argc, char **argv, char **envp)
     linux_boot = (kernel_filename != NULL);
 
     if (!linux_boot && *kernel_cmdline != '\0') {
-        error_report("-append only allowed with -kernel option");
-        exit(1);
+        error_report_exit("-append only allowed with -kernel option");
     }
 
     if (!linux_boot && initrd_filename != NULL) {
-        error_report("-initrd only allowed with -kernel option");
-        exit(1);
+        error_report_exit("-initrd only allowed with -kernel option");
     }
 
     if (!linux_boot && qemu_opt_get(machine_opts, "dtb")) {
-        error_report("-dtb only allowed with -kernel option");
-        exit(1);
+        error_report_exit("-dtb only allowed with -kernel option");
     }
 
     if (semihosting_enabled() && !semihosting_get_argc() && kernel_filename) {
@@ -4339,8 +4274,7 @@  int main(int argc, char **argv, char **envp)
     cpu_ticks_init();
     if (icount_opts) {
         if (kvm_enabled() || xen_enabled()) {
-            error_report("-icount is not allowed with kvm or xen");
-            exit(1);
+            error_report_exit("-icount is not allowed with kvm or xen");
         }
         configure_icount(icount_opts, &error_abort);
         qemu_opts_del(icount_opts);
@@ -4377,8 +4311,7 @@  int main(int argc, char **argv, char **envp)
     if (!xen_enabled()) {
         /* On 32-bit hosts, QEMU is limited by virtual address space */
         if (ram_size > (2047 << 20) && HOST_LONG_BITS == 32) {
-            error_report("at most 2047 MB RAM can be simulated");
-            exit(1);
+            error_report_exit("at most 2047 MB RAM can be simulated");
         }
     }
 
@@ -4561,8 +4494,7 @@  int main(int argc, char **argv, char **envp)
     qemu_run_machine_init_done_notifiers();
 
     if (rom_check_and_register_reset() != 0) {
-        error_report("rom check and register reset failed");
-        exit(1);
+        error_report_exit("rom check and register reset failed");
     }
 
     replay_start();
diff --git a/xen-hvm.c b/xen-hvm.c
index 3b0343a..24e9a1d 100644
--- a/xen-hvm.c
+++ b/xen-hvm.c
@@ -1323,8 +1323,7 @@  void xen_hvm_init(PCMachineState *pcms, MemoryRegion **ram_memory)
     return;
 
 err:
-    error_report("xen hardware virtual machine initialisation failed");
-    exit(1);
+    error_report_exit("xen hardware virtual machine initialisation failed");
 }
 
 void destroy_hvm_domain(bool reboot)