qemu-devel
[Top][All Lists]
Advanced

[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: Kevin Wolf
Subject: Re: [Qemu-devel] [PATCH v12 19/36] blkdebug: Merge hand-rolled and qapi BlkdebugEvent enum
Date: Wed, 18 Nov 2015 13:08:48 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

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.
> >
> > get_event_by_name() could perhaps be replaced by qapi_enum_parse(),
> > but I left that for another day.
> >
> > CC: Kevin Wolf <address@hidden>
> > Signed-off-by: Eric Blake <address@hidden>

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]