qemu/util
Peter Crosthwaite 5d24ee70bc error: Add error_abort
Add a special Error * that can be passed to error handling APIs to
signal that any errors are fatal and should abort QEMU. There are two
advantages to this:

- allows for brevity when wishing to assert success of Error **
  accepting APIs. No need for this pattern:
        Error * local_err = NULL;
        api_call(foo, bar, &local_err);
        assert_no_error(local_err);
  This also removes the need for _nofail variants of APIs with
  asserting call sites now reduced to 1LOC.
- SIGABRT happens from within the offending API. When a fatal error
  occurs in an API call (when the caller is asserting sucess) failure
  often means the API itself is broken. With the abort happening in the
  API call now, the stack frames into the call are available at debug
  time. In the assert_no_error scheme the abort happens after the fact.

The exact semantic is that when an error is raised, if the argument
Error ** matches &error_abort, then the abort occurs immediately. The
error messaged is reported.

For error_propagate, if the destination error is &error_abort, then
the abort happens at propagation time.

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2014-01-06 14:01:53 -05:00
..
acl.c acl: acl_add can't insert before last list element, fix 2013-06-21 22:52:50 +04:00
aes.c aes: Remove unused code (NDEBUG, u16) 2013-07-27 11:22:53 +04:00
bitmap.c build: move libqemuutil.a components to util/ 2013-01-12 18:42:50 +01:00
bitops.c bitops: unroll while loop in find_next_bit() 2013-03-26 13:32:32 +01:00
cache-utils.c util: Use qemu_getauxval in linux qemu_cache_utils_init 2013-11-30 07:45:30 +13:00
compatfd.c compatfd: switch to QemuThread 2013-10-17 17:24:14 +02:00
crc32c.c qemu: add castagnoli crc32c checksum algorithm 2013-05-03 10:31:58 +02:00
cutils.c qemu-io: Move qemu_strsep() to cutils.c 2013-06-06 11:27:04 +02:00
envlist.c util: Fix compilation of envlist.c for MinGW 2013-02-02 20:13:19 +00:00
error.c error: Add error_abort 2014-01-06 14:01:53 -05:00
event_notifier-posix.c sysemu: avoid proliferation of include/ subdirectories 2013-04-15 18:19:25 +02:00
event_notifier-win32.c build: move libqemuutil.a components to util/ 2013-01-12 18:42:50 +01:00
fifo8.c hw: move fifo.[ch] to libqemuutil 2013-03-01 13:53:10 +01:00
getauxval.c osdep: Create qemu_getauxval and qemu_init_auxval 2013-11-30 07:45:13 +13:00
hbitmap.c hbitmap: Use non-bitops ctzl 2013-02-16 11:11:34 +00:00
hexdump.c Rename hexdump to avoid FreeBSD libutil conflict 2013-05-20 08:20:08 -05:00
host-utils.c host-utils: Improve mulu64 and muls64 2013-02-17 14:28:58 +00:00
iov.c iov: avoid "orig_len may be used unitialized" warning 2013-09-20 20:09:24 +04:00
Makefile.objs osdep: Create qemu_getauxval and qemu_init_auxval 2013-11-30 07:45:13 +13:00
module.c build: move libqemuutil.a components to util/ 2013-01-12 18:42:50 +01:00
notify.c notify: add NotiferWithReturn so notifier list can abort 2013-06-28 09:20:26 +02:00
osdep.c osdep: warn if open(O_DIRECT) on fails with EINVAL 2013-09-18 15:34:51 +02:00
oslib-posix.c util: add socket_set_fast_reuse function which will replace setting SO_REUSEADDR 2013-10-02 19:20:31 +02:00
oslib-win32.c util: add socket_set_fast_reuse function which will replace setting SO_REUSEADDR 2013-10-02 19:20:31 +02:00
path.c util/path: Fix type which is longer than 8 bit for MinGW 2013-10-05 14:01:47 +04:00
qemu-config.c qmp: access the local QemuOptsLists for drive option 2013-11-14 13:09:07 +01:00
qemu-error.c add timestamp to error_report() 2013-07-10 13:42:09 -04:00
qemu-openpty.c create qemu_openpty_raw() helper function and move it to a separate file 2013-06-14 14:28:43 +04:00
qemu-option.c blockdev: Separate ID generation from DriveInfo creation 2013-10-11 16:50:01 +02:00
qemu-progress.c build: move libqemuutil.a components to util/ 2013-01-12 18:42:50 +01:00
qemu-sockets.c util: call socket_set_fast_reuse instead of setting SO_REUSEADDR 2013-10-02 19:20:31 +02:00
qemu-thread-posix.c qemu-thread: add QemuEvent 2013-10-17 17:30:55 +02:00
qemu-thread-win32.c qemu-thread: add QemuEvent 2013-10-17 17:30:55 +02:00
qemu-timer-common.c Allow clock_gettime() monotonic clock to be utilized on more OS's 2013-04-04 20:22:45 -05:00
throttle.c throttle: Add a new throttling API implementing continuous leaky bucket. 2013-09-06 15:25:07 +02:00
unicode.c unicode: New mod_utf8_codepoint() 2013-04-13 19:39:59 +00:00
uri.c clean unnecessary code: don't check g_strdup arg for NULL 2013-05-12 13:25:55 +04:00