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

Stefan Berger stefanb at linux.vnet.ibm.com
Tue May 1 14:37:00 UTC 2012


On 05/01/2012 06:10 AM, Daniel P. Berrange wrote:
> 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);

ACK




More information about the libvir-list mailing list