Il 27/03/2012 18:33, Peter Maydell ha scritto:
>> > Yes, I haven't reviewed this series yet, but my expectation would be that
>> > realize propagates and that the default implementation of
>> > DeviceClass::realize() would explicitly *not* propagate and instead just
>> > call ::init.
> So who calls realize for non-qdev QOM objects which are children of
> qdev QOM objects?
> 
> I really don't like having the object lifecycle methods be different
> for DeviceClass than for base objects if we can avoid it.

The way I read it was that the "realize" property propagates to the
children and calls either the "realize" or "reset" method (in the
appropriate order).

DeviceClass::realize() would also do other things done currently by
qdev_init, such as register vmstate, so there would still be a
separation between DeviceClass::realize and DeviceClass::init (we do not
want yet another pass through the whole tree).

qdev_init would be a thin wrapper around object_realize that takes care
of freeing the object when init fails.

Is this correct?

Paolo

Reply via email to