qemu-patch-raspberry4/docs
Eric Blake 15c2f669e3 qapi: Split visit_end_struct() into pieces
As mentioned in previous patches, we want to call visit_end_struct()
functions unconditionally, so that visitors can release resources
tied up since the matching visit_start_struct() without also having
to worry about error priority if more than one error occurs.

Even though error_propagate() can be safely used to ignore a second
error during cleanup caused by a first error, it is simpler if the
cleanup cannot set an error.  So, split out the error checking
portion (basically, input visitors checking for unvisited keys) into
a new function visit_check_struct(), which can be safely skipped if
any earlier errors are encountered, and leave the cleanup portion
(which never fails, but must be called unconditionally if
visit_start_struct() succeeded) in visit_end_struct().

Generated code in qapi-visit.c has diffs resembling:

|@@ -59,10 +59,12 @@ void visit_type_ACPIOSTInfo(Visitor *v,
|         goto out_obj;
|     }
|     visit_type_ACPIOSTInfo_members(v, obj, &err);
|-    error_propagate(errp, err);
|-    err = NULL;
|+    if (err) {
|+        goto out_obj;
|+    }
|+    visit_check_struct(v, &err);
| out_obj:
|-    visit_end_struct(v, &err);
|+    visit_end_struct(v);
| out:

and in qapi-event.c:

@@ -47,7 +47,10 @@ void qapi_event_send_acpi_device_ost(ACP
|         goto out;
|     }
|     visit_type_q_obj_ACPI_DEVICE_OST_arg_members(v, &param, &err);
|-    visit_end_struct(v, err ? NULL : &err);
|+    if (!err) {
|+        visit_check_struct(v, &err);
|+    }
|+    visit_end_struct(v);
|     if (err) {
|         goto out;

Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <1461879932-9020-20-git-send-email-eblake@redhat.com>
[Conflict with a doc fixup resolved]
Signed-off-by: Markus Armbruster <armbru@redhat.com>
2016-05-12 09:47:55 +02:00
..
specs fw_cfg: Adopt /opt/RFQDN convention 2016-04-19 16:09:50 +02:00
aio_notify.promela AioContext: fix broken ctx->dispatching optimization 2015-07-22 12:41:40 +01:00
aio_notify_accept.promela AioContext: optimize clearing the EventNotifier 2015-07-22 12:41:40 +01:00
aio_notify_bug.promela AioContext: fix broken placement of event_notifier_test_and_clear 2015-07-22 12:41:40 +01:00
atomics.txt docs/atomics.txt: fix two typos 2015-04-30 16:05:48 +03:00
bitmaps.md docs: update bitmaps.md 2015-11-17 18:35:56 +08:00
blkdebug.txt blkdebug: Merge hand-rolled and qapi BlkdebugEvent enum 2015-12-17 08:21:27 +01:00
blkverify.txt blkverify: Add block driver for verifying I/O 2010-09-21 17:00:53 +02:00
bootindex.txt Typo, spelling and grammatical fixes 2013-04-12 14:33:20 +02:00
build-system.txt docs: describe the QEMU build system structure / design 2015-09-25 12:20:18 +02:00
ccid.txt libcacard: improve documentation 2014-06-10 07:44:01 +02:00
ich9-ehci-uhci.cfg usb: update documentation 2011-07-08 11:25:56 +02:00
image-fuzzer.txt docs: List all image elements currently supported by the fuzzer 2014-09-22 11:39:35 +01:00
live-block-ops.txt docs: describe live block operations 2012-01-26 14:49:18 +01:00
memory-hotplug.txt docs: update documentation for memory hot unplug 2015-04-27 21:07:38 +02:00
memory.txt docs: fix typo in memory.txt 2016-04-08 00:07:43 +02:00
migration.txt postcopy: Remove the x- 2016-03-11 17:53:59 +05:30
multi-thread-compression.txt docs: Add a doc about multiple thread compression 2015-05-06 17:36:57 +02:00
multiple-iothreads.txt docs/multiple-iothreads.txt: add documentation on IOThread programming 2014-08-15 15:07:13 +02:00
multiseat.txt maint: remove / fix many doubled words 2015-09-11 10:21:38 +03:00
pci_expander_bridge.txt pxb: cleanup 2016-03-11 16:59:12 +02:00
q35-chipset.cfg q35: Add PCIe switch to example q35 configuration 2013-08-21 12:39:15 +03:00
qapi-code-gen.txt qapi: Split visit_end_struct() into pieces 2016-05-12 09:47:55 +02:00
qcow2-cache.txt docs: document how to configure the qcow2 L2/refcount caches 2015-09-04 21:00:32 +02:00
qdev-device-use.txt docs: Fix qdev-device-use.txt typo in -chardev serial, path=COM<NUM> 2011-09-09 09:43:17 +01:00
qemupciserial.inf Docs: Introduce multiport serial support in qemupciserial.inf. 2014-03-12 10:33:23 +01:00
qmp-events.txt qmp event: Refactor QUORUM_REPORT_BAD 2016-03-14 16:46:43 +01:00
qmp-intro.txt docs: Move files from docs/qmp/ to docs/ 2015-10-12 18:44:53 +02:00
qmp-spec.txt qapi: Update docs to match recent generator changes 2016-03-05 10:41:16 +01:00
rcu.txt doc/rcu: fix g_free_rcu() usage example 2015-10-19 10:13:07 +02:00
rdma.txt rdma: Fix incorrect description in comments 2014-09-20 17:55:53 +04:00
replay.txt replay: introduce block devices record/replay 2016-03-30 12:15:57 +02:00
spice-port-fqdn.txt docs: add spice-port-fqdn.txt 2012-12-17 14:01:41 +01:00
throttle.txt docs: Document the throttling infrastructure 2016-02-22 14:08:07 +01:00
tracing.txt docs: Update documentation for stderr (now log) tracing backend. 2016-03-31 09:48:59 +01:00
usb-storage.txt Fix typos and misspellings 2013-03-22 13:25:07 +01:00
usb2.txt usb: update docs for bus name change 2013-04-03 11:39:43 +02:00
virtio-balloon-stats.txt virtio-balloon: return empty data when no stats are available 2014-05-25 12:46:58 +03:00
virtio-migration.txt virtio: add some migration doc 2015-10-22 14:34:48 +03:00
vnc-ledstate-Pseudo-encoding.txt doc: document the Pseudo-encoding of LED state 2013-04-29 08:28:51 -05:00
win32-qemu-event.promela qemu-thread: add a fast path to the Win32 QemuEvent 2015-09-24 20:52:28 +02:00
writing-qmp-commands.txt error: More error_setg() usage 2015-11-11 18:56:26 +01:00
xbzrle.txt xbzrle: optimize XBZRLE to decrease the cache misses 2015-01-15 17:49:43 +05:30
xen-save-devices-state.txt Introduce "xen-save-devices-state" 2012-03-19 18:21:00 +00:00