mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 13:45:38 +00:00
qemucapsprobe: Don't put empty line at EOF
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
parent
70a576899a
commit
423015137a
@ -62,6 +62,7 @@ qemuMonitorJSONIOProcessLine(qemuMonitorPtr mon,
|
|||||||
const char *line,
|
const char *line,
|
||||||
qemuMonitorMessagePtr msg)
|
qemuMonitorMessagePtr msg)
|
||||||
{
|
{
|
||||||
|
static bool first = true;
|
||||||
virJSONValuePtr value = NULL;
|
virJSONValuePtr value = NULL;
|
||||||
char *json = NULL;
|
char *json = NULL;
|
||||||
int ret;
|
int ret;
|
||||||
@ -76,6 +77,11 @@ qemuMonitorJSONIOProcessLine(qemuMonitorPtr mon,
|
|||||||
char *p;
|
char *p;
|
||||||
bool skip = false;
|
bool skip = false;
|
||||||
|
|
||||||
|
if (first)
|
||||||
|
first = false;
|
||||||
|
else
|
||||||
|
putchar('\n');
|
||||||
|
|
||||||
for (p = json; *p; p++) {
|
for (p = json; *p; p++) {
|
||||||
if (skip && *p == '\n') {
|
if (skip && *p == '\n') {
|
||||||
continue;
|
continue;
|
||||||
@ -84,7 +90,6 @@ qemuMonitorJSONIOProcessLine(qemuMonitorPtr mon,
|
|||||||
putchar(*p);
|
putchar(*p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
putchar('\n');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VIR_FREE(json);
|
VIR_FREE(json);
|
||||||
|
Loading…
Reference in New Issue
Block a user