Eric Blake <ebl...@redhat.com> writes: > On 10/12/2016 10:47 AM, Vladimir Sementsov-Ogievskiy wrote: >> HI all! >> >> My questions is: what are general recommendations in Qemu for return >> code, if we have Error **errp? >> What should I prefer: errp, duplicated by int return code, or void >> functions with errp? > > Markus has already had several threads commenting on this very topic in > the past. A lot of code uses void return, but some newer code is using
A recent one: Message-ID: <87a8ekfenp....@dusky.pond.sub.org> http://lists.gnu.org/archive/html/qemu-devel/2016-10/msg00435.html > the past. A lot of code uses void return, but some newer code is using > an int return for simplifying the call-sites (and glib prefers the int > rather than void return, as well). Markus was playing with a Coccinelle > script to see how painful a bulk-conversion of the code base would be, > but it is probably stalled behind more pressing work at the moment. Correct. >> void + errp seems good, just to not duplicate things. But it has a >> disadvantage of necessity of "local_err" and "error_propagate" in caller >> function, if its behaviour depends on callee function success...