qemu-e2k/include
Markus Armbruster 8277d2aa58 error: New error_prepend(), error_reportf_err()
Instead of simply propagating an error verbatim, we sometimes want to
add to its message, like this:

    frobnicate(arg, &err);
    error_setg(errp, "Can't frobnicate %s: %s",
                     arg, error_get_pretty(err));
    error_free(err);

This is suboptimal, because it loses err's hint (if any).  Moreover,
when errp is &error_abort or is subsequently propagated to
&error_abort, the abort message points to the place where we last
added to the error, not to the place where it originated.

To avoid these issues, provide means to add to an error's message in
place:

    frobnicate(arg, errp);
    error_prepend(errp, "Can't frobnicate %s: ", arg);

Likewise, reporting an error like

    frobnicate(arg, &err);
    error_report("Can't frobnicate %s: %s", arg, error_get_pretty(err));

can lose err's hint.  To avoid:

    error_reportf_err(err, "Can't frobnicate %s: ", arg);

The next commits will put these functions to use.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <1450452927-8346-10-git-send-email-armbru@redhat.com>
2016-01-13 15:16:17 +01:00
..
block block: Add check on mirror target 2016-01-07 21:30:18 +01:00
crypto crypto: Fix typo in example 2016-01-11 11:39:28 +03:00
disas
exec ivshmem: Store file descriptor for vhost-user negotiation 2016-01-09 23:20:20 +02:00
fpu
hw isa: Clean up error handling around isa_bus_new() 2016-01-13 11:58:59 +01:00
io io: add QIOChannelBuffer class 2015-12-18 12:18:31 +00:00
libdecnumber
migration Add VMSTATE_STRUCT_VARRAY_KNOWN 2016-01-09 23:20:20 +02:00
monitor
net ether/slirp: Avoid redefinition of the same constants 2016-01-11 11:01:35 +08:00
qapi error: New error_prepend(), error_reportf_err() 2016-01-13 15:16:17 +01:00
qemu osdep.h: Include glib-compat.h in osdep.h rather than qemu-common.h 2016-01-11 11:39:28 +03:00
qom qom: Update documentation comment of struct Object 2015-12-03 20:10:22 +01:00
standard-headers linux-headers: update from kvm/next 2015-12-17 15:24:34 +01:00
sysemu block-backend: add blk_get_max_iov() 2015-12-22 16:01:07 +08:00
ui sdl2/opengl: add opengl context and scanout support 2016-01-08 12:20:15 +01:00
config.h
elf.h
glib-compat.h
qemu-common.h osdep.h: Include glib-compat.h in osdep.h rather than qemu-common.h 2016-01-11 11:39:28 +03:00
qemu-io.h
qjson.h
trace-tcg.h
trace.h