qobject: switch JSON parser to push
v2 cover qobject: switch JSON parser to push
This rewrites the json-parser to use a push parser aka state machine. While push parsers are inherently more complex than recursive descent, the grammar for JSON is simple enough that the parser remains readable. There is therefore no need to use e.g. QEMU coroutines.
Unlike the suggestion in commit 62815d85aed ("json: Redesign the callback to consume JSON values", 2018-08-24), I kept the json-streamer concept. It helps in handling input limits, it performs error recovery, and it converts the token-at-a-time push interface to callbacks---all things that are more easily done in a separate layer to keep the parser clean. However, there is no need anymore for it to store partial JSON objects in tokenized form, because the current state is stored in the push parser's stack.
Another benefit is that QEMU can report the first parsing error immediately, without waiting for parentheses to be balanced or for a lexing error. Error recovery then proceeds as before (i.e., the next parse still starts after balanced parentheses or a lexing error).
On top of the benefits intrinsic in the push architecture, it so happens that it's really easy to add a location to JSON parsing errors now, so do that as well.
The diffstat is unfavorable, but most of the new lines delta is really new comments explaining the grammar and state machines.
Paolo
v1->v2:
- remove part of the patch to pass around the lookahead token, it was hard to review and added little value
- separate patch to reuse the JSONParser
- separate patch to make brace/bracket count unsigned
- add comment with the structure of the stack
- add big comment with the grammar
- split long lines
- remove QObject **value argument to pop_entry()
- add assertions about the type of the top-of-stack
- change error to "key is not a string in object"
- split out json_parser_reset() already in the first patch
- rename json_parser_parse_token() to parse_token()
- do not use single quotes in commit messages
- move initialization of JSONToken close to usage
Paolo Bonzini (7):
json-parser: constify JSONToken
json-parser: replace with a push parser
json-streamer: reuse parser
json-streamer: make brace/bracket count unsigned
json-streamer: remove token queue
json-streamer: do not heap-allocate JSONToken
json-parser: add location to JSON parsing errors
include/qobject/json-parser.h | 16 +- qobject/json-parser-int.h | 13 +- qobject/json-lexer.c | 11 +- qobject/json-parser.c | 577 +++++++++++++++++++--------------- qobject/json-streamer.c | 120 +++---- 5 files changed, 412 insertions(+), 325 deletions(-)
Signature · 1 line
2.54.0
PATCH v2 1/7 json-parser: constify JSONToken
--- qobject/json-parser.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-)
qobject/json-parser.c +12 -11
@@ -55,7 +55,8 @@ static QObject *parse_value(JSONParserContext *ctxt);* Error handler */ static void G_GNUC_PRINTF(3, 4) parse_error(JSONParserContext *ctxt, - JSONToken *token, const char *msg, ...) + const JSONToken *token, + const char *msg, ...) {va_list ap;char message[1024 ];
@@ -126,7 +127,7 @@ static int cvt4hex(const char *s)* - Invalid Unicode characters are rejected. * - Control characters \x00..\x1F are rejected by the lexer. */ -static QString *parse_string (JSONParserContext *ctxt,JSONToken *token) +static QString *parse_string (JSONParserContext *ctxt,const JSONToken *token) {const char *ptr = token->str;GString *str;
@@ -239,14 +240,14 @@ out:* parser_context_pop_token is deleted as soon as parser_context_pop_token * is called again. */ -static JSONToken *parser_context_pop_token (JSONParserContext *ctxt) +static const JSONToken *parser_context_pop_token (JSONParserContext *ctxt) {g_free (ctxt->current); ctxt->current =g_queue_pop_head (ctxt->buf);return ctxt->current; } -static JSONToken *parser_context_peek_token (JSONParserContext *ctxt) +static const JSONToken *parser_context_peek_token (JSONParserContext *ctxt) {return g_queue_peek_head (ctxt->buf); }
@@ -259,7 +260,7 @@ static int parse_pair(JSONParserContext *ctxt, QDict *dict)QObject *key_obj =NULL ;QString *key;QObject *value; -JSONToken *peek, *token; +const JSONToken *peek, *token; peek =parser_context_peek_token (ctxt);if (peek ==NULL ) {
@@ -309,7 +310,7 @@ out:static QObject *parse_object (JSONParserContext *ctxt) {QDict *dict =NULL ; -JSONToken *token, *peek; +const JSONToken *token, *peek; token =parser_context_pop_token (ctxt);assert (token && token->type ==JSON_LCURLY );
@@ -363,7 +364,7 @@ out:static QObject *parse_array (JSONParserContext *ctxt) {QList *list =NULL ; -JSONToken *token, *peek; +const JSONToken *token, *peek; token =parser_context_pop_token (ctxt);assert (token && token->type ==JSON_LSQUARE );
@@ -426,7 +427,7 @@ out:static QObject *parse_keyword (JSONParserContext *ctxt) { -JSONToken *token; +const JSONToken *token; token =parser_context_pop_token (ctxt);assert (token && token->type ==JSON_KEYWORD );
@@ -444,7 +445,7 @@ static QObject *parse_keyword(JSONParserContext *ctxt)static QObject *parse_interpolation (JSONParserContext *ctxt) { -JSONToken *token; +const JSONToken *token; token =parser_context_pop_token (ctxt);assert (token && token->type ==JSON_INTERP );
@@ -480,7 +481,7 @@ static QObject *parse_interpolation(JSONParserContext *ctxt)static QObject *parse_literal (JSONParserContext *ctxt) { -JSONToken *token; +const JSONToken *token; token =parser_context_pop_token (ctxt);assert (token);
@@ -532,7 +533,7 @@ static QObject *parse_literal(JSONParserContext *ctxt)static QObject *parse_value (JSONParserContext *ctxt) { -JSONToken *token; +const JSONToken *token; token =parser_context_peek_token (ctxt);if (token ==NULL ) {
Signature · 1 line
2.54.0
PATCH v2 2/7 json-parser: replace with a push parser
In reply to Paolo BonziniIn order to avoid stashing all the tokens corresponding to a JSON value, embed the parsing stack and state machine in JSONParser. This is more efficient and allows for more prompt error recovery; it also does not make the code substantially larger than the current recursive descent parser, though the state machine is probably a bit harder to follow.
The stack consists of QLists and QDicts corresponding to open brackets and braces, plus optionally a QString with the current key on top of each QDict.
After each value is parsed, it is added to the top array or dictionary or, if the stack is empty, json_parser_feed returns the complete QObject.
For now, json-streamer.c keeps tracking the tokens up until braces and brackets are balanced, and then shoves the whole queue of tokens into the push parser. The only logic change is that JSON_END_OF_INPUT always triggers the emptying of the queue; the parser takes notice and checks that there is nothing on the stack. Not using brace_count and bracket_count for this is the first step towards improved separation of concerns between json-parser.c and json-streamer.c.
--- include/qobject/json-parser.h | 6 + qobject/json-parser-int.h | 5 +- qobject/json-parser.c | 548 +++++++++++++++++++--------------- qobject/json-streamer.c | 21 +- 4 files changed, 342 insertions(+), 238 deletions(-)
include/qobject/json-parser.h +6 -0
@@ -20,6 +20,12 @@ typedef struct JSONLexer {int x, y; } JSONLexer; +typedef struct JSONParserContext { +Error *err; +GQueue *stack; +va_list *ap; +}JSONParserContext ; + typedef struct JSONMessageParser { void (*emit)(void *opaque, QObject *json, Error *err); void *opaque;
qobject/json-parser-int.h +4 -1
@@ -49,6 +49,9 @@ void json_message_process_token(JSONLexer *lexer, GString *input,/* json-parser.c */ JSONToken *json_token (JSONTokenType type,int x,int y,GString *tokstr); -QObject *json_parser_parse (GQueue *tokens,va_list *ap,Error **errp); +void json_parser_init (JSONParserContext *ctxt,va_list *ap); +void json_parser_reset (JSONParserContext *ctxt); +QObject *json_parser_feed (JSONParserContext *ctxt,const JSONToken *token,Error **errp); +void json_parser_destroy (JSONParserContext *ctxt);#endif
qobject/json-parser.c +315 -233
611 lines not on this page · raw message
qobject/json-streamer.c +17 -4
@@ -32,6 +32,7 @@ void json_message_process_token(JSONLexer *lexer, GString *input, JSONTokenType type, int x, int y) { JSONMessageParser *parser = container_of(lexer, JSONMessageParser, lexer); +JSONParserContext ctxt;QObject *json =NULL ;Error *err =NULL ;JSONToken *token;
@@ -56,8 +57,7 @@ void json_message_process_token(JSONLexer *lexer, GString *input,if (g_queue_is_empty (&parser->tokens)) {return ; } - json =json_parser_parse (&parser->tokens, parser->ap, &err); - goto out_emit; +break ;default :break ; }
@@ -85,11 +85,24 @@ void json_message_process_token(JSONLexer *lexer, GString *input,g_queue_push_tail (&parser->tokens, token);if ((parser->brace_count >0 || parser->bracket_count >0 ) - && parser->brace_count >=0 && parser->bracket_count >=0 ) { + && parser->brace_count >=0 && parser->bracket_count >=0 + && type !=JSON_END_OF_INPUT ) {return ; } - json =json_parser_parse (&parser->tokens, parser->ap, &err); +json_parser_init (&ctxt, parser->ap); + +/* Process all tokens in the queue */ +while (!g_queue_is_empty (&parser->tokens)) { + token =g_queue_pop_head (&parser->tokens); + json =json_parser_feed (&ctxt, token, &err); +g_free (token); +if (json || err) { +break ; + } + } + +json_parser_destroy (&ctxt); out_emit: parser->brace_count =0 ;
Signature · 1 line
2.54.0
PATCH v2 3/7 json-streamer: reuse parser
In reply to Paolo BonziniThe push parser can be reset, so reuse it when the json-streamer detects a completed toplevel object.
--- include/qobject/json-parser.h | 2 +- qobject/json-streamer.c | 11 ++++------- 2 files changed, 5 insertions(+), 8 deletions(-)
include/qobject/json-parser.h +1 -1
@@ -29,8 +29,8 @@ typedef struct JSONParserContext { typedef struct JSONMessageParser { void (*emit)(void *opaque, QObject *json, Error *err); void *opaque; - va_list *ap; JSONLexer lexer; + JSONParserContext parser; int brace_count; int bracket_count; GQueue tokens;
qobject/json-streamer.c +4 -7
@@ -32,7 +32,6 @@ void json_message_process_token(JSONLexer *lexer, GString *input, JSONTokenType type, int x, int y) { JSONMessageParser *parser = container_of(lexer, JSONMessageParser, lexer); -JSONParserContext ctxt;QObject *json =NULL ;Error *err =NULL ;JSONToken *token;
@@ -90,26 +89,23 @@ void json_message_process_token(JSONLexer *lexer, GString *input,return ; } -json_parser_init (&ctxt, parser->ap); -/* Process all tokens in the queue */ while (!g_queue_is_empty (&parser->tokens)) { token =g_queue_pop_head (&parser->tokens); - json =json_parser_feed (&ctxt, token, &err); + json =json_parser_feed (&parser->parser, token, &err);g_free (token);if (json || err) {break ; } } -json_parser_destroy (&ctxt); - out_emit: parser->brace_count =0 ; parser->bracket_count =0 ;json_message_free_tokens (parser); parser->token_size =0 ; parser->emit (parser->opaque, json, err); +json_parser_reset (&parser->parser); } void json_message_parser_init(JSONMessageParser *parser,
@@ -119,12 +115,12 @@ void json_message_parser_init(JSONMessageParser *parser, { parser->emit = emit; parser->opaque = opaque; - parser->ap = ap; parser->brace_count =0 ; parser->bracket_count =0 ;g_queue_init (&parser->tokens); parser->token_size =0 ; +json_parser_init (&parser->parser, ap);json_lexer_init (&parser->lexer, !!ap); }
@@ -144,4 +140,5 @@ void json_message_parser_destroy(JSONMessageParser *parser) {json_lexer_destroy (&parser->lexer);json_message_free_tokens (parser); +json_parser_destroy (&parser->parser); }
Signature · 1 line
2.54.0
PATCH v2 4/7 json-streamer: make brace/bracket count unsigned
In reply to Paolo BonziniIt makes no sense to let brace_count and bracket_count go negative, also because it immediately ends error recovery and sets them both back to zero. Instead set them to zero *before* choosing whether to process the token queue; this makes it possible to have the fields as unsigned.
Note that JSON_END_OF_INPUT now forces the parentheses to appear balanced, so that the queue is emptied and an error is reported; hence, the "type != JSON_END_OF_INPUT" condition can be removed.
--- include/qobject/json-parser.h | 4 ++-- qobject/json-streamer.c | 19 ++++++++++++++++--- 2 files changed, 18 insertions(+), 5 deletions(-)
include/qobject/json-parser.h +2 -2
@@ -31,8 +31,8 @@ typedef struct JSONMessageParser {void *opaque;JSONLexer lexer;JSONParserContext parser; -int brace_count; -int bracket_count; +unsigned int brace_count; +unsigned int bracket_count;GQueue tokens;uint64_t token_size; } JSONMessageParser;
qobject/json-streamer.c +16 -3
@@ -41,12 +41,18 @@ void json_message_process_token(JSONLexer *lexer, GString *input, parser->brace_count++;break ;case JSON_RCURLY : +if (parser->brace_count <=0 ) { + goto end_error_recovery; + } parser->brace_count--;break ;case JSON_LSQUARE : parser->bracket_count++;break ;case JSON_RSQUARE : +if (parser->bracket_count <=0 ) { + goto end_error_recovery; + } parser->bracket_count--;break ;case JSON_ERROR :
@@ -56,6 +62,15 @@ void json_message_process_token(JSONLexer *lexer, GString *input,if (g_queue_is_empty (&parser->tokens)) {return ; } + end_error_recovery: +/* +* Cause error recovery to end immediately. +* If not in error recovery, the parser will raise an error +* (due to JSON_ERROR or unexpected JSON_R{CURLY,SQUARE}) +* but error recovery won't be entered at all. +*/ + parser->brace_count =0 ; + parser->bracket_count =0 ;break ;default :break ;
@@ -83,9 +98,7 @@ void json_message_process_token(JSONLexer *lexer, GString *input,g_queue_push_tail (&parser->tokens, token); -if ((parser->brace_count >0 || parser->bracket_count >0 ) - && parser->brace_count >=0 && parser->bracket_count >=0 - && type !=JSON_END_OF_INPUT ) { +if (parser->brace_count >0 || parser->bracket_count >0 ) {return ; }
Signature · 1 line
2.54.0
PATCH v2 5/7 json-streamer: remove token queue
In reply to Paolo BonziniNow fully exploit the push parser, feeding it one token at a time without having to wait until braces and brackets are balanced.
While the nesting counts are retained for error recovery purposes, the system can now report the first parsing error without waiting for parentheses to be balanced. This also means that JSON_ERROR can be handled in json-parser.c, not json-streamer.c.
After reporting the error, json-streamer.c then enters an error recovery mode where subsequent errors are suppressed. This mimics the previous error reporting behavior, but it provides prompt feedback on parsing errors. As an example, here is an example interaction with qemu-ga.
BEFORE (error reported only once braces are balanced):
Quoted 2 lines
Quoted 2 lines
{"execute":foo
}
<< {"error": {"class": "GenericError", "desc": "JSON parse error, invalid keyword 'foo'"}}
Quoted 1 line
Quoted 1 line
{"execute":"somecommand"}
<< {"error": {"class": "CommandNotFound", "desc": "The command somecommand has not been found"}}
AFTER (error reported immediately, but similar error recovery as before):
Quoted 1 line
Quoted 1 line
{"execute":foo
<< {"error": {"class": "GenericError", "desc": "JSON parse error, invalid keyword 'foo'"}}
Quoted 2 lines
Quoted 2 lines
}
{"execute":"somecommand"}
<< {"error": {"class": "CommandNotFound", "desc": "The command somecommand has not been found"}}
--- include/qobject/json-parser.h | 3 +- qobject/json-parser.c | 4 ++ qobject/json-streamer.c | 100 ++++++++++++++-------------------- 3 files changed, 46 insertions(+), 61 deletions(-)
include/qobject/json-parser.h +2 -1
@@ -33,7 +33,8 @@ typedef struct JSONMessageParser {JSONParserContext parser;unsigned int brace_count;unsigned int bracket_count; -GQueue tokens; +unsigned int token_count; +bool error;uint64_t token_size; } JSONMessageParser;
qobject/json-parser.c +4 -0
@@ -656,6 +656,10 @@ QObject *json_parser_feed(JSONParserContext *ctxt, const JSONToken *token,assert (!ctxt->err);switch (token->type) { +case JSON_ERROR : +parse_error (ctxt, token,"JSON parse error, stray '%s'" , token->str); +break ; +case JSON_END_OF_INPUT :/* Check for premature end of input */ if (!g_queue_is_empty (ctxt->stack)) {
qobject/json-streamer.c +40 -60
150 lines not on this page · raw message
Signature · 1 line
2.54.0
PATCH v2 6/7 json-streamer: do not heap-allocate JSONToken
In reply to Paolo BonziniThis is not needed with a push parser. Since it processes tokens immediately, the JSONToken can be created directly on the stack and does not need to copy the lexer's string data.
--- qobject/json-parser-int.h | 8 ++++++-- qobject/json-parser.c | 18 ------------------ qobject/json-streamer.c | 9 +++++++-- 3 files changed, 13 insertions(+), 22 deletions(-)
qobject/json-parser-int.h +6 -2
@@ -35,7 +35,12 @@ typedef enum json_token_type { JSON_MAX = JSON_END_OF_INPUT } JSONTokenType; -typedef struct JSONToken JSONToken ; +typedef struct JSONToken { +JSONTokenType type; +int x; +int y; +char *str; +}JSONToken ;/* json-lexer.c */ void json_lexer_init (JSONLexer *lexer,bool enable_interpolation);
@@ -48,7 +53,6 @@ void json_message_process_token(JSONLexer *lexer, GString *input, JSONTokenType type, int x, int y);/* json-parser.c */ -JSONToken *json_token (JSONTokenType type,int x,int y,GString *tokstr);void json_parser_init (JSONParserContext *ctxt,va_list *ap);void json_parser_reset (JSONParserContext *ctxt);QObject *json_parser_feed (JSONParserContext *ctxt,const JSONToken *token,Error **errp);
qobject/json-parser.c +0 -18
@@ -24,13 +24,6 @@#include "qobject/qstring.h" #include "json-parser-int.h" -struct JSONToken { -JSONTokenType type; -int x; -int y; -char str[]; -}; -/* * The JSON parser is a push parser, returning to the caller after every * token. Therefore it has an explicit representation of its parser
@@ -606,17 +599,6 @@ static QObject *parse_token(JSONParserContext *ctxt, const JSONToken *token)return NULL ; } -JSONToken *json_token (JSONTokenType type,int x,int y,GString *tokstr) -{ -JSONToken *token =g_malloc (sizeof (JSONToken) + tokstr->len +1 ); - - token->type = type; -memcpy (token->str, tokstr->str, tokstr->len); - token->str[tokstr->len] =0 ; - token->x = x; - token->y = y; -return token; -}void json_parser_reset (JSONParserContext *ctxt) {
qobject/json-streamer.c +7 -2
@@ -77,8 +77,13 @@ void json_message_process_token(JSONLexer *lexer, GString *input, }else if (parser->bracket_count + parser->brace_count >MAX_NESTING ) {error_setg (&err,"JSON nesting depth limit exceeded" ); }else { - g_autofree JSONToken *token = json_token(type, x, y, input); -QObject *json =json_parser_feed (&parser->parser, token, &err); +JSONToken token = (JSONToken ) { + .type = type, + .x = x, + .y = y, + .str = input->str + }; +QObject *json =json_parser_feed (&parser->parser, &token, &err);if (json) { parser->emit (parser->opaque, json,NULL ); }
Signature · 1 line
2.54.0
PATCH v2 7/7 json-parser: add location to JSON parsing errors
In reply to Paolo BonziniNow that all calls to parse_error have a token, add the line and column to the message. As far as I can see the two important TODOs (better errors and better EOI handling) are done, and the others (token range information and "parsed size"?) do not really matter or are handled better by json-streamer.c. So remove the list, which had sat unchanged since 2009.
This needs some adjustments to provide a good x and y for error messages. First of all, they switch from zero-based to one-based, which is safe because they were both sitting unused. Second, right now the x and y are those of the *last* character in the token. Modify json-lexer.c to freeze tok->x and tok->y at the first character added to the GString.
--- include/qobject/json-parser.h | 1 + qobject/json-lexer.c | 11 +++++++---- qobject/json-parser.c | 12 ++---------- 3 files changed, 10 insertions(+), 14 deletions(-)
include/qobject/json-parser.h +1 -0
@@ -17,6 +17,7 @@typedef struct JSONLexer {int start_state, state;GString *token; +int cur_x, cur_y;int x, y; }JSONLexer ;
qobject/json-lexer.c +7 -4
@@ -277,7 +277,8 @@ void json_lexer_init(JSONLexer *lexer, bool enable_interpolation) lexer->start_state = lexer->state = enable_interpolation ?IN_START_INTERP :IN_START ; lexer->token =g_string_sized_new (3 ); - lexer->x = lexer->y =0 ; + lexer->cur_x = lexer->cur_y =1 ; + lexer->x = lexer->y =1 ; }static void json_lexer_feed_char (JSONLexer *lexer,char ch,bool flush)
@@ -285,10 +286,10 @@ static void json_lexer_feed_char(JSONLexer *lexer, char ch, bool flush)int new_state;bool char_consumed = false; - lexer->x++; + lexer->cur_x++;if (ch =='\n' ) { - lexer->x =0 ; - lexer->y++; + lexer->cur_x =1 ; + lexer->cur_y++; }while (flush ? lexer->state != lexer->start_state : !char_consumed) {
@@ -316,6 +317,8 @@ static void json_lexer_feed_char(JSONLexer *lexer, char ch, bool flush)case IN_START :g_string_truncate (lexer->token,0 ); new_state = lexer->start_state; + lexer->x = lexer->cur_x; + lexer->y = lexer->cur_y;break ;case JSON_ERROR : json_message_process_token(lexer, lexer->token, JSON_ERROR,
qobject/json-parser.c +2 -10
@@ -126,15 +126,6 @@ typedef struct JSONParserStackEntry {#define BUG_ON (cond) assert(!(cond)) -/** -* TODO -* -* 0) make errors meaningful again -* 1) add geometry information to tokens -* 3) should we return a parsed size? -* 4) deal with premature EOI -*/ -static inline JSONParserStackEntry *current_entry (JSONParserContext *ctxt) {return g_queue_peek_tail (ctxt->stack);
@@ -172,7 +163,8 @@ static void G_GNUC_PRINTF(3, 4) parse_error(JSONParserContext *ctxt,va_start (ap, msg);vsnprintf (message,sizeof (message), msg, ap);va_end (ap); -error_setg (&ctxt->err,"JSON parse error, %s" , message); +error_setg (&ctxt->err,"JSON parse error at line %d, column %d, %s" , + token->y, token->x, message); }static int cvt4hex (const char *s)
Signature · 1 line
2.54.0
Fails "make check" for me:
Quoted 1 line
Quoted 1 line
Quoted 1 line
MESON_TEST_ITERATION=1 QTEST_QEMU_STORAGE_DAEMON_BINARY=./storage-daemon/qemu-storage-daemon RUST_BACKTRACE=1 MSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 MALLOC_PERTURB_=51 UBSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 G_TEST_DBUS_DAEMON=/work/armbru/qemu/tests/dbus-daemon.sh QTEST_QEMU_BINARY=./qemu-system-x86_64 PYTHON=/work/armbru/qemu/bld-x86/pyvenv/bin/python3 ASAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1 QTEST_QEMU_IMG=./qemu-img /work/armbru/qemu/bld-x86/tests/qtest/migration-test --tap -k --full
――――――――――――――――――――――――――――――――――――― ✀ ―――――――――――――――――――――――――――――――――――――
stderr:
Unexpected error in parse_error() at ../qobject/json-parser.c:166:
/work/armbru/qemu/bld-x86/tests/qtest/migration-test: JSON parse error at line 1, column 54, key is not a string in object
(test program exited with status code -6)
Backtrace:
#0 0x00007f89d03c2735 in abort () from /lib64/libc.so.6
#1 0x000056289af27c35 in error_handle (errp=0x56289b0cfc68 <error_abort>,
err=0x5628c8f7cad0) at ../util/error.c:37
#2 0x000056289af28b5d in error_propagate (
dst_errp=0x56289b0cfc68 <error_abort>, local_err=0x5628c8f7cad0)
at ../util/error.c:300
#3 0x000056289af1a632 in qobject_from_jsonv (
string=0x56289af87b60 "{ 'execute': 'migrate-set-parameters','arguments': { %s: %lld } }", ap=0x7ffd1bd86550, errp=0x56289b0cfc68 <error_abort>)
at ../qobject/qjson.c:76
#4 0x000056289af1a6f3 in qobject_from_vjsonf_nofail (
string=0x56289af87b60 "{ 'execute': 'migrate-set-parameters','arguments': { %s: %lld } }", ap=0x7ffd1bd86770) at ../qobject/qjson.c:97
#5 0x000056289aec789e in _qmp_fd_vsend_fds (fd=3, fds=0x0, fds_num=0,
fmt=0x56289af87b60 "{ 'execute': 'migrate-set-parameters','arguments': { %s: %lld } }", ap=0x7ffd1bd86770) at ../tests/qtest/libqmp.c:148
#6 0x000056289aec7a8e in qmp_fd_vsend (fd=3,
fmt=0x56289af87b60 "{ 'execute': 'migrate-set-parameters','arguments': { %s: %lld } }", ap=0x7ffd1bd86770) at ../tests/qtest/libqmp.c:190
#7 0x000056289aec24da in qtest_qmp_vsend (s=0x5628c8f3b6f0,
fmt=0x56289af87b60 "{ 'execute': 'migrate-set-parameters','arguments': { %s: %lld } }", ap=0x7ffd1bd86770) at ../tests/qtest/libqtest.c:872
#8 0x000056289aec2569 in qtest_vqmp (s=0x5628c8f3b6f0, Looks like interpolation broke.