unicorn/qemu/qapi
Eric Blake 25dad6e8d5
qmp: Fix reference-counting of qnull on empty output visit
Commit 6c2f9a15 ensured that we would not return NULL when the
caller used an output visitor but had nothing to visit. But
in doing so, it added a FIXME about a reference count leak
that could abort qemu in the (unlikely) case of SIZE_MAX such
visits (more plausible on 32-bit). (Although that commit
suggested we might fix it in time for 2.5, we ran out of time;
fortunately, it is unlikely enough to bite that it was not
worth worrying about during the 2.5 release.)

This fixes things by documenting the internal contracts, and
explaining why the internal function can return NULL and only
the public facing interface needs to worry about qnull(),
thus avoiding over-referencing the qnull_ global object.

It does not, however, fix the stupidity of the stack mixing
up two separate pieces of information; add a FIXME to explain
that issue, which will be fixed shortly in a future patch.

Backports commit a86156401559cb4401cf9ecc704faeab6fc8bb19 from qemu
2018-02-20 08:07:31 -05:00
..
common.json qapi: Add alias for ErrorClass 2018-02-19 20:38:51 -05:00
Makefile.objs
qapi-dealloc-visitor.c qapi: Drop unused 'kind' for struct/enum visit 2018-02-19 23:43:54 -05:00
qapi-visit-core.c qapi: Drop unused 'kind' for struct/enum visit 2018-02-19 23:43:54 -05:00
qmp-input-visitor.c qapi: Tighten qmp_input_end_list() 2018-02-19 23:44:45 -05:00
qmp-output-visitor.c qmp: Fix reference-counting of qnull on empty output visit 2018-02-20 08:07:31 -05:00
string-input-visitor.c qapi: Swap 'name' in visit_* callbacks to match public API 2018-02-19 23:36:52 -05:00