qemu/docs
Eric Blake 2c0ef9f411 qapi: Add new visit_free() function
Making each visitor provide its own (awkwardly-named) FOO_cleanup()
is unusual, when we can instead have a polymorphic visit_free()
interface.  Over the next few patches, we can use the polymorphic
functions to eliminate the need for a FOO_get_visitor() function
for accessing specific visitor functionality, once everything can
be accessed directly through the Visitor* interfaces.

The dealloc visitor is the first one converted to completely use
the new entry point, since qapi_dealloc_visitor_cleanup() was the
only reason that qapi_dealloc_get_visitor() existed, and only
generated and testsuite code was even using it.  With the new
visit_free() entry point in place, we no longer need to expose
the QapiDeallocVisitor subtype through qapi_dealloc_visitor_new(),
and can get by with less generated code, with diffs that look like:

| void qapi_free_ACPIOSTInfo(ACPIOSTInfo *obj)
| {
|-    QapiDeallocVisitor *qdv;
|     Visitor *v;
|
|     if (!obj) {
|         return;
|     }
|
|-    qdv = qapi_dealloc_visitor_new();
|-    v = qapi_dealloc_get_visitor(qdv);
|+    v = qapi_dealloc_visitor_new();
|     visit_type_ACPIOSTInfo(v, NULL, &obj, NULL);
|-    qapi_dealloc_visitor_cleanup(qdv);
|+    visit_free(v);
|}

Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <1465490926-28625-5-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
..
specs docs: update ACPI CPU hotplug spec with new protocol 2016-06-24 05:20:22 +03:00
aio_notify_accept.promela
aio_notify_bug.promela
aio_notify.promela
atomics.txt docs/atomics: update comparison with Linux 2016-05-29 09:11:11 +02:00
bitmaps.md
blkdebug.txt blkdebug: Merge hand-rolled and qapi BlkdebugEvent enum 2015-12-17 08:21:27 +01:00
blkverify.txt
bootindex.txt
build-system.txt docs: Add text for tests/docker in build-system.txt 2016-06-01 17:27:35 +08:00
ccid.txt
ich9-ehci-uhci.cfg
igd-assign.txt vfio/pci: Add IGD documentation 2016-05-26 11:12:05 -06:00
image-fuzzer.txt
live-block-ops.txt
memory-hotplug.txt
memory.txt memory: Provide memory_region_init_rom() 2016-07-04 13:06:35 +01:00
migration.txt migration: convert post-copy to use QIOChannelBuffer 2016-05-26 11:31:34 +05:30
multi-thread-compression.txt docs/multi-thread-compression: Fix wrong command string 2016-06-07 18:19:24 +03:00
multiple-iothreads.txt
multiseat.txt
pci_expander_bridge.txt pxb: cleanup 2016-03-11 16:59:12 +02:00
q35-chipset.cfg
qapi-code-gen.txt qapi: Add new visit_free() function 2016-07-06 10:52:04 +02:00
qcow2-cache.txt
qdev-device-use.txt
qemupciserial.inf
qmp-events.txt qmp event: Refactor QUORUM_REPORT_BAD 2016-03-14 16:46:43 +01:00
qmp-intro.txt
qmp-spec.txt qapi: Update docs to match recent generator changes 2016-03-05 10:41:16 +01:00
rcu.txt
rdma.txt
replay.txt replay: introduce block devices record/replay 2016-03-30 12:15:57 +02:00
spice-port-fqdn.txt
throttle.txt docs: Fix a couple of typos in throttle.txt 2016-06-07 18:19:23 +03:00
tracing.txt trace: add build framework for merging trace-events files 2016-06-20 17:22:14 +01:00
usb2.txt
usb-storage.txt
virtio-balloon-stats.txt
virtio-migration.txt
vnc-ledstate-Pseudo-encoding.txt
win32-qemu-event.promela
writing-qmp-commands.txt
xbzrle.txt
xen-save-devices-state.txt