qemu-devel
[Top][All Lists]
Advanced

[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: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v6 02/17] Add accelerator id and model name to CPUState
Date: Tue, 05 May 2015 08:36:45 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0

On 05/05/2015 07:26 AM, Eduardo Habkost wrote:
> On Mon, Apr 27, 2015 at 04:53:16PM +0200, Michael Mueller wrote:
>> The patch defines ids per accelerator and adds the accel_id and
>> the model_name to the CPUState. The accel_id is initialized by
>> common code, the model name needs to be initialized by target
>> specific code.
>>
>> Signed-off-by: Michael Mueller <address@hidden>
>> Acked-by: Christian Borntraeger <address@hidden>
>> ---
>>  include/qom/cpu.h |  5 +++++
>>  qapi-schema.json  |  9 +++++++++
>>  qom/cpu.c         | 14 ++++++++++++++
>>  3 files changed, 28 insertions(+)
>>

>>  
>> +# @AccelId
>> +#
>> +# Defines accelerator ids
>> +#
>> +# Since: 2.4

Might be nice to document the possible values, but not a show-stopper if
you don't.

>> +##
>> +{ '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.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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