提交 73078906 编写于 作者: J Jiri Denemark

qemucapsprobe: Ignore all greetings except the first one

When starting QEMU more than once during a single probing process,
qemucapsprobe utility would save QMP greeting several times, which
doesn't play well with our test monitor.
Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
上级 429a7b23
......@@ -77,10 +77,14 @@ qemuMonitorJSONIOProcessLine(qemuMonitorPtr mon,
char *p;
bool skip = false;
if (first)
if (first) {
first = false;
else
} else {
/* Ignore QMP greeting if it's not the first one */
if (virJSONValueObjectHasKey(value, "QMP"))
goto cleanup;
putchar('\n');
}
for (p = json; *p; p++) {
if (skip && *p == '\n') {
......@@ -92,6 +96,7 @@ qemuMonitorJSONIOProcessLine(qemuMonitorPtr mon,
}
}
cleanup:
VIR_FREE(json);
virJSONValueFree(value);
return ret;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册