Skip to content

Replace some unwise uses of error_report() & friends

Markus Armbruster qemu-devel 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest38 patches 13 repliesIn review
  2. v338 patches 6 repliesSuperseded
  3. v235 patches 14 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v131 patches58 repliesSuperseded

Changes in v4 from the cover letter

* PATCH 36-37: Unbreak qemu-iotests [Eric]

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/38error: Fix use of error_prepend() with &error_fatal, &error_abortblock.c block/qcow2.c block/qed.c +10 more+61 -330 replies
2/38Use error_fatal to simplify obvious fatal errors (again)hw/intc/xics_kvm.c qemu-nbd.c scripts/coccinelle/use-error_fatal.cocci +1 more+23 -170 replies
3/38block: Use warn_report() & friends to report warningsblock/bochs.c block/cloop.c block/dmg.c +4 more+24 -243 replies
4/38cpus hw target: Use warn_report() & friends to report warningscpus.c hw/display/cg3.c hw/display/tcx.c +5 more+25 -240 replies
5/38vfio: Use warn_report() & friends to report warningshw/vfio/pci.c hw/vfio/platform.c include/hw/vfio/vfio-common.h+10 -100 replies
6/38vfio: Clean up error reporting after previous commithw/vfio/pci-quirks.c hw/vfio/pci.c hw/vfio/platform.c +1 more+7 -80 replies
7/38char: Use error_printf() to print help and suchchardev/char-pty.c chardev/char.c+2 -20 replies
8/389pfs: Fix CLI parsing crash on errorhw/9pfs/9p-handle.c+4 -20 replies
9/38pc: Fix machine property nvdimm-persistence error handlinghw/i386/pc.c+3 -20 replies
10/38ioapic: Fix error handling in realize()hw/intc/ioapic.c+4 -40 replies
11/38smbios: Clean up error handling in smbios_add()hw/smbios/smbios.c+62 -280 replies
12/38migration: Fix !replay_can_snapshot() error handlingmigration/savevm.c+4 -40 replies
13/38l2tpv3: Improve -netdev/netdev_add/-net/... error reportingnet/l2tpv3.c+12 -130 replies
14/38net/socket: Fix invalid socket type error handlingnet/socket.c+2 -20 replies
15/38numa: Fix QMP command set-numa-node error handlingnuma.c+9 -40 replies
16/38xen/pt: Fix incomplete conversion to realize()hw/xen/xen_pt.c+1 -10 replies
17/38seccomp: Clean up error reporting in parse_sandbox()qemu-seccomp.c vl.c+11 -110 replies
18/38vl: Clean up error reporting in parse_add_fd()vl.c+9 -130 replies
19/38qom: Clean up error reporting in user_creatable_add_opts_foreach()qemu-io.c qemu-nbd.c qom/object_interfaces.c +1 more+13 -230 replies
20/38vl: Clean up error reporting in chardev_init_func()vl.c+3 -50 replies
21/38vl: Clean up error reporting in machine_set_property()vl.c+3 -60 replies
22/38vl: Clean up error reporting in mon_init_func()vl.c+6 -80 replies
23/38vl: Clean up error reporting in parse_fw_cfg()vl.c+8 -90 replies
24/38vl: Clean up error reporting in device_init_func()vl.c+3 -70 replies
25/38ui/keymaps: Fix handling of erroneous include filesui/keymaps.c+23 -121 reply
26/38ui: Convert vnc_display_init(), init_keyboard_layout() to Errorinclude/ui/console.h ui/curses.c ui/keymaps.c +3 more+24 -181 reply
27/38vnc: Clean up error reporting in vnc_init_func()ui/vnc.c vl.c+5 -51 reply
28/38numa: Clean up error reporting in parse_numa()include/sysemu/numa.h numa.c+3 -60 replies
29/38tpm: Clean up error reporting in tpm_init_tpmdev()include/sysemu/tpm.h stubs/tpm.c tpm.c +1 more+12 -190 replies
30/38spice: Clean up error reporting in add_channel()ui/spice-core.c+7 -61 reply
31/38fsdev: Clean up error reporting in qemu_fsdev_add()fsdev/qemu-fsdev-dummy.c fsdev/qemu-fsdev.c fsdev/qemu-fsdev.h +2 more+16 -150 replies
32/38vl: Assert drive_new() does not fail in default_drive()vl.c+1 -30 replies
33/38blockdev: Convert drive_new() to Errorblockdev.c device-hotplug.c include/sysemu/blockdev.h +1 more+24 -190 replies
34/38vl: Fix exit status for -drive format=helpvl.c+1 -10 replies
35/38vl: Simplify call of parse_name()vl.c+2 -40 replies
36/38block: Clean up bdrv_img_create()'s error reportingblock.c tests/qemu-iotests/049.out+4 -111 reply
37/38raw: Convert a warning to warn_report()block/raw-format.c tests/qemu-iotests/099 tests/qemu-iotests/109.out+44 -313 replies
38/38vpc: Fail open on bad header checksumblock/vpc.c+5 -32 replies

