]> git.proxmox.com Git - mirror_qemu.git/commit - qapi/qobject-input-visitor.c
qmp-input: Require struct push to visit members of top dict
authorEric Blake <eblake@redhat.com>
Thu, 28 Apr 2016 21:45:18 +0000 (15:45 -0600)
committerMarkus Armbruster <armbru@redhat.com>
Thu, 12 May 2016 07:47:54 +0000 (09:47 +0200)
commitce140b176920b5b65184020735a3c65ed3e9aeda
treeed9bf91302caff9ef3b30d9267d32189b0ba7283
parentad739706bbadee49f164b4b7f4c7f5454ddf83cd
qmp-input: Require struct push to visit members of top dict

Don't embed the root of the visit into the stack of current
containers being visited.  That way, we no longer get confused
on whether the first visit of a dictionary is to the dictionary
itself or to one of the members of the dictionary, based on
whether the caller passed name=NULL; and makes the QMP Input
visitor like other visitors where the value of 'name' is now
ignored on the root visit.  (We may someday want to revisit
the rules on what 'name' should be on a top-level visit,
rather than just ignoring it; but that would be the topic of
another patch).

An audit of all qmp_input_visitor_new() call sites shows that
there were only two places where callers had previously been
visiting to a QDict with a non-NULL name to bypass a call to
visit_start_struct(), and those were fixed in prior patches.

Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <1461879932-9020-11-git-send-email-eblake@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
qapi/qmp-input-visitor.c