Am 12.12.2012 19:16, schrieb Eduardo Habkost:
> So, just to check if I understood all correctly:
> 
> DeviceClass.init() is just the old and deprecated version of
> DeviceClass.realize() (just because the former has no Error parameter),
> but both have exactly the same semantics/purpose, and devices should now
> use DeviceClass.realize() instead. Correct?

Almost! Some qdev initfns today do things that instance_init should do
and realizefn shouldn't. Creating child devices in qdev initfn tampers
with our future ability to set realized = true recursively.

The other difference that I see (RFC) is that qdev uses an
only-the-instance's-class-sets-init approach, whereas with QOM any class
in the hierarchy can set/override the "virtual" method but needs to take
care of storing and (if desired) calling the parent's version itself,
i.e. an inversion of control towards child classes.

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