[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v6 02/17] Add accelerator id and model name to C
From: |
Michael Mueller |
Subject: |
Re: [Qemu-devel] [PATCH v6 02/17] Add accelerator id and model name to CPUState |
Date: |
Wed, 6 May 2015 11:28:17 +0200 |
On Tue, 5 May 2015 11:46:04 -0300
Eduardo Habkost <address@hidden> 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.
>