qapi: Fix QemuOpts visitor regression on unvisited input
commit21f88d021d0d2b4ecee8f6cd6ca63a943a3ce71d
authorEric Blake <eblake@redhat.com>
Wed, 22 Mar 2017 14:45:25 +0000 (22 09:45 -0500)
committerMarkus Armbruster <armbru@redhat.com>
Wed, 22 Mar 2017 18:24:34 +0000 (22 19:24 +0100)
tree76be1033f7586e3013120c86467ec05590bfdfed
parent9a6d1acb3e752e1e0b693cc0491fa12875b76be0
qapi: Fix QemuOpts visitor regression on unvisited input

An off-by-one in commit 15c2f669e meant that we were failing to
check for unparsed input in all QemuOpts visitors.  Recent testsuite
additions show that fixing the obvious bug with bogus fields will
also fix the case of an incomplete list visit; update the tests to
match the new behavior.

Simple testcase:

./x86_64-softmmu/qemu-system-x86_64 -nodefaults -nographic -qmp stdio -numa node,size=1g

failed to diagnose that 'size' is not a valid argument to -numa, and
now once again reports:

qemu-system-x86_64: -numa node,size=1g: Invalid parameter 'size'

See also https://bugzilla.redhat.com/show_bug.cgi?id=1434666

CC: qemu-stable@nongnu.org
Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Tested-by: Laurent Vivier <lvivier@redhat.com>
Message-Id: <20170322144525.18964-4-eblake@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
qapi/opts-visitor.c
tests/test-opts-visitor.c