From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44577) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zz5gU-000181-3d for qemu-devel@nongnu.org; Wed, 18 Nov 2015 11:34:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zz5gT-0005Xq-1r for qemu-devel@nongnu.org; Wed, 18 Nov 2015 11:34:14 -0500 Date: Wed, 18 Nov 2015 17:34:06 +0100 From: Kevin Wolf Message-ID: <20151118163406.GI4817@noname.str.redhat.com> References: <1447836791-369-1-git-send-email-eblake@redhat.com> <1447836791-369-20-git-send-email-eblake@redhat.com> <874mgjvbtq.fsf@blackfin.pond.sub.org> <20151118120848.GB4817@noname.str.redhat.com> <564CA699.4000407@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="OgqxwSJOaUobr8KG" Content-Disposition: inline In-Reply-To: <564CA699.4000407@redhat.com> Subject: Re: [Qemu-devel] [PATCH v12 19/36] blkdebug: Merge hand-rolled and qapi BlkdebugEvent enum List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: Markus Armbruster , "open list:Block layer core" , qemu-devel@nongnu.org --OgqxwSJOaUobr8KG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Am 18.11.2015 um 17:26 hat Eric Blake geschrieben: > On 11/18/2015 05:08 AM, Kevin Wolf wrote: > > Am 18.11.2015 um 11:30 hat Markus Armbruster geschrieben: > >> Eric Blake 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. > >>> >=20 > >>> ## > >>> -{ '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.w= rite', > >> > >> 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. > >=20 > > 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. >=20 > 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. Oh, I don't really have an opinion whether BlockDebug, BlkDebug or Blkdebug is the best spelling. I think Blkdebug makes sense. But I do have a strong opinion on whether the enum should be called BlkdebugEvent or just Blkdbg (without any mention of "Event"). The latter doesn't describe any more what the type is about. > 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 mind the 'prefix' feature. I think it's nice to have short, but still unique enough constant names, but if Markus is bothered enough to send a patch, I can live with BLKDEBUG_EVENT_*. Kevin --OgqxwSJOaUobr8KG Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAEBAgAGBQJWTKh+AAoJEH8JsnLIjy/WnqoQALp/6QZAW3Q95QvfklNlYJUr GHcLH3LKz098IJga32P4b5VD8f/dK/BjKYauOkyxTi8I0/e84Ts5AD2OhvO6zG3G uZe7t6lDemSketOZ5v7PdcVLS78NAA8P6r7ZDXbJyoEnsQs7xCtPNh7VGa1zKc7D CA4Cl07A1cMyTsFaBhWSBA8VMh2aJOooLzrRyrA1ieemI+MHUANFbQh+NAkGF98r 5mqfieInrXlXLWDMoCrbA6w7WxDpvtJt6WY59HXxAC0aIh6KIwk5QCxKFfdaUvYG NCeA83aLke7bRHRb00x7WoPpsMtDfI5l8jm8xubce9MIIYQkV9R9MvLzG79+IAIt feRr7ZKwUdcCJvwjGissHd6UEp7W6qy0uFyD7oqmAbbTHajHpWfpM+tfLGZclofl MsxnrBDqfBZ5xCYuCaPwWR8pP7MdNh5RfzYl+H68ccTf7piGr1R1oioY+NzfQumt gPYePxDylh7b29tsIfrgSS6+weJ+EvIBX2PiHpqXL7s3E8mk4oxznCMcFYRfuq3h X658a2jReqCCR1dpecgWF4jrXx+ZqslnE5Ng5mBbKOfwH/LIHz123xwLoZkEqB/8 zg4t9Z9dwww3j4TInZGpjlrZioy3tu5XirUNHGnsnM+3SxEfd/bGFVZu1z5/M0MW 3PW7XqkaKyaDKHFOvBQY =m/85 -----END PGP SIGNATURE----- --OgqxwSJOaUobr8KG--