qapi: Smooth another visitor error checking pattern
Convert
visit_type_FOO(v, ..., &ptr, &err);
...
if (err) {
...
}
to
visit_type_FOO(v, ..., &ptr, errp);
...
if (!ptr) {
...
}
for functions that set @ptr to non-null / null on success / error.
Eliminate error_propagate() that are now unnecessary. Delete @err
that are now unused.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20200707160613.848843-40-armbru@redhat.com>
diff --git a/block/nfs.c b/block/nfs.c
index b1718d1..61a249a 100644
--- a/block/nfs.c
+++ b/block/nfs.c
@@ -563,18 +563,15 @@
BlockdevOptionsNfs *opts = NULL;
Visitor *v;
const QDictEntry *e;
- Error *local_err = NULL;
v = qobject_input_visitor_new_flat_confused(options, errp);
if (!v) {
return NULL;
}
- visit_type_BlockdevOptionsNfs(v, NULL, &opts, &local_err);
+ visit_type_BlockdevOptionsNfs(v, NULL, &opts, errp);
visit_free(v);
-
- if (local_err) {
- error_propagate(errp, local_err);
+ if (!opts) {
return NULL;
}