Eric Blake cf3935907b qapi: Better error messages for bad enums
The previous commit demonstrated that the generator had several
flaws with less-than-perfect enums:
- an enum that listed the same string twice (or two variant
strings that map to the same C enumerator) ended up generating
an invalid C enum
- because the generator adds a _MAX terminator to each enum,
the use of an enum member 'max' can also cause this clash
- if an enum omits 'data', the generator left a python stack
trace rather than a graceful message
- an enum that used a non-array 'data' was silently accepted by
the parser
- an enum that used non-string members in the 'data' member
was silently accepted by the parser

Add check_enum to cover these situations, and update testcases
to match.  While valid .json files won't trigger any of these
cases, we might as well be nicer to developers that make a typo
while trying to add new QAPI code.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
2015-05-05 18:39:00 +02:00
2015-02-06 16:11:38 +00:00
2015-03-19 11:30:37 +03:00
2015-04-30 20:34:54 +01:00
2015-05-05 10:48:26 +02:00
2015-04-30 13:21:42 +02:00
2015-04-30 16:05:48 +03:00
2015-03-09 09:14:28 +00:00
2015-04-28 12:22:20 +01:00
2015-04-30 16:06:18 +03:00
2015-05-05 10:48:26 +02:00
2015-04-30 16:05:48 +03:00
2015-04-04 09:45:59 +03:00
2015-04-28 15:36:09 +02:00
2015-04-26 16:49:24 +01:00
2015-04-30 16:05:48 +03:00
2015-04-30 16:05:48 +03:00
2015-04-30 15:18:30 +01:00
2015-02-05 17:16:14 +01:00
2015-04-30 16:05:48 +03:00
2015-04-28 22:14:15 +02:00
2015-02-16 15:07:19 +00:00
2015-04-30 16:06:17 +03:00
2015-01-14 10:38:57 +01:00
2015-04-26 16:49:24 +01:00
2015-02-12 21:21:38 -08:00
2015-03-10 09:26:22 +01:00
2015-04-25 22:05:07 +01:00

Read the documentation in qemu-doc.html or on http://wiki.qemu-project.org

- QEMU team
Description
QEMU With E2K User Support
Readme 459 MiB
Languages
C 83.1%
C++ 6.3%
Python 3.2%
Dylan 2.8%
Shell 1.6%
Other 2.8%