Skip to content

Introduce error_report_{fatal|abort}

Peter Xu qemu-devel 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest4 patches 12 repliesIn review
  2. v34 patches 3 repliesSuperseded
  3. v21 patch 3 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v12 patches13 repliesSuperseded

Changes in v4 from the cover letter

- 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)

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4error-report: provide error_report_fatal()include/qemu/error-report.h util/qemu-error.c+12 -00 replies
2/4error-report: provide error_report_abort()include/qemu/error-report.h util/qemu-error.c+12 -00 replies
3/4error-report: leverage error_report_fatal()arch_init.c bootdevice.c cpus.c +73 more+557 -7990 replies
4/4error-report: leverage error_report_abort()block/qcow2.c hw/block/fdc.c hw/i386/kvm/pci-assign.c +9 more+41 -320 replies

Reviews trailers per patch

None of the 4 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchFam Zheng
SeriesR-b
1/4
2/4
3/4
4/4

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [Qemu-devel] [PATCH v4 0/4] Introduce error_report_{fatal|abort}

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
Signature · 1 line
2.7.4