qemu-e2k/scripts
Eric Blake 68ab47e4b4 qapi: Change visit_type_FOO() to no longer return partial objects
Returning a partial object on error is an invitation for a careless
caller to leak memory.  We already fixed things in an earlier
patch to guarantee NULL if visit_start fails ("qapi: Guarantee
NULL obj on input visitor callback error"), but that does not
help the case where visit_start succeeds but some other failure
happens before visit_end, such that we leak a partially constructed
object outside visit_type_FOO(). 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()
functions always leave a safe value in *obj during an input visitor
(either the new object on success, or NULL if an error is
encountered), so callers can now unconditionally use
qapi_free_FOO() to clean up regardless of whether an error occurred.

The decision is done by adding visit_is_input(), then updating the
generated code to check if additional cleanup is needed based on
the type of visitor in use.

Note that we still leave *obj unchanged after a scalar-based
visit_type_FOO(); I did not feel like auditing all uses of
visit_type_Enum() to see if the callers would tolerate a specific
sentinel value (not to mention having to decide whether it would
be better to use 0 or ENUM__MAX as that sentinel).

Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <1461879932-9020-25-git-send-email-eblake@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
2016-05-12 09:47:55 +02:00
..
kvm scripts/kvm/kvm_stat: Fix missing right parantheses and ".format(...)" 2016-02-22 18:40:22 +01:00
qemu-guest-agent
qemugdb scripts/gdb: Fix a python exception in mtree.py 2015-12-22 16:01:08 +08:00
qmp qmp-shell: fix pretty printing of JSON responses 2016-03-04 17:16:32 +01:00
tracetool Clean up includes some more 2016-03-22 22:20:16 +01:00
analyse-9p-simpletrace.py
analyze-migration.py migration: fix analyze-migration.py script 2015-11-04 13:40:13 +01:00
check-qerror.sh
checkpatch.pl checkpatch: add target_ulong to typelist 2016-04-05 11:46:52 +02:00
clean-includes * Log filtering from Alex and Peter 2016-03-24 21:42:40 +00:00
cleanup-trace-events.pl
cocci-macro-file.h
coverity-model.c coverity: Model g_memdup() 2015-12-17 17:33:49 +01:00
create_config io: add QIOChannelSocket class 2015-12-18 12:18:31 +00:00
disas-objdump.pl
dump-guest-memory.py memory: Drop MemoryRegion.ram_addr 2016-03-07 13:26:29 +01:00
extract-vsssdk-headers
feature_to_c.sh scripts/feature_to_c.sh: Include qemu/osdep.h rather than config.h 2016-02-16 14:29:27 +00:00
get_maintainer.pl get_maintainer.pl: fall back to git if only lists are found 2016-02-09 17:07:55 +01:00
gtester-cat
hxtool
make_device_config.sh
make-release
ordereddict.py qapi: Clean up qapi.py per pep8 2015-10-12 18:44:54 +02:00
qapi-commands.py qapi: Split visit_end_struct() into pieces 2016-05-12 09:47:55 +02:00
qapi-event.py qapi: Split visit_end_struct() into pieces 2016-05-12 09:47:55 +02:00
qapi-introspect.py qapi: Clean up includes in generated files 2016-02-16 14:29:27 +00:00
qapi-types.py Clean up includes some more 2016-03-22 22:20:16 +01:00
qapi-visit.py qapi: Change visit_type_FOO() to no longer return partial objects 2016-05-12 09:47:55 +02:00
qapi.py qapi: Use anonymous bases in QMP flat unions 2016-03-18 10:29:26 +01:00
qemu-binfmt-conf.sh
qemu-gdb.py gdb command: qemu handlers 2015-10-29 17:59:27 +00:00
qtest.py
refresh-pxe-roms.sh
shaderinclude.pl
signrom.py
simpletrace.py
switch-timer-api
texi2pod.pl scripts/text2pod.pl: Escape left brace 2015-11-02 14:50:27 +01:00
tracetool.py Revert "tracetool: use Python 2.4-compatible exception handling syntax" 2016-02-08 17:29:54 +01:00
update-linux-headers.sh update-linux-headers.sh: Fake types.h doesn't need to include anything 2016-03-16 12:48:11 +00:00
vmstate-static-checker.py static checker: e1000-82540em got aliased to e1000 2016-02-05 19:09:50 +05:30