qemu-e2k/qapi
Eric Blake 455ba08afd qmp: Don't abuse stack to track qmp-output root
The previous commit documented an inconsistency in how we are
using the stack of qmp-output-visitor.  Normally, pushing a
single top-level object puts the object on the stack twice:
once as the root, and once as the current container being
appended to; but popping that struct only pops once.  However,
qmp_ouput_add() was trying to either set up the added object
as the new root (works if you parse two top-level scalars in a
row: the second replaces the first as the root) or as a member
of the current container (works as long as you have an open
container on the stack; but if you have popped the first
top-level container, it then resolves to the root and still
tries to add into that existing container).

Fix the stupidity by not tracking two separate things in the
stack.  Drop the now-useless qmp_output_first() and
qmp_output_last() while at it.

Saved for a later patch: we still are rather sloppy in that
qmp_output_get_object() can be called in the middle of a parse,
rather than requiring that a visit is complete.

Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <1454075341-13658-26-git-send-email-eblake@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
2016-02-08 17:29:57 +01:00
..
Makefile.objs rename parse_enum_option to qapi_enum_parse and make it public 2014-09-08 11:12:43 +01:00
block-core.json qemu-img: Make MapEntry a QAPI struct 2016-02-02 17:50:48 +01:00
block.json fdc: add drive type qapi enum 2016-01-25 14:35:23 -05:00
common.json kvm: add support for -machine kernel_irqchip=split 2015-12-17 17:15:40 +01:00
crypto.json crypto: move QCryptoCipherAlgorithm/Mode enum definitions into QAPI 2015-12-23 11:02:20 +00:00
event.json Migration: Emit event at start of pass 2016-01-13 16:02:13 +05:30
introspect.json qapi: Document introspection stability considerations 2015-11-17 08:42:07 +01:00
opts-visitor.c qapi: Drop unused error argument for list and implicit struct 2016-02-08 17:29:57 +01:00
qapi-dealloc-visitor.c qapi: Drop unused error argument for list and implicit struct 2016-02-08 17:29:57 +01:00
qapi-util.c qapi: Clean up includes 2016-02-04 17:41:30 +00:00
qapi-visit-core.c qapi: Drop unused error argument for list and implicit struct 2016-02-08 17:29:57 +01:00
qmp-dispatch.c qapi: Clean up includes 2016-02-04 17:41:30 +00:00
qmp-event.c qapi: Clean up includes 2016-02-04 17:41:30 +00:00
qmp-input-visitor.c qapi: Drop unused error argument for list and implicit struct 2016-02-08 17:29:57 +01:00
qmp-output-visitor.c qmp: Don't abuse stack to track qmp-output root 2016-02-08 17:29:57 +01:00
qmp-registry.c qapi: Clean up includes 2016-02-04 17:41:30 +00:00
rocker.json qmp/hmp: add rocker device support 2015-06-12 13:42:17 +01:00
string-input-visitor.c qapi: Drop unused error argument for list and implicit struct 2016-02-08 17:29:57 +01:00
string-output-visitor.c qapi: Drop unused error argument for list and implicit struct 2016-02-08 17:29:57 +01:00
trace.json qapi: Use 'struct' instead of 'type' in schema 2015-05-05 18:39:01 +02:00