Markus Armbruster <arm...@redhat.com> writes:

> Eric Blake <ebl...@redhat.com> writes:
>
>> Now that we know every expression is valid with regards to
>> its keys, we can add further tests that those keys refer to
>> valid types.  With this patch, all references to a type (the
>> 'data': of command, type, union, and event, and the 'returns':
>> of command) must resolve to a builtin or another type declared
>> by the current qapi parse; this includes recursing into each
>> member of a data dictionary.  Dealing with '**' and nested
>> sub-structs will be done in later patches.
>>
>> Update the testsuite to match improved output.
>>
>> Signed-off-by: Eric Blake <ebl...@redhat.com>
[...]
>> @@ -262,6 +308,15 @@ def check_command(expr, expr_info):
>>          raise QAPIExprError(expr_info,
>>                              "command '%s' is already defined" % name)
>>      commands.append(name)
>> +    check_type(expr_info, "'data' for command '%s'" % name,
>> +               expr.get('data'), allow_array=True,
>> +               allowed_names=['union', 'struct'])
>> +    check_type(expr_info, "'base' for command '%s'" % name,
>> +               expr.get('base'), allowed_names=['struct'],
>> +               allow_dict=False)
>> +    check_type(expr_info, "'returns' for command '%s'" % name,
>> +               expr.get('returns'), allow_array=True,
>> +               allowed_names=['built-in', 'union', 'struct', 'enum'])
>>
>
> Nicely done.

Wait a sec!  What's a command's 'base'?

[...]

Reply via email to