qapi: add 'if' to enum members
commit6cc32b0e14b3f91e15a9511d90b222abc1df391d
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Thu, 13 Dec 2018 12:37:11 +0000 (13 16:37 +0400)
committerMarkus Armbruster <armbru@redhat.com>
Thu, 13 Dec 2018 18:20:11 +0000 (13 19:20 +0100)
tree3b8cbbcd19be7c206ae11dd861328ce58dfd6034
parentea738b21685814dc54352858afabc2ff33ade53e
qapi: add 'if' to enum members

QAPISchemaMember gains .ifcond for enum members: inherited classes,
such as QAPISchemaObjectTypeMember, will thus have an ifcond member
after this (those different types will also use the .ifcond to store
the condition and generate conditional code in the following patches).

The generated code remains unconditional for now. Later patches
generate the conditionals.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20181213123724.4866-10-marcandre.lureau@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
docs/devel/qapi-code-gen.txt
scripts/qapi/common.py
tests/Makefile.include
tests/qapi-schema/enum-dict-member-unknown.err
tests/qapi-schema/enum-if-invalid.err [new file with mode: 0644]
tests/qapi-schema/enum-if-invalid.exit [new file with mode: 0644]
tests/qapi-schema/enum-if-invalid.json [new file with mode: 0644]
tests/qapi-schema/enum-if-invalid.out [new file with mode: 0644]
tests/qapi-schema/qapi-schema-test.json
tests/qapi-schema/qapi-schema-test.out
tests/qapi-schema/test-qapi.py