On Tue, 5 May 2015 11:46:04 -0300 Eduardo Habkost <ehabk...@redhat.com> wrote:
> On Tue, May 05, 2015 at 08:36:45AM -0600, Eric Blake wrote: > > On 05/05/2015 07:26 AM, Eduardo Habkost wrote: > > >> +{ 'enum': 'AccelId', > > >> + 'data': ['qtest', 'tcg', 'kvm', 'xen'] } > > >> + > > > > > > Not sure if it is better to have an enum or simply a string here. > > > > enum is almost always better when there is a finite set of possible > > strings - it's better documented, and when introspection is in place, > > will make it easier to determine when the set has grown. > > True, and there are other cases where we could use an enum internally in > QEMU (e.g. arrays for accelerator-specific data inside CPU classes). Actually the accelerator name currently represented as string (ac->name = "KVM";) can be initialized from the respective lookup value (AccelId_lookup[]) instead. >