qemu-e2k/qapi
Markus Armbruster ee16ce9337 qapi: Clean up fragile use of error_is_set()
Using error_is_set(ERRP) to find out whether a function failed is
either wrong, fragile, or unnecessarily opaque.  It's wrong when ERRP
may be null, because errors go undetected when it is.  It's fragile
when proving ERRP non-null involves a non-local argument.  Else, it's
unnecessarily opaque (see commit 84d18f0).

The error_is_set(errp) in do_qmp_dispatch() is merely fragile, because
the caller never passes a null errp argument.

Make the code more robust and more obviously correct: receive the
error in a local variable, then propagate it through the parameter.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2014-05-09 09:11:31 -04:00
..
Makefile.objs build: move base QAPI files to libqemuutil.a 2013-01-12 18:42:51 +01:00
opts-visitor.c qapi: treat all negative return of strtosz_suffix() as error 2014-05-08 14:19:58 -04:00
qapi-dealloc-visitor.c qapi: Clean up superfluous null check in qapi_dealloc_type_str() 2014-03-03 11:17:45 -05:00
qapi-visit-core.c qapi: make visit_type_size fallback to type_int 2013-07-29 19:33:33 -05:00
qmp-dispatch.c qapi: Clean up fragile use of error_is_set() 2014-05-09 09:11:31 -04:00
qmp-input-visitor.c qerror.h: Remove QERR defines that are only used once 2014-04-25 09:19:59 -04:00
qmp-output-visitor.c misc: move include files to include/qemu/ 2012-12-19 08:32:39 +01:00
qmp-registry.c qemu-ga: Extend 'guest-info' command to expose flag 'success-response' 2013-10-10 14:52:37 -05:00
string-input-visitor.c qapi: Add size parser to StringInputVisitor 2014-02-14 21:12:01 +01:00
string-output-visitor.c qapi: Refine human printing of sizes 2014-02-14 21:12:05 +01:00