Reviews trailers per patch

36 of 38 patches have a Reviewed-by or Acked-by.

PatchMarc-André LureauPaolo BonziniPhilippe Mathieu-DaudéEric BlakeDavid GibsonGreg KurzIgor MammedovAnthony PERARDAlex WilliamsonEduardo HabkostMax ReitzStefan BergerPeter XuEduardo OtuboAlex BennéeKevin WolfGerd Hoffmann
1/38R-b R-b
2/38R-b A-b
3/38R-b R-b
4/38A-b R-b
5/38R-b A-b
6/38A-b
7/38R-b
8/38R-b A-b
9/38R-b
10/38R-b R-b
11/38R-b A-b
12/38R-b
13/38R-b
14/38R-b
15/38R-b
16/38A-b
17/38R-b A-b
18/38R-b
19/38R-b R-b
20/38R-b R-b
21/38R-b R-b
22/38R-b R-b
23/38R-b
24/38R-b
25/38R-b
26/38R-b R-b
27/38R-b R-b
28/38R-b
29/38R-b R-b R-b
30/38R-b R-b
31/38A-b
32/38R-b R-b
33/38R-b R-b R-b
34/38
35/38R-b
36/38R-b R-b
37/38
38/38R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 17 reviewers.

Read the v4 thread

Cover letter [Qemu-devel] [PATCH v4 00/38] Replace some unwise uses of error_report() & friends

Calling error_report() or similar in a function that takes an Error ** argument is suspicious. Fix a number of instances that are actually wrong. Clean up a few more that are merely fragile / bad examples.

v4:
* PATCH 36-37: Unbreak qemu-iotests [Eric]

v3:
* PATCH 27: Drop useless error message prefix [Gerd]
* PATCH 36-38: New

v2:
* PATCH 01: New
* PATCH 02: Commit hash corrected in commit message [Eric]
* PATCH 13: Error messages tidied up [Marc-André]
* PATCH 15: Commit message tidied up [Eduardo H.]
* PATCH 16: Unwanted string split fixed [Marc-André, Eduardo O.]
* PATCH 20: Commit message corrected [Marc-André]
* PATCH 25-26: New
* PATCH 27: Rebased, commit message corrected
* PATCH 30: Commit message tidied up [Eric]
* PATCH 32: Less confusing commit message, help fixed [Max]
* PATCH 34: New

Fei Li (1):
ui: Convert vnc_display_init(), init_keyboard_layout() to Error

