[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: |
Eduardo Habkost |
Subject: |
Re: [Qemu-devel] [PATCH v6 02/17] Add accelerator id and model name to CPUState |
Date: |
Tue, 5 May 2015 11:46:04 -0300 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
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).
--
Eduardo