qemu/include/qapi
Peter Crosthwaite 5d24ee70bc error: Add error_abort
Add a special Error * that can be passed to error handling APIs to
signal that any errors are fatal and should abort QEMU. There are two
advantages to this:

- allows for brevity when wishing to assert success of Error **
  accepting APIs. No need for this pattern:
        Error * local_err = NULL;
        api_call(foo, bar, &local_err);
        assert_no_error(local_err);
  This also removes the need for _nofail variants of APIs with
  asserting call sites now reduced to 1LOC.
- SIGABRT happens from within the offending API. When a fatal error
  occurs in an API call (when the caller is asserting sucess) failure
  often means the API itself is broken. With the abort happening in the
  API call now, the stack frames into the call are available at debug
  time. In the assert_no_error scheme the abort happens after the fact.

The exact semantic is that when an error is raised, if the argument
Error ** matches &error_abort, then the abort occurs immediately. The
error messaged is reported.

For error_propagate, if the destination error is &error_abort, then
the abort happens at propagation time.

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2014-01-06 14:01:53 -05:00
..
qmp qemu-ga: Extend 'guest-info' command to expose flag 'success-response' 2013-10-10 14:52:37 -05:00
dealloc-visitor.h qapi: move include files to include/qobject/ 2012-12-19 08:31:31 +01:00
error.h error: Add error_abort 2014-01-06 14:01:53 -05:00
opts-visitor.h OptsVisitor: don't try to flatten overlong integer ranges 2013-08-20 11:52:00 -04:00
qmp-input-visitor.h qapi: move include files to include/qobject/ 2012-12-19 08:31:31 +01:00
qmp-output-visitor.h qapi: move include files to include/qobject/ 2012-12-19 08:31:31 +01:00
string-input-visitor.h qapi: move include files to include/qobject/ 2012-12-19 08:31:31 +01:00
string-output-visitor.h qapi: move include files to include/qobject/ 2012-12-19 08:31:31 +01:00
visitor-impl.h qapi: Anonymous unions 2013-07-26 21:10:11 +02:00
visitor.h monitor: add object-add (QMP) and object_add (HMP) command 2014-01-06 13:45:47 -05:00