aboutsummaryrefslogtreecommitdiff
path: root/include/qapi
diff options
context:
space:
mode:
Diffstat (limited to 'include/qapi')
-rw-r--r--include/qapi/error.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/qapi/error.h b/include/qapi/error.h
index c69dddbbf2..4d42cdc5fd 100644
--- a/include/qapi/error.h
+++ b/include/qapi/error.h
@@ -30,6 +30,10 @@
* Handle an error without reporting it (just for completeness):
* error_free(err);
*
+ * Assert that an expected error occurred, but clean it up without
+ * reporting it (primarily useful in testsuites):
+ * error_free_or_abort(&err);
+ *
* Pass an existing error to the caller:
* error_propagate(errp, err);
* where Error **errp is a parameter, by convention the last one.
@@ -190,6 +194,11 @@ Error *error_copy(const Error *err);
void error_free(Error *err);
/*
+ * Convenience function to assert that *@errp is set, then silently free it.
+ */
+void error_free_or_abort(Error **errp);
+
+/*
* Convenience function to error_report() and free @err.
*/
void error_report_err(Error *);