> From: Peter Maydell [mailto:peter.mayd...@linaro.org]
> Sent: Wednesday, 25 November 2015 01:11
> On 25 November 2015 at 06:04, Peter Crosthwaite
> <crosthwaitepe...@gmail.com> wrote:
> > On Tue, Nov 24, 2015 at 4:00 PM, Andrew Baumann
> > <andrew.baum...@microsoft.com> wrote:
> >>In general, what's the guidance on what belongs in object init vs. the
> realize method?
> >
> > If it doesn't depend on property values, it goes in init. If it does
> > realize. Top level connectivity (e.g. connecting to UARTs are initing
> > drives) generally are realize.
> 
> Also, realize has a mechanism for reporting errors (the Error** argument)
> and instance init does not, so anything that might fail must go in
> realize.

How does this work out with object_property_add_alias? It can fail and returns 
an error, so it should be called from realize, but it adds a new property on 
the object, so the property won't be useful if it can only be set after realize 
has added it.

It seems like everyone calling object_property_add_alias passes &error_abort, 
so I suppose that is the get-out-of-jail card for reporting errors from init...

Thanks,
Andrew

Reply via email to