qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v14 13/15] qapi: Enforce (or whitelist) case con


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v14 13/15] qapi: Enforce (or whitelist) case conventions on qapi members
Date: Wed, 2 Dec 2015 12:43:26 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

On 12/02/2015 10:19 AM, Markus Armbruster wrote:

>> With your patch, the positive tests no longer work in isolation.  You
>> were getting lucky that things sorted such that 'Foo' was checked for
>> correctness prior to 'UuidInfo'; but if you comment out the 'Foo'
>> declaration, or rename from 'Foo' to something else that hashes after
>> 'UuidInfo', then args-member-case and union-branch-case start reporting
>> failures about UuidInfo (and only enum-member-case honors the
>> whitelist).
> 
> You're right.
> 

>> +++ w/tests/qapi-schema/args-member-case.json
>> @@ -1,3 +1,3 @@
>>  # Member names should be 'lower-case' unless the struct/command is
>> whitelisted
>> -{ 'command': 'UuidInfo', 'data': { 'Arg': 'int' } }
>> +{ 'command': 'x-UuidInfo', 'data': { 'Arg': 'int' } }
> 
> Will fail as soon as we enforce the command naming convention.  To avoid
> that, we need to add a suitable name to the whitelist.
> 
> However, we don't actually have any command parameters to whitelist.
> Why bother testing it then?

Good point.


> 
>>From 44f07a40c8b9b5d1f24833028b5dacde1fd50c80 Mon Sep 17 00:00:00 2001
> From: Markus Armbruster <address@hidden>
> Date: Wed, 2 Dec 2015 17:41:55 +0100
> Subject: [PATCH] fixup! qapi: Enforce (or whitelist) case conventions on qapi
>  members
> 
> Signed-off-by: Markus Armbruster <address@hidden>
> ---
>  scripts/qapi.py                          | 6 ++----
>  tests/qapi-schema/args-member-case.err   | 2 +-
>  tests/qapi-schema/args-member-case.json  | 3 +--
>  tests/qapi-schema/enum-member-case.err   | 2 +-
>  tests/qapi-schema/enum-member-case.json  | 4 ++--
>  tests/qapi-schema/union-branch-case.err  | 2 +-
>  tests/qapi-schema/union-branch-case.json | 3 +--
>  7 files changed, 9 insertions(+), 13 deletions(-)

Looks good.  Commit 6c1eb345 on your qapi-not-next branch has this
already squashed in, but lacking your S-o-b.  But that only affects the
commit message, so I'll go ahead and base my future patch submissions on
top of the current contents of qapi-not-next (it will be interesting to
see how many patches land from various trees right after 2.6 opens up...)

-- 
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]