Skip to content

Error reporting cleanups and fixes

Markus Armbruster qemu-devel 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest24 patches 6 repliesIn review
  2. v223 patches 42 repliesSuperseded
  3. v14 patches 16 repliesSuperseded

Changes in v3 from the cover letter

* PATCH 01+11: Commit messages improved, bad Coccinelle like breaks cleaned up [Eric]
* PATCH 02-04+09+12-14+17: Commit messages improved [Eric]
* PATCH 05: Cover a bit more ground in comments [Eric]
* PATCH 16+21: Fix three more instances [Eric]
* PATCH 18: Style fix [Fam]
* PATCH 24: New

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/24qemu-nbd: Replace BSDism <err.h> by error_report()qemu-nbd.c+77 -440 replies
2/24error: Use error_report_err() where appropriate (again)block/sheepdog.c hw/arm/imx25_pdk.c hw/arm/kzm.c +5 more+9 -120 replies
3/24error: Use error_report_err() instead of monitor_printf()hmp.c hw/s390x/s390-skeys.c migration/savevm.c +1 more+13 -280 replies
4/24error: Use error_report_err() instead of ad hoc printscontrib/ivshmem-server/main.c qdev-monitor.c qemu-nbd.c+3 -70 replies
5/24error: Improve documentationinclude/qapi/error.h util/error.c util/qemu-error.c+23 -71 reply
6/24block: Clean up "Could not create temporary overlay" error messageblock.c+2 -30 replies
7/24qemu-nbd: Clean up "Failed to load snapshot" error messageqemu-nbd.c+5 -90 replies
8/24test-throttle: Simplify qemu_init_main_loop() error handlingtests/test-throttle.c+1 -140 replies
9/24error: New error_prepend(), error_reportf_err()include/qapi/error.h util/error.c+62 -20 replies
10/24error: Don't decorate original error message when adding to ithw/core/qdev-properties.c qemu-img.c tests/test-aio.c +1 more+4 -40 replies
11/24error: Use error_reportf_err() where it makes obvious sensearch_init.c block/sheepdog.c blockdev.c +14 more+47 -762 replies
12/24error: Use error_prepend() where it makes obvious senseblock.c block/qcow2.c block/qed.c +3 more+19 -300 replies
13/24spapr: Use error_reportf_err()hw/ppc/spapr.c+4 -30 replies
14/24migration: Use error_reportf_err() instead of monitor_printf()migration/savevm.c+6 -80 replies
15/24qemu-io qemu-nbd: Use error_report() etc. instead of fprintf()qemu-io.c qemu-nbd.c tests/qemu-iotests/059.out +14 more+93 -950 replies
16/24error: Strip trailing '\n' from error string arguments (again)block/vmdk.c hw/arm/xlnx-zynqmp.c hw/ppc/spapr.c +11 more+31 -300 replies
17/24vmdk: Clean up control flow in vmdk_parse_extents() a bitblock/vmdk.c+15 -130 replies
18/24vmdk: Clean up "Invalid extent lines" error messageblock/vmdk.c tests/qemu-iotests/059.out+14 -101 reply
19/24pci-assign: Clean up "Failed to assign" error messageshw/i386/kvm/pci-assign.c+8 -81 reply
20/24vhdx: Fix "log that needs to be replayed" error messageblock/vhdx-log.c tests/qemu-iotests/070.out+10 -80 replies
21/24error: Clean up errors with embedded newlines (again)hw/i386/pc.c kvm-all.c qemu-nbd.c+7 -80 replies
22/24hw/s390x: Rename local variables Error *l_err to just errhw/s390x/ipl.c hw/s390x/sclp.c+13 -130 replies
23/24s390/sclp: Simplify control flow in sclp_realize()hw/s390x/sclp.c+3 -60 replies
24/24error: Consistently name Error * objects err, and not errpcontrib/ivshmem-server/main.c hmp.c hw/core/nmi.c +2 more+29 -291 reply

Reviews trailers per patch

All 24 patches have a Reviewed-by or Acked-by.

PatchEric BlakeFam ZhengDavid HildenbrandCornelia HuckLaszlo ErsekDr. David Alan GilbertBharata B Rao
1/24R-b
2/24R-b
3/24R-b
4/24R-b
5/24R-b
6/24R-b
7/24R-b
8/24R-b
9/24R-b
10/24R-b
11/24R-b
12/24R-b
13/24R-b
14/24R-b
15/24R-b
16/24R-b A-b A-b R-b A-b
17/24R-b R-b
18/24R-b R-b
19/24R-b R-b
20/24R-b
21/24R-b R-b
22/24R-b R-b A-b
23/24R-b R-b A-b
24/24R-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 7 reviewers.

Read the v3 thread

Cover letter [Qemu-devel] [PATCH v3 00/24] Error reporting cleanups and fixes

Two topics:

1. Avoid error_get_pretty() when all you want is extend an error message. Doing that with error_get_pretty() loses the error hint. Provide that don't lose it, and are more convenient to use.

2. Newlines in error messages. Jason Herne's "[PATCH v2] checkpatch:
Detect newlines in error_report and other error functions" will catch at least some instances of this kind of mistake in the future.

Based on my "[PATCH v3 00/13] Clean up some hw_error() misuse".

I intend to take these patches through my tree.

