aboutsummaryrefslogtreecommitdiff
path: root/scripts/qapi/visit.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/qapi/visit.py')
-rw-r--r--scripts/qapi/visit.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/scripts/qapi/visit.py b/scripts/qapi/visit.py
index 9aa0b1e11e..9d83bf650f 100644
--- a/scripts/qapi/visit.py
+++ b/scripts/qapi/visit.py
@@ -77,6 +77,7 @@ bool visit_type_%(c_name)s_members(Visitor *v, %(c_name)s *obj, Error **errp)
c_type=base.c_name())
for memb in members:
+ deprecated = 'deprecated' in [f.name for f in memb.features]
ret += gen_if(memb.ifcond)
if memb.optional:
ret += mcgen('''
@@ -84,6 +85,12 @@ bool visit_type_%(c_name)s_members(Visitor *v, %(c_name)s *obj, Error **errp)
''',
name=memb.name, c_name=c_name(memb.name))
indent.increase()
+ if deprecated:
+ ret += mcgen('''
+ if (visit_deprecated(v, "%(name)s")) {
+''',
+ name=memb.name)
+ indent.increase()
ret += mcgen('''
if (!visit_type_%(c_type)s(v, "%(name)s", &obj->%(c_name)s, errp)) {
return false;
@@ -91,6 +98,11 @@ bool visit_type_%(c_name)s_members(Visitor *v, %(c_name)s *obj, Error **errp)
''',
c_type=memb.type.c_name(), name=memb.name,
c_name=c_name(memb.name))
+ if deprecated:
+ indent.decrease()
+ ret += mcgen('''
+ }
+''')
if memb.optional:
indent.decrease()
ret += mcgen('''