On 03/27/2012 11:19 AM, Paolo Bonzini wrote:
Il 26/03/2012 15:46, Andreas Färber ha scritto:
Hello Anthony,
Here's a mini series introducing ObjectClass::realize(Object *) and
forwarding it to existing DeviceClass::init(DeviceState *).
I think a major difference between realize and init should be that the
realize property also propagates down the whole composition tree (in
pre-order for setting to true, and post-order for setting to false).
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.
Likewise, unrealize() should do the same with reset().
Regards,
Anthony Liguori
An important, related point is whether the composition tree should be
created before or after realize/init. Right now the few examples in the
tree do it after, but this sounds wrong to me and would block the above
auto-propagation.
Paolo