提交 04d5fb2e 编写于 作者: J Jiri Denemark

qemu: Drop LFs at the end of error from QEMU log

Libvirt's error messages do not end with a LF. However, when reading the
error from QEMU log, we would read the LF from the log and keep it in
the message.
Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
上级 108a219f
......@@ -407,6 +407,9 @@ qemuMonitorGetErrorFromLog(qemuMonitorPtr mon)
if ((len = qemuProcessReadLog(mon->logfd, logbuf, 4096 - 1, 0, true)) <= 0)
goto error;
while (len > 0 && logbuf[len - 1] == '\n')
logbuf[--len] = '\0';
cleanup:
errno = orig_errno;
VIR_FORCE_CLOSE(mon->logfd);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册