qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH RFC 3/5] qapi: Use common name mangling for enum


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH RFC 3/5] qapi: Use common name mangling for enumeration constants
Date: Thu, 5 Nov 2015 15:36:54 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

On 11/05/2015 09:41 AM, Eric Blake wrote:

> In order to (later) support case-insensitive QMP, we need to decide up
> front that we will not allow any qapi member names to collide
> case-insensitively (outlaw 'a' and 'A' in the same struct; although the
> C code is still case-preserving); and now that this series is adding a
> single check_clash() function, it's very easy to do.  In fact, I'll add
> that to my series for 2.5 (it's always easier to reserve something now,
> especially if no one was using it, and then relax later; than it is to
> try and restrict things later but run into counter-cases).

Eww - it's not quite as trivial as I thought: we have QMP struct
'CpuInfo' as part of command 'query-cpus' that has both a 'pc' and 'PC'
member.  However, it's not unsalvageable: the type is made up of a bunch
of architecture-specific optional fields along with documentation that
"field x is only present for architecture y".  So it would be possible
to turn this type into a flat union, adding a new enum for architecture,
and separating the object so that 'pc' is part of the 'i386', 'x86_64',
and 'Sparc' branches, while 'PC' is part of the 'Mips' branch.

At any rate, I'll post an RFC.

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