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: Jiri Denemark <jdenemar@redhat.com>
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') {
}
}
+ cleanup:
VIR_FREE(json);
virJSONValueFree(value);
return ret;