On 11/27/2013 06:24 PM, Igor Mammedov wrote: > in case if caller setting property doesn't care about error and > passes in NULL as errp argument but error occurs in property setter, > it is silently discarded leaving object in undefined state. > > As result it leads to hard to find bugs, so if caller doesn't > care about error it must be sure that property exists and > accepts provided value, otherwise it's better to abort early > since error case couldn't be handled gracefully and find > invalid usecase early. > > In addition multitude of property setters will be always > guarantied to have error object present and won't be required
s/guarantied/guaranteed/ > to handle this condition individually. > > Signed-off-by: Igor Mammedov <imamm...@redhat.com> > --- > +out: > + if (local_error) { This says local_error was set... > + if (!errp) { > + assert_no_error(local_error); so this assert_no_error() is dead code in its current position. To be useful, you probably want: if (!errp) { assert_no_error(local_error); } else if (local_error) { error_propagate(errp, local_error); } -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature