mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
Convert QEMU driver to use virLogProbablyLogMessage
The current QEMU code for skipping log messages only skips over 'debug' message, switch to virLogProbablyLogMessage to make sure it skips over all of them
This commit is contained in:
parent
09f5e0123f
commit
82793a2a55
@ -1434,19 +1434,11 @@ qemuProcessReadLogOutput(virDomainObjPtr vm,
|
||||
{
|
||||
int retries = (timeout*10);
|
||||
int got = 0;
|
||||
char *debug = NULL;
|
||||
int ret = -1;
|
||||
char *filter_next = buf;
|
||||
|
||||
buf[0] = '\0';
|
||||
|
||||
/* This relies on log message format generated by virLogFormatString() and
|
||||
* might need to be modified when message format changes. */
|
||||
if (virAsprintf(&debug, ": %d: debug : ", vm->pid) < 0) {
|
||||
virReportOOMError();
|
||||
return -1;
|
||||
}
|
||||
|
||||
while (retries) {
|
||||
ssize_t func_ret, bytes;
|
||||
int isdead = 0;
|
||||
@ -1473,7 +1465,7 @@ qemuProcessReadLogOutput(virDomainObjPtr vm,
|
||||
/* Filter out debug messages from intermediate libvirt process */
|
||||
while ((eol = strchr(filter_next, '\n'))) {
|
||||
*eol = '\0';
|
||||
if (strstr(filter_next, debug)) {
|
||||
if (virLogProbablyLogMessage(filter_next)) {
|
||||
memmove(filter_next, eol + 1, got - (eol - buf));
|
||||
got -= eol + 1 - filter_next;
|
||||
} else {
|
||||
@ -1510,7 +1502,6 @@ qemuProcessReadLogOutput(virDomainObjPtr vm,
|
||||
what, buf);
|
||||
|
||||
cleanup:
|
||||
VIR_FREE(debug);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user