qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v3 06/14] qapi: require valid expressions


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v3 06/14] qapi: require valid expressions
Date: Thu, 14 Aug 2014 06:26:08 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.7.0

On 08/14/2014 03:38 AM, Markus Armbruster wrote:
> Eric Blake <address@hidden> writes:
> 
>> The previous patch demonstrated that the generator could get
>> confused if an expression had conflicting meta-types, and
>> silently ignored expressions that lacked a known meta-type.
>> Fix both cases to give a sane error message.
>>
>> * scripts/qapi.py (check_exprs): Require a valid meta-type for
>> every expression.
>> * tests/qapi-schema/indented-expr.*: Use valid types.
>> * tests/qapi-schema/missing-type.*: Update expected output.
>> * tests/qapi-schema/double-type.*: Likewise.
> 
> Conventional git commit message followed by GNU change log.  Unusual in
> QEMU.  Same elsewhere.

Habits die hard :)

> 
> Explanation of the change to indented-expr.json hides in the change log
> part, where I promptly missed it :)

Okay, I'll make the subject line capitalized (which is more popular,
even if not universal) and ditch the GNU style suffix (inlining any meat
into the paragraph form) on my respin.

>> +        # 'include' has already been flattened; at this point, all exprs
>> +        # should have one of the remaining keys
>> +        keys = (expr.has_key('enum') + expr.has_key('union') +
>> +                expr.has_key('type') + expr.has_key('command') +
>> +                expr.has_key('event'))
>> +        if keys < 1:
>> +            raise QAPIExprError(info,
>> +                                "Missing expression meta-type")
>> +        if keys > 1:
>> +            raise QAPIExprError(info,
>> +                                "Conflicting expression meta-types")
>> +
>>          if expr.has_key('union'):
>>              check_union(expr, info)
>>          if expr.has_key('event'):
> 
> Not the friendliest error messages, but they'll do.

I'm open to bike-shedding suggestions :)  But in the absence of a
suggestion, I'll keep this part unchanged in v4.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]