qemu-e2k/include
Markus Armbruster 1e9b65bb1b error: On abort, report where the error was created
This is particularly useful when we abort in error_propagate(),
because there the stack backtrace doesn't lead to where the error was
created.  Looks like this:

    Unexpected error in parse_block_error_action() at .../qemu/blockdev.c:322:
    qemu-system-x86_64: -drive if=none,werror=foo: 'foo' invalid write error action
    Aborted (core dumped)

Note: to get this example output, I monkey-patched drive_new() to pass
&error_abort to blockdev_init().

To keep the error handling boiler plate from growing even more, all
error_setFOO() become macros expanding into error_setFOO_internal()
with additional __FILE__, __LINE__, __func__ arguments.  Not exactly
pretty, but it works.

The macro trickery breaks down when you take the address of an
error_setFOO().  Fortunately, we do that in just one place: qemu-ga's
Windows VSS provider and requester DLL wants to call
error_setg_win32() through a function pointer "to avoid linking glib
to the DLL".  Use error_setg_win32_internal() there.  The use of the
function pointer is already wrapped in a macro, so the churn isn't
bad.

Code size increases by some 35KiB for me (0.7%).  Tolerable.  Could be
less if we passed relative rather than absolute source file names to
the compiler, or forwent reporting __func__.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
2015-09-10 13:48:06 +02:00
..
block block: more check for replaced node 2015-09-02 14:56:39 +01:00
crypto crypto: introduce generic cipher API & built-in implementation 2015-07-08 13:11:01 +02:00
disas disas: Add print_insn to disassemble info 2015-07-09 15:20:40 +02:00
exec include/exec/softmmu-semi.h: Add support for 64-bit values 2015-09-07 10:39:27 +01:00
fpu softfloat: expand out STATUS macro 2015-02-06 16:11:38 +00:00
hw xlnx-zynqmp: Connect the sysbus AHCI to ZynqMP 2015-09-08 17:38:45 +01:00
libdecnumber Fix new typos in comments (found by codespell) 2014-07-18 17:45:36 +04:00
migration migration: Fix global state with Xen. 2015-08-03 16:13:23 +00:00
monitor Include monitor/monitor.h exactly where needed 2015-06-22 18:20:41 +02:00
net qmp: Wean off qerror_report() 2015-06-22 18:20:40 +02:00
qapi error: On abort, report where the error was created 2015-09-10 13:48:06 +02:00
qemu Make pow2ceil() and pow2floor() inline 2015-09-07 14:19:01 +01:00
qom qom: Add recursive version of object_child_for_each 2015-09-08 17:38:43 +01:00
standard-headers virtio-input: move sys/ioctl.h include 2015-07-16 17:34:41 +02:00
sysemu qemu-common.h: Move Win32 fixups into os-win32.h 2015-08-19 16:29:53 +01:00
ui Include monitor/monitor.h exactly where needed 2015-06-22 18:20:41 +02:00
config.h janitor: move remaining public headers to include/ 2012-12-19 08:32:46 +01:00
elf.h linux/elf.h update 2015-05-27 17:52:03 +02:00
glib-compat.h glib: remove stale compat functions 2015-05-22 15:58:06 -04:00
qemu-common.h Make pow2ceil() and pow2floor() inline 2015-09-07 14:19:01 +01:00
qemu-io.h qemu-io: Use BlockBackend 2015-02-16 15:07:19 +00:00
qjson.h QJSON: Add JSON writer 2015-02-05 17:16:14 +01:00
trace-tcg.h trace: [tcg] Generate TCG tracing routines 2014-08-12 14:26:12 +01:00
trace.h trace: [tcg] Include event definitions in "trace.h" 2014-08-12 14:26:12 +01:00