On 05/29/2015 05:22 AM, Markus Armbruster wrote: > Kevin Wolf <kw...@redhat.com> writes: > >> Am 28.05.2015 um 14:21 hat Markus Armbruster geschrieben: >>> Touches vl.c, which gives me pretext to ask Paolo: would you be >>> willing to take this through your tree? Or should I take it through >>> mine? >> >> After this series we have an ugly half-converted state where >> qemu_opts_foreach() has both a return code and an Error object, >> and it's not generally true that an error is set for a failing >> return code. >> >> The most confusing part about this is that you have &error_abort almost >> everywhere, but the function doesn't actually abort on error, but rather >> returns a negative error code and leaves errp alone. > > True. The function contract spells it out, which hopefully reduces the > confusion somewhat.
Except that you don't enforce the contract; I suggested adding assert(!*errp) at the right place in the two conversions. > > Would you find NULL less confusing than &error_abort? NULL says to ignore errors, &error_abort says to diagnose errors as programming bugs. If we know we aren't going to have an error, I prefer diagnosing coding bugs. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature