qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v4 0/4] Introduce error_report_{fatal|abort}
@ 2016-09-07  6:06 Peter Xu
  2016-09-07  6:06 ` [Qemu-devel] [PATCH v4 1/4] error-report: provide error_report_fatal() Peter Xu
                   ` (6 more replies)
  0 siblings, 7 replies; 17+ messages in thread
From: Peter Xu @ 2016-09-07  6:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: armbru, peter.maydell, pbonzini, famz, peterx

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}(...);

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

-- 
2.7.4

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2016-09-13  6:44 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).