Am 18.11.2015 um 11:30 hat Markus Armbruster geschrieben: > Eric Blake <ebl...@redhat.com> 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 <kw...@redhat.com> > > Signed-off-by: Eric Blake <ebl...@redhat.com>
> > 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