Commit Graph

11 Commits

Author SHA1 Message Date
Eric Blake
d8f8b1925c
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.

Backports commit cf3935907b5df16f667d54ad6761c7e937dcf425 from qemu
2018-02-19 13:23:55 -05:00
Eric Blake
79c351d3e6
qapi: Fix generation of 'size' builtin type
We were missing the 'size' builtin type (which means that QAPI using
[ 'size' ] would fail to compile).

Backports commit cb17f79eef0d161e81ac457e4c1f124405be2a18 from qemu
2018-02-19 13:20:05 -05:00
Eric Blake
9d5a99b029
qapi: Simplify builtin type handling
There was some redundancy between builtin_types[] and
builtin_type_qtypes{}.  Merge them into one.

Backports commit b52c4b9cf0bbafdf8cede4ea1f62770d86815718 from qemu
2018-02-19 13:15:21 -05:00
Eric Blake
bf18f16174
qapi: Drop dead genlist parameter
Defaulting a parameter to True, then having all callers omit or
pass an explicit True for that parameter, is pointless. Looks
like it has been dead since introduction in commit 06d64c6, more
than 4 years ago.

Backports commit 6540e9f35bfeea2baf4509745516172070dca412 from qemu
2018-02-19 13:09:44 -05:00
Eric Blake
3aba81d5aa
qapi: Drop unused error argument for list and implicit struct
No backend was setting an error when ending the visit of a list or
implicit struct, or when moving to the next list node. Make the
callers a bit easier to follow by making this a part of the contract,
and removing the errp argument - callers can then unconditionally end
an object as part of cleanup without having to think about whether a
second error is dominated by a first, because there is no second
error.

A later patch will then tackle the larger task of splitting
visit_end_struct(), which can indeed set an error.

Backports commit 08f9541dec51700abef0c37994213164ca4e4fc9 from qemu
2018-02-19 12:59:54 -05:00
xorstream
8840d5b42b Save copies of generated qapi files. 2017-01-21 00:30:50 +11:00
Nguyen Anh Quynh
7e2234237c del qemu/scripts/dump-guest-memory.py 2017-01-19 20:56:07 +08:00
Nguyen Anh Quynh
f2691b0107 more cleanup qemu/configure 2017-01-19 14:11:54 +08:00
Chris Eagle
986096d443 fix file perms 2015-08-28 21:05:38 -07:00
Chris Eagle
94ac0f02e6 file permissions changes 2015-08-28 20:03:36 -07:00
Nguyen Anh Quynh
344d016104 import 2015-08-21 15:04:50 +08:00