Make lxcContainerSetStdio the last thing to be called in container startup

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
(cherry picked from commit 07cf96ecc7b0933c67febb1c5bd50fc0bbeba263)
This commit is contained in:
Daniel P. Berrange 2012-05-01 10:48:52 +01:00 committed by Cole Robinson
parent e36af9f8c1
commit 588b16bbd5

View File

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