Markus Armbruster (37):
error: Fix use of error_prepend() with &error_fatal, &error_abort Use error_fatal to simplify obvious fatal errors (again)
block: Use warn_report() & friends to report warnings cpus hw target: Use warn_report() & friends to report warnings
vfio: Use warn_report() & friends to report warnings
vfio: Clean up error reporting after previous commit
char: Use error_printf() to print help and such
9pfs: Fix CLI parsing crash on error
pc: Fix machine property nvdimm-persistence error handling
ioapic: Fix error handling in realize()
smbios: Clean up error handling in smbios_add()
migration: Fix !replay_can_snapshot() error handling
l2tpv3: Improve -netdev/netdev_add/-net/... error reporting net/socket: Fix invalid socket type error handling
numa: Fix QMP command set-numa-node error handling xen/pt: Fix incomplete conversion to realize()
seccomp: Clean up error reporting in parse_sandbox()
vl: Clean up error reporting in parse_add_fd()
qom: Clean up error reporting in user_creatable_add_opts_foreach()
vl: Clean up error reporting in chardev_init_func()
vl: Clean up error reporting in machine_set_property()
vl: Clean up error reporting in mon_init_func()
vl: Clean up error reporting in parse_fw_cfg()
vl: Clean up error reporting in device_init_func() ui/keymaps: Fix handling of erroneous include files
vnc: Clean up error reporting in vnc_init_func()
numa: Clean up error reporting in parse_numa()
tpm: Clean up error reporting in tpm_init_tpmdev()
spice: Clean up error reporting in add_channel()
fsdev: Clean up error reporting in qemu_fsdev_add()
vl: Assert drive_new() does not fail in default_drive()
blockdev: Convert drive_new() to Error
vl: Fix exit status for -drive format=help
vl: Simplify call of parse_name()
block: Clean up bdrv_img_create()'s error reporting

  raw: Convert a warning to warn_report()
  vpc: Fail open on bad header checksum
 block.c                                  |   9 +-
 block/bochs.c                            |   8 +-
 block/cloop.c                            |   8 +-
 block/dmg.c                              |   8 +-
 block/iscsi.c                            |   2 +-
 block/qcow2.c                            |   4 +-
 block/qed.c                              |   4 +-
 block/raw-format.c                       |  17 +--
 block/rbd.c                              |  12 +-
 block/sheepdog.c                         |   2 +-
 block/vpc.c                              |   8 +-
 block/vvfat.c                            |   8 +-
 blockdev.c                               |  27 ++---
 chardev/char-pty.c                       |   2 +-
 chardev/char.c                           |   2 +-
 cpus.c                                   |   8 +-
 device-hotplug.c                         |   5 +-
 fsdev/qemu-fsdev-dummy.c                 |   2 +-
 fsdev/qemu-fsdev.c                       |  12 +-
 fsdev/qemu-fsdev.h                       |   2 +-
 hw/9pfs/9p-handle.c                      |   6 +-
 hw/9pfs/9p-local.c                       |   4 +-
 hw/9pfs/xen-9p-backend.c                 |   7 +-
 hw/display/cg3.c                         |   2 +-
 hw/display/tcx.c                         |   2 +-
 hw/i386/pc.c                             |   5 +-
 hw/intc/ioapic.c                         |   8 +-
 hw/intc/xics.c                           |  15 ++-
 hw/intc/xics_kvm.c                       |   7 +-
 hw/misc/ivshmem.c                        |   4 +-
 hw/net/virtio-net.c                      |   8 +-
 hw/ppc/pnv_core.c                        |   4 +-
 hw/ppc/spapr_pci.c                       |   7 +-
 hw/smbios/smbios.c                       |  90 ++++++++++-----
 hw/timer/aspeed_timer.c                  |   3 +-
 hw/usb/bus.c                             |   5 +-
 hw/vfio/pci-quirks.c                     |   4 +-
 hw/vfio/pci.c                            |  25 ++--
 hw/vfio/platform.c                       |   6 +-
 hw/virtio/virtio-pci.c                   |   4 +-
 hw/xen/xen_pt.c                          |   2 +-
 include/hw/vfio/vfio-common.h            |   3 +-
 include/qapi/error.h                     |  14 +++
 include/sysemu/blockdev.h                |   3 +-
 include/sysemu/numa.h                    |   1 -
 include/sysemu/tpm.h                     |   2 +-
 include/ui/console.h                     |   2 +-
 migration/migration.c                    |  12 +-
 migration/savevm.c                       |   8 +-
 net/l2tpv3.c                             |  25 ++--
 net/socket.c                             |   4 +-
 numa.c                                   |  21 ++--
 qemu-io.c                                |   8 +-
 qemu-nbd.c                               |  14 +--
 qemu-seccomp.c                           |  18 +--
 qom/object_interfaces.c                  |   4 +-
 scripts/coccinelle/use-error_fatal.cocci |  20 ++++
 stubs/tpm.c                              |   3 +-
 target/i386/cpu.c                        |  17 +--
 target/ppc/translate_init.inc.c          |   4 +-
 tests/qemu-iotests/049.out               |  12 +-
 tests/qemu-iotests/099                   |   3 +-
 tests/qemu-iotests/109.out               |  55 +++++----
 tpm.c                                    |  22 ++--
 ui/curses.c                              |   6 +-
 ui/keymaps.c                             |  40 ++++---
 ui/keymaps.h                             |   2 +-
 ui/sdl.c                                 |   6 +-
 ui/spice-core.c                          |  13 ++-
 ui/vnc.c                                 |  19 ++--
 util/error.c                             |  13 +++
 vl.c                                     | 139 +++++++++--------------
 72 files changed, 474 insertions(+), 407 deletions(-)
 create mode 100644 scripts/coccinelle/use-error_fatal.cocci
Signature · 1 line
2.17.1