v3:
* PATCH 01+11: Commit messages improved, bad Coccinelle like breaks cleaned up [Eric]
* PATCH 02-04+09+12-14+17: Commit messages improved [Eric]
* PATCH 05: Cover a bit more ground in comments [Eric]
* PATCH 16+21: Fix three more instances [Eric]
* PATCH 18: Style fix [Fam]
* PATCH 24: New
v2:
* 19 new patches...
* PATCH 1 became PATCH 16
* PATCH 2 became PATCH 21, with commit message typo fixed [László]
* PATCH 3 split into PATCH 17-20, partly rewritten
* PATCH 4 became PATCH 22

Markus Armbruster (24):
qemu-nbd: Replace BSDism <err.h> by error_report()
error: Use error_report_err() where appropriate (again)
error: Use error_report_err() instead of monitor_printf()
error: Use error_report_err() instead of ad hoc prints
error: Improve documentation
block: Clean up "Could not create temporary overlay" error message
qemu-nbd: Clean up "Failed to load snapshot" error message
test-throttle: Simplify qemu_init_main_loop() error handling
error: New error_prepend(), error_reportf_err()
error: Don't decorate original error message when adding to it
error: Use error_reportf_err() where it makes obvious sense
error: Use error_prepend() where it makes obvious sense
spapr: Use error_reportf_err()
migration: Use error_reportf_err() instead of monitor_printf() qemu-io qemu-nbd: Use error_report() etc. instead of fprintf()
error: Strip trailing '\n' from error string arguments (again)
vmdk: Clean up control flow in vmdk_parse_extents() a bit
vmdk: Clean up "Invalid extent lines" error message
pci-assign: Clean up "Failed to assign" error messages
vhdx: Fix "log that needs to be replayed" error message
error: Clean up errors with embedded newlines (again) hw/s390x: Rename local variables Error *l_err to just err s390/sclp: Simplify control flow in sclp_realize()
error: Consistently name Error * objects err, and not errp

 arch_init.c                        |   4 +-
 block.c                            |  20 +++---
 block/qcow2.c                      |   5 +-
 block/qed.c                        |   5 +-
 block/sheepdog.c                   |   8 +--
 block/vhdx-log.c                   |  13 ++--
 block/vmdk.c                       |  50 +++++++++------
 blockdev.c                         |  12 ++--
 contrib/ivshmem-server/main.c      |  10 ++-
 hmp.c                              |  61 ++++++++----------
 hw/arm/cubieboard.c                |   9 ++-
 hw/arm/digic_boards.c              |   3 +-
 hw/arm/imx25_pdk.c                 |   2 +-
 hw/arm/kzm.c                       |   2 +-
 hw/arm/netduino2.c                 |   2 +-
 hw/arm/xlnx-ep108.c                |   2 +-
 hw/arm/xlnx-zynqmp.c               |   2 +-
 hw/block/dataplane/virtio-blk.c    |   8 +--
 hw/core/nmi.c                      |  10 +--
 hw/core/qdev-properties.c          |   6 +-
 hw/core/qdev.c                     |   5 +-
 hw/i386/kvm/pci-assign.c           |  16 ++---
 hw/i386/pc.c                       |   9 ++-
 hw/ppc/e500.c                      |   4 +-
 hw/ppc/spapr.c                     |  10 +--
 hw/ppc/spapr_drc.c                 |   6 +-
 hw/s390x/ipl.c                     |  12 ++--
 hw/s390x/s390-skeys-kvm.c          |   2 +-
 hw/s390x/s390-skeys.c              |  19 +++---
 hw/s390x/sclp.c                    |  21 +++---
 hw/scsi/vhost-scsi.c               |   6 +-
 hw/tpm/tpm_tis.c                   |   2 +-
 hw/usb/bus.c                       |  11 ++--
 include/qapi/error.h               |  51 +++++++++++++--
 include/qemu/sockets.h             |   2 +-
 kvm-all.c                          |   6 +-
 migration/ram.c                    |   2 +-
 migration/savevm.c                 |  21 +++---
 monitor.c                          |   6 +-
 net/vhost-user.c                   |   6 +-
 qdev-monitor.c                     |   3 +-
 qemu-img.c                         |  33 ++++------
 qemu-io.c                          |   8 +--
 qemu-nbd.c                         | 128 ++++++++++++++++++++++---------------
 qga/commands-posix.c               |   2 +-
 replay/replay.c                    |   3 +-
 target-arm/cpu.c                   |   2 +-
 target-arm/machine.c               |   4 +-
 tests/qemu-iotests/059.out         |  12 ++--
 tests/qemu-iotests/060.out         |   2 +-
 tests/qemu-iotests/069.out         |   2 +-
 tests/qemu-iotests/070.out         |   5 +-
 tests/qemu-iotests/075.out         |  14 ++--
 tests/qemu-iotests/076.out         |   6 +-
 tests/qemu-iotests/078.out         |  12 ++--
 tests/qemu-iotests/080.out         |  36 +++++------
 tests/qemu-iotests/083.out         |  34 +++++-----
 tests/qemu-iotests/088.out         |  12 ++--
 tests/qemu-iotests/092.out         |  24 +++----
 tests/qemu-iotests/103.out         |   8 +--
 tests/qemu-iotests/114.out         |   2 +-
 tests/qemu-iotests/116.out         |  14 ++--
 tests/qemu-iotests/131.out         |   2 +-
 tests/test-aio.c                   |   4 +-
 tests/test-string-output-visitor.c |   6 +-
 tests/test-thread-pool.c           |   4 +-
 tests/test-throttle.c              |  15 +----
 ui/vnc.c                           |   4 +-
 util/error.c                       |  35 +++++++++-
 util/qemu-error.c                  |   8 +--
 vl.c                               |   8 +--
 71 files changed, 467 insertions(+), 436 deletions(-)
Signature · 1 line
2.4.3