[libvirt] [PATCH 3/3] Make lxcContainerSetStdio the last thing to be called in container startup

Daniel P. Berrange berrange at redhat.com
Tue May 1 10:10:15 UTC 2012


From: "Daniel P. Berrange" <berrange at redhat.com>

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 |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
index 9bb6218..0636eab 100644
--- a/src/lxc/lxc_container.c
+++ b/src/lxc/lxc_container.c
@@ -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);
-- 
1.7.10




More information about the libvir-list mailing list