提交 82793a2a 编写于 作者: D Daniel P. Berrange

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
上级 09f5e012
...@@ -1434,19 +1434,11 @@ qemuProcessReadLogOutput(virDomainObjPtr vm, ...@@ -1434,19 +1434,11 @@ qemuProcessReadLogOutput(virDomainObjPtr vm,
{ {
int retries = (timeout*10); int retries = (timeout*10);
int got = 0; int got = 0;
char *debug = NULL;
int ret = -1; int ret = -1;
char *filter_next = buf; char *filter_next = buf;
buf[0] = '\0'; 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) { while (retries) {
ssize_t func_ret, bytes; ssize_t func_ret, bytes;
int isdead = 0; int isdead = 0;
...@@ -1473,7 +1465,7 @@ qemuProcessReadLogOutput(virDomainObjPtr vm, ...@@ -1473,7 +1465,7 @@ qemuProcessReadLogOutput(virDomainObjPtr vm,
/* 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';
if (strstr(filter_next, debug)) { if (virLogProbablyLogMessage(filter_next)) {
memmove(filter_next, eol + 1, got - (eol - buf)); memmove(filter_next, eol + 1, got - (eol - buf));
got -= eol + 1 - filter_next; got -= eol + 1 - filter_next;
} else { } else {
...@@ -1510,7 +1502,6 @@ qemuProcessReadLogOutput(virDomainObjPtr vm, ...@@ -1510,7 +1502,6 @@ qemuProcessReadLogOutput(virDomainObjPtr vm,
what, buf); what, buf);
cleanup: cleanup:
VIR_FREE(debug);
return ret; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册