summaryrefslogtreecommitdiffstats
path: root/scripts/qapi-visit.py
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2016-01-29 06:48:59 -0700
committerTimothy Pearson <tpearson@raptorengineering.com>2019-11-29 19:32:24 -0600
commitb9ad670b9ec7f4dcce107f4a4a0e7c4875187667 (patch)
tree36a9aa3a249f35c58b8bd55ab5009ee79705f326 /scripts/qapi-visit.py
parent5c1cd25663cf569886666c48dcc62de7cdee6985 (diff)
downloadhqemu-b9ad670b9ec7f4dcce107f4a4a0e7c4875187667.zip
hqemu-b9ad670b9ec7f4dcce107f4a4a0e7c4875187667.tar.gz
qapi: Drop unused error argument for list and implicit struct
No backend was setting an error when ending the visit of a list or implicit struct, or when moving to the next list node. Make the callers a bit easier to follow by making this a part of the contract, and removing the errp argument - callers can then unconditionally end an object as part of cleanup without having to think about whether a second error is dominated by a first, because there is no second error. A later patch will then tackle the larger task of splitting visit_end_struct(), which can indeed set an error. Signed-off-by: Eric Blake <eblake@redhat.com> Message-Id: <1454075341-13658-24-git-send-email-eblake@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'scripts/qapi-visit.py')
-rw-r--r--scripts/qapi-visit.py12
1 files changed, 4 insertions, 8 deletions
diff --git a/scripts/qapi-visit.py b/scripts/qapi-visit.py
index 308000f..0fdcebc 100644
--- a/scripts/qapi-visit.py
+++ b/scripts/qapi-visit.py
@@ -62,7 +62,7 @@ static void visit_type_implicit_%(c_type)s(Visitor *v, %(c_type)s **obj, Error *
visit_start_implicit_struct(v, (void **)obj, sizeof(%(c_type)s), &err);
if (!err) {
visit_type_%(c_type)s_fields(v, obj, errp);
- visit_end_implicit_struct(v, &err);
+ visit_end_implicit_struct(v);
}
error_propagate(errp, err);
}
@@ -161,15 +161,13 @@ void visit_type_%(c_name)s(Visitor *v, const char *name, %(c_name)s **obj, Error
}
for (prev = (GenericList **)obj;
- !err && (i = visit_next_list(v, prev, &err)) != NULL;
+ !err && (i = visit_next_list(v, prev)) != NULL;
prev = &i) {
%(c_name)s *native_i = (%(c_name)s *)i;
visit_type_%(c_elt_type)s(v, NULL, &native_i->value, &err);
}
- error_propagate(errp, err);
- err = NULL;
- visit_end_list(v, &err);
+ visit_end_list(v);
out:
error_propagate(errp, err);
}
@@ -230,9 +228,7 @@ void visit_type_%(c_name)s(Visitor *v, const char *name, %(c_name)s **obj, Error
"%(name)s");
}
out_obj:
- error_propagate(errp, err);
- err = NULL;
- visit_end_implicit_struct(v, &err);
+ visit_end_implicit_struct(v);
out:
error_propagate(errp, err);
}
OpenPOWER on IntegriCloud