mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
Fix qemuProcessReadLog with non-zero offset
This restores the error message when QMP probing is not used. https://bugzilla.redhat.com/show_bug.cgi?id=991334
This commit is contained in:
parent
3607ab58c9
commit
9ceaaa08e9
@ -1435,18 +1435,17 @@ qemuProcessReadLog(int fd, char *buf, int buflen, int off)
|
|||||||
ssize_t bytes;
|
ssize_t bytes;
|
||||||
char *eol;
|
char *eol;
|
||||||
|
|
||||||
buf[0] = '\0';
|
|
||||||
|
|
||||||
while (off < buflen - 1) {
|
while (off < buflen - 1) {
|
||||||
bytes = saferead(fd, buf + off, buflen - off - 1);
|
bytes = saferead(fd, buf + off, buflen - off - 1);
|
||||||
if (bytes < 0)
|
if (bytes < 0)
|
||||||
return -1;
|
return -1;
|
||||||
else if (bytes == 0)
|
|
||||||
break;
|
|
||||||
|
|
||||||
off += bytes;
|
off += bytes;
|
||||||
buf[off] = '\0';
|
buf[off] = '\0';
|
||||||
|
|
||||||
|
if (bytes == 0)
|
||||||
|
break;
|
||||||
|
|
||||||
/* Filter out debug messages from intermediate libvirt process */
|
/* Filter out debug messages from intermediate libvirt process */
|
||||||
while ((eol = strchr(filter_next, '\n'))) {
|
while ((eol = strchr(filter_next, '\n'))) {
|
||||||
*eol = '\0';
|
*eol = '\0';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user