diff options
| author | Peter Maydell | 2015-09-18 15:41:53 +0200 |
|---|---|---|
| committer | Peter Maydell | 2015-09-18 15:41:53 +0200 |
| commit | ffa4822c015d5670ef6a2239f3cbd2ff2cec57de (patch) | |
| tree | daef772c57a4e47fffbcd5ff1b03cee338d63220 /include | |
| parent | Merge remote-tracking branch 'remotes/lalrae/tags/mips-20150918' into staging (diff) | |
| parent | memory: Fix bad error handling in memory_region_init_ram_ptr() (diff) | |
| download | qemu-ffa4822c015d5670ef6a2239f3cbd2ff2cec57de.tar.gz qemu-ffa4822c015d5670ef6a2239f3cbd2ff2cec57de.tar.xz qemu-ffa4822c015d5670ef6a2239f3cbd2ff2cec57de.zip | |
Merge remote-tracking branch 'remotes/armbru/tags/pull-error-2015-09-18' into staging
Error reporting patches
# gpg: Signature made Fri 18 Sep 2015 13:42:49 BST using RSA key ID EB918653
# gpg: Good signature from "Markus Armbruster <armbru@redhat.com>"
# gpg: aka "Markus Armbruster <armbru@pond.sub.org>"
* remotes/armbru/tags/pull-error-2015-09-18:
memory: Fix bad error handling in memory_region_init_ram_ptr()
loader: Fix memory_region_init_resizeable_ram() error handling
Fix bad error handling after memory_region_init_ram()
error: New error_fatal
MAINTAINERS: Add "Error reporting" entry
error: Copy location information in error_copy()
hmp: Allow for error message hints on HMP
error: only prepend timestamp on stderr
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/qapi/error.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/qapi/error.h b/include/qapi/error.h index 426d5eaceb..c69dddbbf2 100644 --- a/include/qapi/error.h +++ b/include/qapi/error.h @@ -50,6 +50,9 @@ * Call a function aborting on errors: * foo(arg, &error_abort); * + * Call a function treating errors as fatal: + * foo(arg, &error_fatal); + * * Receive an error and pass it on to the caller: * Error *err = NULL; * foo(arg, &err); @@ -100,6 +103,7 @@ ErrorClass error_get_class(const Error *err); * If @errp is NULL, the error is ignored. Don't bother creating one * then. * If @errp is &error_abort, print a suitable message and abort(). + * If @errp is &error_fatal, print a suitable message and exit(1). * If @errp is anything else, *@errp must be NULL. * The new error's class is ERROR_CLASS_GENERIC_ERROR, and its * human-readable error message is made from printf-style @fmt, ... @@ -148,6 +152,8 @@ void error_setg_win32_internal(Error **errp, * error object. * Else, if @dst_errp is &error_abort, print a suitable message and * abort(). + * Else, if @dst_errp is &error_fatal, print a suitable message and + * exit(1). * Else, if @dst_errp already contains an error, ignore this one: free * the error object. * Else, move the error object from @local_err to *@dst_errp. @@ -155,6 +161,13 @@ void error_setg_win32_internal(Error **errp, */ void error_propagate(Error **dst_errp, Error *local_err); +/** + * Append a printf-style human-readable explanation to an existing error. + * May be called multiple times, and safe if @errp is NULL. + */ +void error_append_hint(Error **errp, const char *fmt, ...) + GCC_FMT_ATTR(2, 3); + /* * Convenience function to report open() failure. */ @@ -199,4 +212,9 @@ void error_set_internal(Error **errp, */ extern Error *error_abort; +/* + * Pass to error_setg() & friends to exit(1) on error. + */ +extern Error *error_fatal; + #endif |
