提交 9369348e 编写于 作者: P Peter Krempa

tests: qemucapsprobemock: Fail if JSON reply from qemu can't be reformatted

Rather than skipping output on failure fail loudly.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
上级 0ed27165
......@@ -86,9 +86,12 @@ qemuMonitorJSONIOProcessLine(qemuMonitorPtr mon,
ret = realQemuMonitorJSONIOProcessLine(mon, line, msg);
if (ret == 0 &&
(value = virJSONValueFromString(line)) &&
(json = virJSONValueToString(value, 1))) {
if (ret == 0) {
if (!(value = virJSONValueFromString(line)) ||
!(json = virJSONValueToString(value, true))) {
fprintf(stderr, "Failed to reformat reply string '%s'\n", line);
abort();
}
if (first) {
first = false;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册