qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC 04/34] qdev: Prepare "realized" property


From: Andreas Färber
Subject: Re: [Qemu-devel] [RFC 04/34] qdev: Prepare "realized" property
Date: Wed, 12 Dec 2012 19:25:01 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0

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

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