]> xenbits.xensource.com Git - libvirt.git/commitdiff
Improve log filtering in virLXCProcessReadLogOutputData
authorDaniel P. Berrange <berrange@redhat.com>
Mon, 14 Oct 2013 12:07:22 +0000 (13:07 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Mon, 14 Oct 2013 14:38:20 +0000 (15:38 +0100)
Make the virLXCProcessReadLogOutputData method ignore the log
lines about the container startup argv, ignore the generic
error message from libvirt_lxc when lxcContainerMain fails
and skip over blank lines.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
src/lxc/lxc_process.c

index 5a091e6c125024c78306d4bb8578e7a73f87c675..8ede404f84387a0f14bfbbcd99c3a16edf9e62e2 100644 (file)
@@ -807,6 +807,20 @@ cleanup:
 }
 
 
+static bool
+virLXCProcessIgnorableLogLine(const char *str)
+{
+    if (virLogProbablyLogMessage(str))
+        return true;
+    if (strstr(str, "PATH="))
+        return true;
+    if (strstr(str, "error receiving signal from container"))
+        return true;
+    if (STREQ(str, ""))
+        return true;
+    return false;
+}
+
 static int
 virLXCProcessReadLogOutputData(virDomainObjPtr vm,
                                int fd,
@@ -844,7 +858,7 @@ virLXCProcessReadLogOutputData(virDomainObjPtr vm,
         /* Filter out debug messages from intermediate libvirt process */
         while ((eol = strchr(filter_next, '\n'))) {
             *eol = '\0';
-            if (virLogProbablyLogMessage(filter_next)) {
+            if (virLXCProcessIgnorableLogLine(filter_next)) {
                 memmove(filter_next, eol + 1, got - (eol - buf));
                 got -= eol + 1 - filter_next;
             } else {