qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v9 02/17] qapi: Reserve '*List' type names for a


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v9 02/17] qapi: Reserve '*List' type names for arrays
Date: Tue, 20 Oct 2015 12:12:15 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

On 10/19/2015 10:14 AM, Markus Armbruster wrote:
> Eric Blake <address@hidden> writes:
> 
>> We already reserved '*Kind' for implicit enums (since commit
> 
> "We reserved '*Kind' since" sounds odd.  Present tense?
> 
>> 4dc2e69), but failed to reserve '*List' for array types.  Since
>> no QMP was yet using it, we might as well make the reservation
>> official.
> 
> Uhm, how can we fail to reserve something, and then make the reservation
> official?  I think what you're trying to say is something like
> 
>     Type names ending in 'List' can clash with array types in generated
>     C.  We don't currently use such names.  Outlaw them.
> 
>     Precedence: commit 4dc2e69 outlawed names ending in 'Kind', because
>     they can clash with implicit enum types of unions.
> 

Okay, your wording has some improvements.  I'll take those ideas and try
again.

>> Note that this forbids creation of new types or commands ending
>> in 'List', but does NOT forbid abuse of attempts like ['intList']
>> for creating a 2-dimensional array of 'int'.
> 
> Really?  If I write ['T'], then T must be a declared type, mustn't it?
> And after this patch, I cant declare type intList, can I?

You can't declare { 'struct': 'intList' }, but I was worried whether you
can abuse the type system by using { 'struct':'S', 'data': {
'two-d':['intList'] } }.  But I guess I should actually test things
rather than trying to mis-remember past conversations; a quick test shows:

/home/eblake/qemu/tests/qapi-schema/qapi-schema-test.json:10: Member
'two-d' of 'data' for struct 'S' uses unknown type 'intList'

so what we were experimenting with earlier was [['int']] and not
['intList'].  I'll update the paragraph accordingly.

> 
>>                                               The whole idea of
>> multi-dimensional arrays needs more design thought, best left for
>> another day.
>>
>> Signed-off-by: Eric Blake <address@hidden>
> 
> Patch looks good to me.
> 

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