aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2014-09-29 18:18:28 +0100
committerPeter Maydell <peter.maydell@linaro.org>2014-09-29 18:18:29 +0100
commitb60a7726cc0f5cbb2aecdbba67aeaf54ffc2c9cf (patch)
treedf518fd99409be22df46188174833b5fd317be5f /scripts
parent70556264a89a268efba1d7e8e341adcdd7881eb4 (diff)
parenta631892f9d6440812af98588e9635f1a2a7260ff (diff)
Merge remote-tracking branch 'remotes/qmp-unstable/queue/qmp' into staging
* remotes/qmp-unstable/queue/qmp: Add HMP command "info memory-devices" qemu-socket: Eliminate silly QERR_ macros qemu-socket: Polish errors for connect() and listen() failure qemu-iotests: Test missing "driver" key for blockdev-add tests: add QMP input visitor test for unions with no discriminator qapi: dealloc visitor, implement visit_start_union qapi: add visit_start_union and visit_end_union virtio-balloon: fix integer overflow in memory stats feature monitor: Reset HMP mon->rs in CHR_EVENT_OPEN Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/qapi-visit.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/qapi-visit.py b/scripts/qapi-visit.py
index df9f7fb657..8f845a2b29 100644
--- a/scripts/qapi-visit.py
+++ b/scripts/qapi-visit.py
@@ -358,6 +358,9 @@ void visit_type_%(name)s(Visitor *m, %(name)s **obj, const char *name, Error **e
if (err) {
goto out_obj;
}
+ if (!visit_start_union(m, !!(*obj)->data, &err) || err) {
+ goto out_obj;
+ }
switch ((*obj)->kind) {
''',
disc_type = disc_type,
@@ -386,6 +389,9 @@ void visit_type_%(name)s(Visitor *m, %(name)s **obj, const char *name, Error **e
out_obj:
error_propagate(errp, err);
err = NULL;
+ visit_end_union(m, !!(*obj)->data, &err);
+ error_propagate(errp, err);
+ err = NULL;
}
visit_end_struct(m, &err);
out: