From: "Alex Bennée" <alex.bennee@linaro.org>
To: Peter Xu <peterx@redhat.com>
Cc: qemu-devel@nongnu.org, peter.maydell@linaro.org, famz@redhat.com,
armbru@redhat.com, pbonzini@redhat.com
Subject: Re: [Qemu-devel] [PATCH v4 0/4] Introduce error_report_{fatal|abort}
Date: Wed, 07 Sep 2016 10:23:11 +0100 [thread overview]
Message-ID: <87bn00ysg0.fsf@linaro.org> (raw)
In-Reply-To: <1473228390-18669-1-git-send-email-peterx@redhat.com>
Peter Xu <peterx@redhat.com> writes:
> v4 changes:
> - remove two standard headers since they are included in osdep.h
> already [Fam]
> - make sure it passes build on all platforms (no --target-list
> specified during configure)
>
> v3 changes:
> - implement error_report_fatal using function [Markus]
> - provide error_report_abort as well in seperate patch [Markus, Fam]
>
> We have many use cases that first print some error messages, then
> quit (by either exit() or abort()). This series introduce two helper
> functions for that.
>
> The old formats are mostly one of the following:
>
> Case one:
>
> error_report(...);
> exit(1|EXIT_FAILURE) | abort();
>
> Case two:
>
> error_setg(&error_{fatal|abort}, ...);
>
> And we can convert either of the above cases into:
>
> error_report_{fatal|abort}(...);
Last time I needed to do error reporting I was told the error_setg
method was the correct way to do it and the report/exit case made sense
only in the top level. Before we add even more error reporting
primitives can we update HACKING (or possibly add somethings to docs/)
that describes when and where the various error report mechanisms should
be used?
>
> Two coccinelle scripts are created to help automate the work, plus
> some manual tweaks:
>
> 1. very long strings, fix for over-80-chars issues, to make sure it
> passes checkpatch.pl.
>
> 2. add "return XXX" for some non-void retcode functions.
>
> The first two patches introduce the functions. The latter two apply
> them.
>
> Peter Xu (4):
> error-report: provide error_report_fatal()
> error-report: provide error_report_abort()
> error-report: leverage error_report_fatal()
> error-report: leverage error_report_abort()
>
> arch_init.c | 8 +-
> block/qcow2.c | 4 +-
> bootdevice.c | 4 +-
> cpus.c | 3 +-
> device_tree.c | 61 +++---
> 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 | 9 +-
> hw/arm/strongarm.c | 6 +-
> hw/arm/sysbus-fdt.c | 41 ++--
> hw/arm/vexpress.c | 14 +-
> hw/arm/virt.c | 45 ++---
> hw/arm/xlnx-ep108.c | 10 +-
> hw/block/fdc.c | 6 +-
> hw/block/tc58128.c | 3 +-
> hw/block/virtio-blk.c | 9 +-
> hw/char/exynos4210_uart.c | 9 +-
> hw/core/machine.c | 7 +-
> hw/core/platform-bus.c | 8 +-
> hw/i386/intel_iommu.c | 5 +-
> hw/i386/kvm/pci-assign.c | 4 +-
> 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.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 | 6 +-
> hw/net/virtio-net.c | 28 ++-
> hw/nvram/fw_cfg.c | 5 +-
> hw/pci/pci.c | 8 +-
> hw/ppc/e500.c | 5 +-
> hw/ppc/mac_newworld.c | 14 +-
> hw/ppc/mac_oldworld.c | 18 +-
> hw/ppc/mpc8544ds.c | 4 +-
> hw/ppc/ppc405_boards.c | 14 +-
> hw/ppc/prep.c | 11 +-
> hw/ppc/spapr.c | 89 ++++-----
> hw/ppc/spapr_drc.c | 2 +-
> 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 | 42 ++---
> hw/sparc/sun4m.c | 19 +-
> hw/tricore/tricore_testboard.c | 8 +-
> hw/unicore32/puv3.c | 9 +-
> hw/vfio/platform.c | 10 +-
> hw/virtio/virtio.c | 45 ++---
> hw/xtensa/sim.c | 5 +-
> hw/xtensa/xtfpga.c | 17 +-
> include/qemu/error-report.h | 2 +
> net/netmap.c | 5 +-
> net/tap-linux.c | 10 +-
> numa.c | 22 +--
> qemu-img.c | 16 +-
> qemu-io.c | 9 +-
> qemu-nbd.c | 116 +++++-------
> replay/replay-char.c | 9 +-
> replay/replay-events.c | 12 +-
> replay/replay-internal.c | 4 +-
> replay/replay-time.c | 5 +-
> replay/replay.c | 9 +-
> scripts/coccinelle/error_report_abort.cocci | 14 ++
> scripts/coccinelle/error_report_fatal.cocci | 20 ++
> target-arm/machine.c | 5 +-
> target-i386/kvm.c | 10 +-
> target-ppc/kvm.c | 7 +-
> target-ppc/translate_init.c | 3 +-
> target-s390x/cpu.c | 5 +-
> target-s390x/kvm.c | 8 +-
> target-s390x/mmu_helper.c | 5 +-
> trace/control.c | 6 +-
> ui/spice-core.c | 43 ++---
> util/qemu-error.c | 22 +++
> vl.c | 279 +++++++++++-----------------
> xen-hvm.c | 3 +-
> 88 files changed, 622 insertions(+), 831 deletions(-)
> create mode 100644 scripts/coccinelle/error_report_abort.cocci
> create mode 100644 scripts/coccinelle/error_report_fatal.cocci
--
Alex Bennée
next prev parent reply other threads:[~2016-09-07 9:23 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-07 6:06 [Qemu-devel] [PATCH v4 0/4] Introduce error_report_{fatal|abort} Peter Xu
2016-09-07 6:06 ` [Qemu-devel] [PATCH v4 1/4] error-report: provide error_report_fatal() Peter Xu
2016-09-07 6:06 ` [Qemu-devel] [PATCH v4 2/4] error-report: provide error_report_abort() Peter Xu
2016-09-07 6:06 ` [Qemu-devel] [PATCH v4 3/4] error-report: leverage error_report_fatal() Peter Xu
2016-09-07 6:06 ` [Qemu-devel] [PATCH v4 4/4] error-report: leverage error_report_abort() Peter Xu
2016-09-07 6:39 ` [Qemu-devel] [PATCH v4 0/4] Introduce error_report_{fatal|abort} Fam Zheng
2016-09-07 9:23 ` Alex Bennée [this message]
2016-09-07 9:33 ` Fam Zheng
2016-09-07 10:42 ` Peter Xu
2016-09-07 12:39 ` Lluís Vilanova
2016-09-07 13:48 ` Markus Armbruster
2016-09-09 17:05 ` Markus Armbruster
2016-09-09 17:19 ` Daniel P. Berrange
2016-09-12 8:02 ` Markus Armbruster
2016-09-12 5:33 ` Peter Xu
2016-09-12 19:49 ` Eric Blake
2016-09-13 6:44 ` Markus Armbruster
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87bn00ysg0.fsf@linaro.org \
--to=alex.bennee@linaro.org \
--cc=armbru@redhat.com \
--cc=famz@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=peterx@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.