History | View | Annotate | Download (14.6 kB)
json-parser: detect premature EOI
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
json-parser: add handling for NULL token list
Currently a NULL token list will crash the parser, instead we have itpass back a NULL QObject.
json-parser: propagate error from parser
Use GCC_FMT_ATTR (format checking)
Signed-off-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Merge remote branch 'qmp/for-anthony' into staging
Move stdbool.h
Move inclusion of stdbool.h to common header files, instead of includingin an ad-hoc manner.
Signed-off-by: Paul Brook <paul@codesourcery.com>
qjson: Handle "\f"
It's valid JSON and should be handled.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
json-parser: Output the content of invalid keyword
When input some invalid word 'unknowcmd' through QMP port, qemu outputsthis error message: "parse error: invalid keyword `%s'"
This patch makes qemu output the content of invalid keyword, like:
"parse error: invalid keyword `unknowcmd'"...
json-parser: Fix segfault on malformed input
If the parser fails to parse the key in parse_pair, it will access a NULLpointer. A simple way to trigger this is sending {foo} via QMP. This patchturns the segfault into a syntax error reply.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>...
json: fix PRId64 on Win32
OK we are fooled by the json lexer and parser. As we use %I64d toprint 'long long' variables in Win32, but lexer and parser only dealwith %lld but not %I64d, this patch add support for %I64d and solve'info pci', 'powser_reset' and 'power_powerdown' assert failure in...
json-parser: remove dead increment
clang-analyzer points out a redundant increment.
Signed-off-by: Amit Shah <amit.shah@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Add a JSON parser
This is the third and final stage of the JSON parser. It parses lexical tokensperforming grammar validation and creating the final QObject representation. Ituses a recursive decent parser.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>