On Fri, May 23, 2014 at 12:38 AM, Stefan Hajnoczi <stefa...@redhat.com> wrote: > On Fri, May 23, 2014 at 12:02:44AM +1000, Peter Crosthwaite wrote: >> On Thu, May 22, 2014 at 6:22 AM, Stefan Hajnoczi <stefa...@redhat.com> wrote: >> > +void object_property_add_alias(Object *obj, const char *name, >> > + Object *target_obj, const char >> > *target_name, >> > + Error **errp) >> > +{ >> > + AliasProperty *prop; >> > + ObjectProperty *target_prop; >> > + >> > + target_prop = object_property_find(target_obj, target_name, errp); >> > + if (!target_prop) { >> > + return; >> >> Not sure silent failure is right here. This should perhaps populate >> errp and then caller can decide to assert/ignore/report as needed. > > object_property_find() already populates errp so the error is not > silent. Did you miss the errp argument to object_property_find()? >
Yeh, so what's confused me here is using the function return to detect error rather than the error mechanism. Its all good. The alternative is the local_err = NULL / error_propagate pattern. Out of scope of this work, but should we really be using return value for error propagation when we have a usable errp argument? Regards, Peter > Stefan >