qapi-visit: Convert to QAPISchemaVisitor, fixing bugs
Fixes flat unions to visit the base's base members (the previous commit merely added them to the struct). Same test case. Patch's effect on visit_type_UserDefFlatUnion(): static void visit_type_UserDefFlatUnion_fields(Visitor *m, UserDefFlatUnion **obj, Error **errp) { Error *err = NULL; + visit_type_int(m, &(*obj)->integer, "integer", &err); + if (err) { + goto out; + } visit_type_str(m, &(*obj)->string, "string", &err); if (err) { goto out; Test cases updated for the bug fix. Fixes alternates to generate a visitor for their implicit enumeration type. None of them are currently used, obviously. Example: block-core.json's BlockdevRef now generates visit_type_BlockdevRefKind(). Code is generated in a different order now, and therefore has got a few new forward declarations. Doesn't matter. The guard QAPI_VISIT_BUILTIN_VISITOR_DECL is renamed to QAPI_VISIT_BUILTIN. The previous commit's two ugly special cases exist here, too. Mark both TODO. Signed-off-by:Markus Armbruster <armbru@redhat.com> Reviewed-by:
Daniel P. Berrange <berrange@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com>
Showing
- scripts/qapi-visit.py 114 additions, 158 deletionsscripts/qapi-visit.py
- tests/qapi-schema/qapi-schema-test.json 0 additions, 3 deletionstests/qapi-schema/qapi-schema-test.json
- tests/test-qmp-input-strict.c 2 additions, 2 deletionstests/test-qmp-input-strict.c
- tests/test-qmp-input-visitor.c 2 additions, 2 deletionstests/test-qmp-input-visitor.c
Loading
Please register or sign in to comment