qemu/hw/vfio
Markus Armbruster 4b5766488f error: Fix use of error_prepend() with &error_fatal, &error_abort
From include/qapi/error.h:

  * Pass an existing error to the caller with the message modified:
  *     error_propagate(errp, err);
  *     error_prepend(errp, "Could not frobnicate '%s': ", name);

Fei Li pointed out that doing error_propagate() first doesn't work
well when @errp is &error_fatal or &error_abort: the error_prepend()
is never reached.

Since I doubt fixing the documentation will stop people from getting
it wrong, introduce error_propagate_prepend(), in the hope that it
lures people away from using its constituents in the wrong order.
Update the instructions in error.h accordingly.

Convert existing error_prepend() next to error_propagate to
error_propagate_prepend().  If any of these get reached with
&error_fatal or &error_abort, the error messages improve.  I didn't
check whether that's the case anywhere.

Cc: Fei Li <fli@suse.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20181017082702.5581-2-armbru@redhat.com>
2018-10-19 14:51:34 +02:00
..
amd-xgbe.c vfio/platform: Make the vfio-platform device non-abstract 2018-10-15 10:52:09 -06:00
ap.c s390x/vfio: ap: Introduce VFIO AP device 2018-10-12 11:32:18 +02:00
calxeda-xgmac.c vfio/platform: Make the vfio-platform device non-abstract 2018-10-15 10:52:09 -06:00
ccw.c qemu-error: add {error, warn}_report_once_cond 2018-09-24 17:13:07 +02:00
common.c vfio/pci: Fix failure to close file descriptor on error 2018-08-23 10:45:58 -06:00
display.c hw/vfio/display: add ramfb support 2018-10-15 10:52:09 -06:00
Makefile.objs s390x/vfio: ap: Introduce VFIO AP device 2018-10-12 11:32:18 +02:00
pci-quirks.c hw/vfio: Use the IEC binary prefix definitions 2018-07-02 15:41:16 +02:00
pci.c error: Fix use of error_prepend() with &error_fatal, &error_abort 2018-10-19 14:51:34 +02:00
pci.h hw/vfio/display: add ramfb support 2018-10-15 10:52:09 -06:00
platform.c vfio/platform: Make the vfio-platform device non-abstract 2018-10-15 10:52:09 -06:00
spapr.c vfio/spapr: Allow backing bigger guest IOMMU pages with smaller physical pages 2018-08-21 14:28:45 +10:00
trace-events vfio/ccw/pci: Allow devices to opt-in for ballooning 2018-08-17 09:27:16 -06:00