qemu/hw/virtio
Eric Blake 1158bb2a05 qapi: Add parameter to visit_end_*
Rather than making the dealloc visitor track of stack of pointers
remembered during visit_start_* in order to free them during
visit_end_*, it's a lot easier to just make all callers pass the
same pointer to visit_end_*.  The generated code has access to the
same pointer, while all other users are doing virtual walks and
can pass NULL.  The dealloc visitor is then greatly simplified.

All three visit_end_*() functions intentionally take a void**,
even though the visit_start_*() functions differ between void**,
GenericList**, and GenericAlternate**.  This is done for several
reasons: when doing a virtual walk, passing NULL doesn't care
what the type is, but when doing a generated walk, we already
have to cast the caller's specific FOO* to call visit_start,
while using void** lets us use visit_end without a cast. Also,
an upcoming patch will add a clone visitor that wants to use
the same implementation for all three visit_end callbacks,
which is made easier if all three share the same signature.

For visitors with already track per-object state (the QMP visitors
via a stack, and the string visitors which do not allow nesting),
add an assertion that the caller is indeed passing the same
pointer to paired calls.

Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <1465490926-28625-4-git-send-email-eblake@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
2016-07-06 10:52:04 +02:00
..
Makefile.objs vring: remove 2016-02-25 13:14:19 +02:00
trace-events trace: split out trace events for hw/virtio/ directory 2016-06-20 17:22:15 +01:00
vhost-backend.c virtio: Clean up includes 2016-01-29 15:07:23 +00:00
vhost-user.c memory: split memory_region_from_host from qemu_ram_addr_from_host 2016-05-29 09:11:12 +02:00
vhost.c virtio-bus: remove old set_host_notifier callback 2016-06-24 08:47:35 +03:00
virtio-balloon.c qapi: Add parameter to visit_end_* 2016-07-06 10:52:04 +02:00
virtio-bus.c virtio: revert host notifiers to old semantics 2016-07-04 14:52:10 +03:00
virtio-mmio.c virtio-mmio: convert to ioeventfd callbacks 2016-06-24 08:47:35 +03:00
virtio-pci.c virtio-pci: convert to ioeventfd callbacks 2016-06-24 08:47:35 +03:00
virtio-pci.h hw/virtio: group virtio flags into an enum 2016-03-11 14:54:28 +02:00
virtio-rng.c include/qemu/osdep.h: Don't include qapi/error.h 2016-03-22 22:20:15 +01:00
virtio.c virtio: set low features early on load 2016-07-04 14:52:10 +03:00