mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-31 14:23:53 -06:00
Error reporting patches for 2016-02-09
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAABAgAGBQJWud3JAAoJEDhwtADrkYZTY8cP/RxodWGC/4ftfSebRTgO9lk7 Dn5BzuUjnz2IGX3iGVx/PAyc5DMTl1qiZ71P4yOvDl6haPoB6WeQnYHKhORE6NFK WzqsKtJjdt0fpZSHDbiivniVlc3E33js6TqXjeylBh+YbHTbJjFzUUjsV3urOI5+ kDG8fZUNdIOxnXAH2Vv62FXbdg3YL1bQBCNf1MsG8QZ0Z6Pp4s5YyUtzYWYacUbO R3VMgDAOp7T4ZD2xMR0fafTQr1NqpvRz/W7WtkHK6Ix5OpwKbP3daYYcSSxK6iZv gqCFhIPlbFJNZ1g0s4cGBxP5sl5I7Hr77Q29htc+UER/LVR9wrNXVfbDnLZ2Ajqh 7q5wfGQGxcZZwb5cmFIVZrZwdo0vy5cNE7WPL9hWK9WlAwBMbI6x8db06jd6WsVJ 3GpG9La54Dw+f84bElnsJTaw4v0M6qjcnxklffaWIsG88Rslwsqn30DrTerIE20I cBExrD8GCwr91eda7jGZSUSHlJtwGRK3EhIW3QBnKx+KMcJ9nC3+nDa6UIRY53x9 9RDgMvI2/yxk8vEaXhLdbajGme0fOfCV+pNG6cj7MulnHyEryZNhRPNMGHrQ4hP6 gOLVzW7C/Ulfd/l1OsRUXRD15nQZHdigUhXiXgSrCkv67kWPfZEEkJseQw5C8CQI vGXWz2g0YCnAgcXpOYII =62Ar -----END PGP SIGNATURE----- Merge remote-tracking branch 'remotes/armbru/tags/pull-error-2016-02-09' into staging Error reporting patches for 2016-02-09 # gpg: Signature made Tue 09 Feb 2016 12:38:33 GMT 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-2016-02-09: HACKING: Add a section on error handling and reporting error: Improve documentation some more Use error_fatal to simplify obvious fatal errors (again) Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
commit
84c0781103
7 changed files with 71 additions and 34 deletions
|
@ -27,11 +27,11 @@
|
|||
* error_setg(&err, "invalid quark\n"
|
||||
* "Valid quarks are up, down, strange, charm, top, bottom.");
|
||||
*
|
||||
* Report an error to stderr:
|
||||
* Report an error to the current monitor if we have one, else stderr:
|
||||
* error_report_err(err);
|
||||
* This frees the error object.
|
||||
*
|
||||
* Report an error to stderr with additional text prepended:
|
||||
* Likewise, but with additional text prepended:
|
||||
* error_reportf_err(err, "Could not frobnicate '%s': ", name);
|
||||
*
|
||||
* Report an error somewhere else:
|
||||
|
@ -162,6 +162,9 @@ ErrorClass error_get_class(const Error *err);
|
|||
* human-readable error message is made from printf-style @fmt, ...
|
||||
* The resulting message should be a single phrase, with no newline or
|
||||
* trailing punctuation.
|
||||
* Please don't error_setg(&error_fatal, ...), use error_report() and
|
||||
* exit(), because that's more obvious.
|
||||
* Likewise, don't error_setg(&error_abort, ...), use assert().
|
||||
*/
|
||||
#define error_setg(errp, fmt, ...) \
|
||||
error_setg_internal((errp), __FILE__, __LINE__, __func__, \
|
||||
|
@ -213,6 +216,8 @@ void error_setg_win32_internal(Error **errp,
|
|||
* the error object.
|
||||
* Else, move the error object from @local_err to *@dst_errp.
|
||||
* On return, @local_err is invalid.
|
||||
* Please don't error_propagate(&error_fatal, ...), use
|
||||
* error_report_err() and exit(), because that's more obvious.
|
||||
*/
|
||||
void error_propagate(Error **dst_errp, Error *local_err);
|
||||
|
||||
|
@ -291,12 +296,14 @@ void error_set_internal(Error **errp,
|
|||
GCC_FMT_ATTR(6, 7);
|
||||
|
||||
/*
|
||||
* Pass to error_setg() & friends to abort() on error.
|
||||
* Special error destination to abort on error.
|
||||
* See error_setg() and error_propagate() for details.
|
||||
*/
|
||||
extern Error *error_abort;
|
||||
|
||||
/*
|
||||
* Pass to error_setg() & friends to exit(1) on error.
|
||||
* Special error destination to exit(1) on error.
|
||||
* See error_setg() and error_propagate() for details.
|
||||
*/
|
||||
extern Error *error_fatal;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue