[Devel] Re: [PATCH] make cr depend on all namespaces

Oren Laadan orenl at cs.columbia.edu
Mon Mar 15 14:45:01 PDT 2010



Serge E. Hallyn wrote:
> This should let us get rid of some ifdefed code and reduce
> chances for bad config combinations.  There's really no reason
> to support it.

I disagree.

You are right that this will reduce the changes of bad config
combinations.

However, it will also introduce some restrictions on the kernel
config which are unnecessary. Some people may not want to have
all namespaces configured.

Note that the namespaces are independent in the sense that we
don't need to test all combination of all namespaces - instead,
I consider turning on/off one at a time to be safe enough.

(FWIW, is it because you only wanted to show a point that you
only remove UTS_NS ifdefs ?)

Oren.

> 
> Signed-off-by: Serge E. Hallyn <serue at us.ibm.com>
> ---
>  checkpoint/Kconfig     |    5 +++++
>  checkpoint/namespace.c |   10 ----------
>  2 files changed, 5 insertions(+), 10 deletions(-)
> 
> diff --git a/checkpoint/Kconfig b/checkpoint/Kconfig
> index 4a2c845..549668e 100644
> --- a/checkpoint/Kconfig
> +++ b/checkpoint/Kconfig
> @@ -9,6 +9,11 @@ config DEFERQUEUE
>  config CHECKPOINT
>  	bool "Checkpoint/restart (EXPERIMENTAL)"
>  	depends on CHECKPOINT_SUPPORT && EXPERIMENTAL
> +	depends on UTS_NS
> +	depends on USER_NS
> +	depends on PID_NS
> +	depends on NET_NS
> +	depends on DEVPTS_MULTIPLE_INSTANCES
>  	depends on CGROUP_FREEZER
>  	select DEFERQUEUE
>  	help
> diff --git a/checkpoint/namespace.c b/checkpoint/namespace.c
> index 4b3ac5a..6389dbd 100644
> --- a/checkpoint/namespace.c
> +++ b/checkpoint/namespace.c
> @@ -63,7 +63,6 @@ static struct uts_namespace *do_restore_uts_ns(struct ckpt_ctx *ctx)
>  	if (IS_ERR(h))
>  		return (struct uts_namespace *) h;
>  
> -#ifdef CONFIG_UTS_NS
>  	uts_ns = create_uts_ns();
>  	if (!uts_ns) {
>  		uts_ns = ERR_PTR(-ENOMEM);
> @@ -78,15 +77,6 @@ static struct uts_namespace *do_restore_uts_ns(struct ckpt_ctx *ctx)
>  	memcpy(name->machine, h->machine, sizeof(name->machine));
>  	memcpy(name->domainname, h->domainname, sizeof(name->domainname));
>  	up_read(&uts_sem);
> -#else
> -	/* complain if image contains multiple namespaces */
> -	if (ctx->stats.uts_ns) {
> -		uts_ns = ERR_PTR(-EEXIST);
> -		goto out;
> -	}
> -	uts_ns = current->nsproxy->uts_ns;
> -	get_uts_ns(uts_ns);
> -#endif
>  
>  	ctx->stats.uts_ns++;
>   out:
_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers




More information about the Devel mailing list