Re: [Qemu-devel] [PATCH v9 35/37] qapi: Change visit_type_FOO() to no longer return partial objects

2016-01-29 Thread Eric Blake
On 01/29/2016 05:03 AM, Markus Armbruster wrote: > > With (1) don't assign, the caller can pick an error value by assigning > it before the visit, and it must not access the value on error unless it > does. > > With (2) assign zero, the caller can't pick an error value, but may > safely access

Re: [Qemu-devel] [PATCH v9 35/37] qapi: Change visit_type_FOO() to no longer return partial objects

2016-01-29 Thread Markus Armbruster
Eric Blake writes: > On 01/28/2016 08:24 AM, Markus Armbruster wrote: >> Eric Blake writes: >> >>> Returning a partial object on error is an invitation for a careless >>> caller to leak memory. As no one outside the testsuite was actually >>> relying on

Re: [Qemu-devel] [PATCH v9 35/37] qapi: Change visit_type_FOO() to no longer return partial objects

2016-01-28 Thread Eric Blake
On 01/28/2016 08:24 AM, Markus Armbruster wrote: > Eric Blake writes: > >> Returning a partial object on error is an invitation for a careless >> caller to leak memory. As no one outside the testsuite was actually >> relying on these semantics, it is cleaner to just document

Re: [Qemu-devel] [PATCH v9 35/37] qapi: Change visit_type_FOO() to no longer return partial objects

2016-01-28 Thread Markus Armbruster
Eric Blake writes: > Returning a partial object on error is an invitation for a careless > caller to leak memory. As no one outside the testsuite was actually > relying on these semantics, it is cleaner to just document and > guarantee that ALL pointer-based visit_type_FOO()