qapi: Reserve 'u' member name
commit5e59baf90a72cd25d38a3134edc029f4f022da74
authorEric Blake <eblake@redhat.com>
Mon, 26 Oct 2015 22:35:02 +0000 (26 16:35 -0600)
committerMarkus Armbruster <armbru@redhat.com>
Mon, 2 Nov 2015 07:30:28 +0000 (2 08:30 +0100)
tree392dbaed69ea07f8f5ad131bfb874c0bd80f5fba
parente4ba22b31943ab02373359555bd7bcd66442632f
qapi: Reserve 'u' member name

Now that we have separated union tag values from colliding with
non-variant C names, by naming the union 'u', we should reserve
this name for our use.  Note that we want to forbid 'u' even in
a struct with no variants, because it is possible for a future
qemu release to extend QMP in a backwards-compatible manner while
converting from a struct to a flat union.  Fortunately, no
existing clients were using this member name.  If we ever find
the need for QMP to have a member 'u', we could at that time
relax things, perhaps by having c_name() munge the QMP member to
'q_u'.

Note that we cannot forbid 'u' everywhere (by adding the
rejection code to check_name()), because the existing QKeyCode
enum already uses it; therefore we only reserve it as a struct
type member name.

Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <1445898903-12082-24-git-send-email-eblake@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
scripts/qapi.py
tests/Makefile
tests/qapi-schema/reserved-member-u.err [new file with mode: 0644]
tests/qapi-schema/reserved-member-u.exit [new file with mode: 0644]
tests/qapi-schema/reserved-member-u.json [new file with mode: 0644]
tests/qapi-schema/reserved-member-u.out [new file with mode: 0644]