qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH PULL v2 01/11] qapi: allow override of default e


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH PULL v2 01/11] qapi: allow override of default enum prefix naming
Date: Tue, 15 Sep 2015 08:00:28 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0

On 09/15/2015 04:16 AM, Daniel P. Berrange wrote:
> The camel_to_upper() method applies some heuristics to turn
> a mixed case type name into an all-uppercase name. This is
> used for example, to generate enum constant name prefixes.
> 
> The heuristics don't also generate a satisfactory name
> though. eg
> 
>   { 'enum': 'QCryptoTLSCredsEndpoint',
>     'data': ['client', 'server']}
> 
> Results in Q_CRYPTOTLS_CREDS_ENDPOINT_CLIENT. This has
> an undesirable _ after the initial Q and is missing an
> _ between the CRYPTO & TLS strings.
> 
> Rather than try to add more and more heuristics to try
> to cope with this, simply allow the QAPI schema to
> specify the desired enum constant prefix explicitly.
> 
> eg
> 
>   { 'enum': 'QCryptoTLSCredsEndpoint',
>     'prefix': 'QCRYPTO_TLS_CREDS_ENDPOINT',
>     'data': ['client', 'server']}
> 
> Now gives the QCRYPTO_TLS_CREDS_ENDPOINT_CLIENT name.
> 
> Signed-off-by: Daniel P. Berrange <address@hidden>
> ---

Since you are doing a v3; if you want, you can add:
Reviewed-by: Eric Blake <address@hidden>

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