[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v12 19/36] blkdebug: Merge hand-rolled and qapi
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v12 19/36] blkdebug: Merge hand-rolled and qapi BlkdebugEvent enum |
Date: |
Wed, 18 Nov 2015 09:26:01 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
On 11/18/2015 05:08 AM, Kevin Wolf wrote:
> Am 18.11.2015 um 11:30 hat Markus Armbruster geschrieben:
>> Eric Blake <address@hidden> writes:
>>
>>> No need to keep two separate enums, where editing one is likely
>>> to forget the other. Now that we can specify a qapi enum prefix,
>>> we don't even have to change the bulk of the uses.
>>>
>>> ##
>>> -{ 'enum': 'BlkdebugEvent',
>>> +{ 'enum': 'BlkdebugEvent', 'prefix': 'BLKDBG',
>>> 'data': [ 'l1_update', 'l1_grow.alloc_table', 'l1_grow.write_table',
>>> 'l1_grow.activate_table', 'l2_load', 'l2_update',
>>> 'l2_update_compressed', 'l2_alloc.cow_read', 'l2_alloc.write',
>>
>> I'm no friend of the 'prefix' feature. You could avoid it here by
>> renaming BlkdebugEvent to Blkdbg. No additional churn, because you
>> already replace hand-written BlkDebugEvent by generated BlkdebugEvent.
>>
>> Alternatively, you could reduce churn by renaming it to BlkDebugEvent.
>>
>> Matter of taste. Perhaps Kevin has a preference.
>
> Wouldn't that mean that we end up with a C type called Blkdbg? In my
> opinion that's a bit unspecific, so if you ask me, I would paint my
> bikeshed in a different colour.
Most of the existing qapi names are Blkdebug, it was only the internal
enum being replaced that used BlkDebug. Also, qapi would munge BlkDebug
into BLK_DEBUG, so I think we want to stick with the lowercase 'd' so
that the munging (without 'prefix') would stick to BLKDEBUG.
I'm also fine if you want me to do a followup patch that renames all
enums from BLKDBG_L1_UPDATE to BLKDEBUG_EVENT_L1_UPDATE, at which point
we could drop the 'prefix' (I don't know how many lines it would make
long enough to need different wrapping, but modulo wrapping it would all
be a mechanically scripted change).
I don't have a favorite color in this painting match, so let me know
yours :)
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
[Qemu-devel] [PATCH v12 35/36] qapi: Simplify visits of optional fields, Eric Blake, 2015/11/18
[Qemu-devel] [PATCH v12 33/36] qapi: Fix alternates that accept 'number' but not 'int', Eric Blake, 2015/11/18
[Qemu-devel] [PATCH v12 29/36] qobject: Rename qtype_code to QType, Eric Blake, 2015/11/18