We modify gen_visit_object_members to hide elements based on the specified conditional. This allows to hide those elements in input/output json, even though they still exist in C code.
Signed-off-by: Pierrick Bouvier <pierrick.bouv...@linaro.org> --- scripts/qapi/visit.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/qapi/visit.py b/scripts/qapi/visit.py index 36e240967b6..82caf8c5f0b 100644 --- a/scripts/qapi/visit.py +++ b/scripts/qapi/visit.py @@ -90,6 +90,7 @@ def gen_visit_object_members(name: str, for memb in members: ret += memb.ifcond.gen_if() + ret += memb.ifcond.gen_runtime_if() if memb.optional: has = 'has_' + c_name(memb.name) if memb.need_has(): @@ -126,6 +127,7 @@ def gen_visit_object_members(name: str, ret += mcgen(''' } ''') + ret += memb.ifcond.gen_runtime_endif() ret += memb.ifcond.gen_endif() if branches: -- 2.47.2