diff options
author | Markus Armbruster <armbru@redhat.com> | 2018-12-06 13:17:43 +0100 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2018-12-13 19:20:11 +0100 |
commit | 00382fa85126edc63720480fd22458e1af4e58c7 (patch) | |
tree | 6b0eebd23e31fcbdcb6c8a3ec0dd9da963e8fddc /tests/qemu-iotests | |
parent | aee03bf3674d80c8f08e83d8100648332e29f7cb (diff) |
json: Fix to reject duplicate object member names
The JSON parser happily accepts duplicate object member names. The
last value wins. Reproducer #1:
$ qemu-system-x86_64 -qmp stdio
{"QMP": {"version": {"qemu": {"micro": 93, "minor": 0, "major": 3},
"package": "v3.1.0-rc3-7-g87a45d86ed"}, "capabilities": []}}
{'execute':'qmp_capabilities'}
{"return": {}}
{'execute':'blockdev-add','arguments':{'driver':'null-co',
'node-name':'foo','node-name':'bar'}}
{"return": {}}
{'execute':'query-named-block-nodes'}
{"return": [{ [...] "node-name": "bar" [...] }]}
Reproducer #2 is iotest 229.
Fix the parser to reject duplicates, and fix iotest 229 not to use
them.
Reported-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20181206121743.20762-1-armbru@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
[Trailing whitespace tidied up]
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'tests/qemu-iotests')
-rwxr-xr-x | tests/qemu-iotests/229 | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/tests/qemu-iotests/229 b/tests/qemu-iotests/229 index 86602437ff..893d098ad2 100755 --- a/tests/qemu-iotests/229 +++ b/tests/qemu-iotests/229 @@ -69,7 +69,6 @@ echo _send_qemu_cmd $QEMU_HANDLE \ "{'execute': 'drive-mirror', 'arguments': {'device': 'testdisk', - 'mode': 'absolute-paths', 'format': '$IMGFMT', 'target': '$DEST_IMG', 'sync': 'full', |