qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH RFC 4/7] qom: Introduce CPU class


From: Andreas Färber
Subject: Re: [Qemu-devel] [PATCH RFC 4/7] qom: Introduce CPU class
Date: Tue, 31 Jan 2012 11:36:39 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111220 Thunderbird/9.0

Am 30.01.2012 03:14, schrieb Anthony Liguori:
> On 01/29/2012 07:25 AM, Andreas Färber wrote:
>> +static TypeInfo cpu_type_info = {
>> +    .name = TYPE_CPU,
>> +    .parent = TYPE_OBJECT,
>> +    .instance_size = sizeof(CPU),
> 
> 
> Probably want to do CPUState or something of that nature so that you can
> use CPU() as a dynamic_cast macro.

My testing seems to indicate CPU and CPU(obj) can co-exist (GCC 4.6.2).

Considered name alternatives:

CPUState - already taken as #define for legacy CPU${arch}State
CPUCore - fits ARM but there's socket vs. core vs. thread on x86
CPUCommon - puts the emphasis on common, which is not a noun
CommonCPU - no other base class uses such a naming scheme
CPUModel - it's not just a model but the state of one instance
CPUFamily - same as for CPUModel

CPUState would be nicest IMO, but refactoring CPUState into something
else just to refactor it back to QOM CPUState feels like churn.

Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg



reply via email to

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