From 18bdbc3ac8b477e160d56aa6ecd6942495ce44d0 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Tue, 29 Sep 2015 16:21:15 -0600 Subject: qapi: Simplify gen_visit_fields() error handling Since we have consolidated all generated code to use 'err' as the name of the local variable for error detection, we can simplify the decision on whether to skip error detection (useful for deallocation paths) to be a boolean. Signed-off-by: Eric Blake Message-Id: <1443565276-4535-18-git-send-email-eblake@redhat.com> [Change to gen_visit_fields() simplified] Signed-off-by: Markus Armbruster --- scripts/qapi-commands.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'scripts/qapi-commands.py') diff --git a/scripts/qapi-commands.py b/scripts/qapi-commands.py index 9d214a6609..43a893b4eb 100644 --- a/scripts/qapi-commands.py +++ b/scripts/qapi-commands.py @@ -101,19 +101,17 @@ def gen_marshal_input_visit(arg_type, dealloc=False): return ret if dealloc: - errarg = None ret += mcgen(''' qmp_input_visitor_cleanup(qiv); qdv = qapi_dealloc_visitor_new(); v = qapi_dealloc_get_visitor(qdv); ''') else: - errarg = 'err' ret += mcgen(''' v = qmp_input_get_visitor(qiv); ''') - ret += gen_visit_fields(arg_type.members, errarg=errarg) + ret += gen_visit_fields(arg_type.members, skiperr=dealloc) if dealloc: ret += mcgen(''' -- cgit v1.2.3