mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-02 09:55:18 +00:00
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: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
parent
108a219f02
commit
04d5fb2e0a
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user