Hi On Mon, Dec 21, 2015 at 6:08 PM, Eric Blake <ebl...@redhat.com> wrote: > 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() 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 <ebl...@redhat.com> >
Reviewed-by: Marc-André Lureau <marcandre.lur...@redhat.com> -- Marc-André Lureau