diff options
author | Markus Armbruster | 2014-04-25 16:50:34 +0200 |
---|---|---|
committer | Stefan Hajnoczi | 2014-04-25 18:05:06 +0200 |
commit | f70edf99483e7ee5f89d69fd0c51d04a35f03932 (patch) | |
tree | 25f65cc684b71bbdc7c3ca6919049217ed86dcad /qapi/qmp-input-visitor.c | |
parent | nbd: Use return values instead of error_is_set(errp) (diff) | |
download | qemu-f70edf99483e7ee5f89d69fd0c51d04a35f03932.tar.gz qemu-f70edf99483e7ee5f89d69fd0c51d04a35f03932.tar.xz qemu-f70edf99483e7ee5f89d69fd0c51d04a35f03932.zip |
blockdev: 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 internal_snapshot_prepare() 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: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'qapi/qmp-input-visitor.c')
0 files changed, 0 insertions, 0 deletions