summaryrefslogtreecommitdiffstats
path: root/scripts/qapi/visit.py
diff options
context:
space:
mode:
authorMarkus Armbruster2019-09-27 15:46:14 +0200
committerMarkus Armbruster2019-09-28 17:17:18 +0200
commit0ca7b11709b8e81e5e8f28245b5b594b597b062b (patch)
tree8b9ecfbf0ee8512f84d59bbc40dd88191d576d11 /scripts/qapi/visit.py
parentqmp-dispatch: Use CommandNotFound error for disabled commands (diff)
downloadqemu-0ca7b11709b8e81e5e8f28245b5b594b597b062b.tar.gz
qemu-0ca7b11709b8e81e5e8f28245b5b594b597b062b.tar.xz
qemu-0ca7b11709b8e81e5e8f28245b5b594b597b062b.zip
qapi: Tighten QAPISchemaFOO.check() assertions
When we introduced the QAPISchema intermediate representation (commit ac88219a6c7), we took a shortcut: we left check_exprs() & friends alone instead of moving semantic checks into the QAPISchemaFOO.check(). check_exprs() still checks and reports errors, and the .check() assert check_exprs() did the job. There are a few gaps, though. QAPISchemaArrayType.check() neglects to assert the element type is not an array. Add the assertion. QAPISchemaObjectTypeVariants.check() neglects to assert the tag member is not optional. Add the assertion. It neglects to assert the tag member is not conditional. Add the assertion. It neglects to assert we actually have variants. Add the assertion. It asserts the variants are object types, but neglects to assert they don't have variants. Tighten the assertion. QAPISchemaObjectTypeVariants.check_clash() has the same issue. However, it can run only after .check(). Delete the assertion instead of tightening it. QAPISchemaAlternateType.check() neglects to assert the branch types don't conflict. Fixing that isn't trivial, so add just a TODO comment for now. It'll be resolved later in this series. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20190927134639.4284-2-armbru@redhat.com>
Diffstat (limited to 'scripts/qapi/visit.py')
0 files changed, 0 insertions, 0 deletions