]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Make lxcContainerSetStdio the last thing to be called in container startup
authorDaniel P. Berrange <berrange@redhat.com>
Tue, 1 May 2012 09:48:52 +0000 (10:48 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Tue, 1 May 2012 15:05:03 +0000 (16:05 +0100)
Once lxcContainerSetStdio is invoked, logging will not work as
expected in libvirt_lxc. So make sure this is the last thing to
be called, in particular after setting the security process label

src/lxc/lxc_container.c

index 9bb62183932ee48d76762bed71aa3bfade9213b0..0636eabce41c2fe128912b6240d9c3df65ec94ed 100644 (file)
@@ -1366,14 +1366,14 @@ static int lxcContainerChild( void *data )
         goto cleanup;
     }
 
-    if (lxcContainerSetStdio(argv->monitor, ttyfd, argv->handshakefd) < 0) {
-        goto cleanup;
-    }
-
     VIR_DEBUG("Setting up security labeling");
     if (virSecurityManagerSetProcessLabel(argv->securityDriver, vmDef) < 0)
         goto cleanup;
 
+    if (lxcContainerSetStdio(argv->monitor, ttyfd, argv->handshakefd) < 0) {
+        goto cleanup;
+    }
+
     ret = 0;
 cleanup:
     VIR_FREE(ttyPath);