diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2012-07-17 16:17:04 +0200 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> | 2012-07-23 11:55:17 +0100 |
commit | d195325b05199038b5907fa791729425b9720d21 (patch) | |
tree | bac66242283f01f0e755b4a7d175755f96476332 /error.h | |
parent | 837c36e7871a74dda78d2ca89d9027b19553a871 (diff) | |
download | qemu-d195325b05199038b5907fa791729425b9720d21.zip qemu-d195325b05199038b5907fa791729425b9720d21.tar.gz qemu-d195325b05199038b5907fa791729425b9720d21.tar.bz2 |
qapi: fix error propagation
Don't overwrite / leak previously set errors.
Make traversal cope with missing mandatory sub-structs.
Don't try to end a container that could not be started.
v1->v2:
- unchanged
v2->v3:
- instead of examining, assert that we never overwrite errors with
error_set()
- allow visitors to set a NULL struct pointer successfully, so traversal
of incomplete objects can continue
- check for a NULL "obj" before accessing "(*obj)->has_XXX" (this is not a
typo, "obj != NULL" implies "*obj != NULL" here)
- fix start_struct / end_struct balance for unions as well
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Diffstat (limited to 'error.h')
-rw-r--r-- | error.h | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -57,7 +57,7 @@ void error_set_field(Error *err, const char *field, const char *value); /** * Propagate an error to an indirect pointer to an error. This function will * always transfer ownership of the error reference and handles the case where - * dst_err is NULL correctly. + * dst_err is NULL correctly. Errors after the first are discarded. */ void error_propagate(Error **dst_err, Error *local_err); |