qemu-e2k/util
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
..
Makefile.objs util: add atomic64 2018-10-02 18:47:55 +02:00
acl.c
aio-posix.c aio-posix: do skip system call if ctx->notifier polling succeeds 2018-09-26 10:46:21 +08:00
aio-wait.c block: Use a single global AioWait 2018-09-25 15:50:15 +02:00
aio-win32.c aio: Do aio_notify_accept only during blocking aio_poll 2018-08-15 10:12:35 +08:00
aiocb.c
async.c util/async: use qemu_aio_coroutine_enter in co_schedule_bh_cb 2018-09-25 15:50:15 +02:00
atomic64.c util: add atomic64 2018-10-02 18:47:55 +02:00
base64.c
bitmap.c
bitops.c
buffer.c
bufferiszero.c
cacheinfo.c util: add atomic64 2018-10-02 18:47:55 +02:00
compatfd.c
coroutine-sigaltstack.c
coroutine-ucontext.c build: try improve handling of clang warnings 2018-03-12 08:59:03 +01:00
coroutine-win32.c
crc32c.c
cutils.c cutils: add qemu_pstrcmp0() 2018-10-05 16:14:22 +04:00
drm.c util: promote qemu_egl_rendernode_open() to libqemuutil 2018-08-27 10:51:44 +02:00
envlist.c
error.c error: Fix use of error_prepend() with &error_fatal, &error_abort 2018-10-19 14:51:34 +02:00
event_notifier-posix.c
event_notifier-win32.c
fifo8.c
getauxval.c
hbitmap.c hbitmap: Add @advance param to hbitmap_iter_next() 2018-06-18 17:04:55 +02:00
hexdump.c
host-utils.c
id.c
iohandler.c
iov.c
iova-tree.c util: remove redundant include of glib.h and add osdep.h 2018-06-29 12:22:28 +01:00
keyval.c qobject: Replace qobject_incref/QINCREF qobject_decref/QDECREF 2018-05-04 08:27:53 +02:00
lockcnt.c
log.c tcg: Optionally log FPU state in TCG -d cpu logging 2018-05-15 14:58:44 +01:00
main-loop.c main-loop: drop spin_counter 2018-06-01 16:01:29 +01:00
memfd.c hostmem-memfd: add checks before adding hostmem-memfd & properties 2018-10-02 18:47:55 +02:00
mmap-alloc.c Make qemu_mempath_getpagesize() accept NULL 2018-04-27 18:05:22 +10:00
module.c module: Use QEMU_MODULE_DIR as a search path 2018-08-23 18:46:25 +02:00
notify.c
osdep.c glib: bump min required glib library version to 2.40 2018-06-29 12:22:28 +01:00
oslib-posix.c util: use fcntl() for qemu_write_pidfile() locking 2018-10-02 18:47:55 +02:00
oslib-win32.c util: add qemu_write_pidfile() 2018-10-02 18:47:55 +02:00
pagesize.c
path.c
qdist.c
qemu-config.c block: Add block-specific QDict header 2018-06-15 14:49:44 +02:00
qemu-coroutine-io.c
qemu-coroutine-lock.c coroutine: avoid co_queue_wakeup recursion 2018-03-27 13:05:28 +01:00
qemu-coroutine-sleep.c
qemu-coroutine.c block: Add missing locking in bdrv_co_drain_bh_cb() 2018-09-25 15:50:15 +02:00
qemu-error.c qemu-error: add {error, warn}_report_once_cond 2018-09-24 17:13:07 +02:00
qemu-openpty.c
qemu-option.c qemu-option: improve qemu_opts_print_help() output 2018-10-05 16:14:22 +04:00
qemu-progress.c
qemu-sockets.c sockets: allow SocketAddress 'fd' to reference numeric file descriptors 2018-03-13 18:06:06 +00:00
qemu-thread-common.h QemuMutex: support --enable-debug-mutex 2018-06-28 19:05:32 +02:00
qemu-thread-posix.c qemu-thread: introduce qemu-thread-common.h 2018-06-28 19:05:31 +02:00
qemu-thread-win32.c qsp: QEMU's Synchronization Profiler 2018-08-23 18:46:25 +02:00
qemu-timer-common.c
qemu-timer.c timer: introduce new virtual clock 2018-10-02 19:08:58 +02:00
qht.c qht: constify arguments to some internal functions 2018-09-26 08:55:54 -07:00
qsp.c qsp: use atomic64 accessors 2018-10-02 18:47:55 +02:00
range.c
rcu.c membarrier: introduce qemu/sys_membarrier.h 2018-03-12 16:12:47 +01:00
readline.c readline: don't free completions in readline_free() 2018-02-05 13:54:39 +01:00
stats64.c
sys_membarrier.c sys_membarrier: fix up include directives 2018-04-05 14:37:38 +02:00
systemd.c
thread-pool.c
throttle.c
timed-average.c
trace-events aio-posix: compute timeout before polling 2018-09-26 10:46:21 +08:00
unicode.c json: Reject invalid UTF-8 sequences 2018-08-24 20:26:37 +02:00
uri.c cutils: Provide strchrnul 2018-06-29 12:32:10 +02:00
uuid.c
vfio-helpers.c replace functions which are only available in glib-2.24 2018-05-20 08:55:01 +03:00