qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC] QOM design - add instance data to Object


From: Liviu Ionescu
Subject: Re: [Qemu-devel] [RFC] QOM design - add instance data to Object
Date: Sun, 14 Jun 2015 21:47:24 +0300

> On 13 Jun 2015, at 12:29, Peter Crosthwaite <address@hidden> wrote:
> 
> There is a way :). Check object_class_get_parent. qdev.c uses it to
> implement device properties on multiple levels without overriding. You
> still need to explicit call to superclass in each child class but that
> is normal of OO syntaxes.

there is a way, but there is a catch, it must be applied to the explicit class 
of the current level, not of the current device object, since this might be the 
class of the child class.

so the detailed syntax to call the parent realize() is:

        
DEVICE_CLASS(object_class_get_parent(object_class_by_name(CURRENT_CLASS_TYPE_NAME)))->realize(dev,
 &local_err);


regards,

Liviu





reply via email to

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