qapi: Move conditional code from QAPISchemaVariants to its subtypes
commit8152bc7de6d4377d5104078115aa61986b436f44
authorMarkus Armbruster <armbru@redhat.com>
Fri, 15 Mar 2024 19:57:56 +0000 (15 20:57 +0100)
committerMarkus Armbruster <armbru@redhat.com>
Mon, 6 May 2024 10:38:27 +0000 (6 12:38 +0200)
tree4f7db5d0e561c028a3af388b5f1ac607122004e2
parente0a28f39b4602de56d3c0f66a386ededd25ea109
qapi: Move conditional code from QAPISchemaVariants to its subtypes

QAPISchemaVariants.check()'s code is almost entirely conditional on
union vs. alternate type.

Move the conditional code to QAPISchemaBranches.check() and
QAPISchemaAlternatives.check(), where the conditions are always
satisfied.

Attribute QAPISchemaVariants.tag_name is now only used by
QAPISchemaBranches.  Move it there.

Refactor the three types' .__init__() to make them a bit simpler.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
scripts/qapi/schema.py