From 82793a2a5517c7f5f5f844aa03f0e0a019a04c2a Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Mon, 4 Mar 2013 20:50:42 +0000 Subject: [PATCH] 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 --- src/qemu/qemu_process.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 9f1507a621..efb12985b5 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -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; } -- GitLab