From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54206) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zz1Xn-0005yI-B1 for qemu-devel@nongnu.org; Wed, 18 Nov 2015 07:09:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zz1Xm-0003m2-DZ for qemu-devel@nongnu.org; Wed, 18 Nov 2015 07:08:59 -0500 Date: Wed, 18 Nov 2015 13:08:48 +0100 From: Kevin Wolf Message-ID: <20151118120848.GB4817@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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <874mgjvbtq.fsf@blackfin.pond.sub.org> 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: Markus Armbruster Cc: qemu-devel@nongnu.org, "open list:Block layer core" 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. > > > > get_event_by_name() could perhaps be replaced by qapi_enum_parse(), > > but I left that for another day. > > > > CC: Kevin Wolf > > Signed-off-by: Eric Blake > > diff --git a/qapi/block-core.json b/qapi/block-core.json > > index a07b13f..603eb60 100644 > > --- a/qapi/block-core.json > > +++ b/qapi/block-core.json > > @@ -1776,8 +1776,10 @@ > > # @BlkdebugEvent > > # > > # Trigger events supported by blkdebug. > > +# > > +# Since: 2.0 > > ## > > -{ '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. Kevin