qemucapsprobe: Don't put empty line at EOF

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
Jiri Denemark 2016-06-10 17:15:25 +02:00
parent 70a576899a
commit 423015137a

View File

@ -62,6 +62,7 @@ qemuMonitorJSONIOProcessLine(qemuMonitorPtr mon,
const char *line,
qemuMonitorMessagePtr msg)
{
static bool first = true;
virJSONValuePtr value = NULL;
char *json = NULL;
int ret;
@ -76,6 +77,11 @@ qemuMonitorJSONIOProcessLine(qemuMonitorPtr mon,
char *p;
bool skip = false;
if (first)
first = false;
else
putchar('\n');
for (p = json; *p; p++) {
if (skip && *p == '\n') {
continue;
@ -84,7 +90,6 @@ qemuMonitorJSONIOProcessLine(qemuMonitorPtr mon,
putchar(*p);
}
}
putchar('\n');
}
VIR_FREE(json);