From: Oren Laadan <orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
To: "Serge E. Hallyn" <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
Cc: Linux Containers <containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org>
Subject: Re: [PATCH 1/1] cr: fix compilation with CONFIG_UTS_NS=n
Date: Thu, 18 Jun 2009 12:46:25 -0400 [thread overview]
Message-ID: <4A3A6F61.5030401@cs.columbia.edu> (raw)
In-Reply-To: <20090617001723.GA9452-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
I think it's useful to be able to
1) checkpoint on a system with !CONFIG_UTS_NS, and -
2) checkpoint on a system with CONFIG_UTS_NS and restart on a
system with !CONFIG_UTS_NS (as long as all tasks in the image
share a single uts-ns)
So I moved the code to checkpoint/namespace.c where it compiles
either way.
Oren
Serge E. Hallyn wrote:
> It looks like Oren wanted ns c/r to "sort of work" with CONFIG_UTS_NS=n
> but kernel/utsname.c is not compiled if CONFIG_UTS_NS=n.
>
> Signed-off-by: Serge E. Hallyn <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
> ---
> include/linux/checkpoint.h | 5 +++++
> kernel/utsname.c | 13 -------------
> 2 files changed, 5 insertions(+), 13 deletions(-)
>
> diff --git a/include/linux/checkpoint.h b/include/linux/checkpoint.h
> index c2f04c5..ef4fc33 100644
> --- a/include/linux/checkpoint.h
> +++ b/include/linux/checkpoint.h
> @@ -136,8 +136,13 @@ extern int checkpoint_ns(struct ckpt_ctx *ctx, void *ptr);
> extern void *restore_ns(struct ckpt_ctx *ctx);
>
> /* uts-ns */
> +#ifdef CONFIG_UTS_NS
> extern int checkpoint_uts_ns(struct ckpt_ctx *ctx, void *ptr);
> extern void *restore_uts_ns(struct ckpt_ctx *ctx);
> +#else
> +#define checkpoint_uts_ns checkpoint_bad
> +#define restore_uts_ns restore_bad
> +#endif
>
> /* ipc-ns */
> #ifdef CONFIG_SYSVIPC
> diff --git a/kernel/utsname.c b/kernel/utsname.c
> index 76f9966..5c12ebb 100644
> --- a/kernel/utsname.c
> +++ b/kernel/utsname.c
> @@ -130,11 +130,6 @@ static struct uts_namespace *do_restore_uts_ns(struct ckpt_ctx *ctx)
> h->domainname_len > sizeof(uts_ns->name.domainname))
> goto out;
>
> - /*
> - * If !CONFIG_UTS_NS, do not restore the global uts state, as
> - * it is used by other processes.
> - */
> -#ifdef CONFIG_UTS_NS
> ret = -ENOMEM;
> uts_ns = create_uts_ns();
> if (!uts_ns)
> @@ -153,14 +148,6 @@ static struct uts_namespace *do_restore_uts_ns(struct ckpt_ctx *ctx)
> up_read(&uts_sem);
> if (ret < 0)
> goto out;
> -#else
> - ret = -EEXIST;
> - /* complain if image contains multiple namespaces */
> - if (ctx->stats.uts_ns)
> - goto out;
> - uts_ns = current->nsproxy->uts_ns;
> - get_uts_ns(uts_ns);
> -#endif
>
> ctx->stats.uts_ns++;
> out:
next prev parent reply other threads:[~2009-06-18 16:46 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-17 0:17 [PATCH 1/1] cr: fix compilation with CONFIG_UTS_NS=n Serge E. Hallyn
[not found] ` <20090617001723.GA9452-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-06-18 16:46 ` Oren Laadan [this message]
[not found] ` <4A3A6F61.5030401-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2009-06-18 17:09 ` Serge E. Hallyn
2009-06-18 18:25 ` Nathan Lynch
[not found] ` <m3ws79h01p.fsf-e+AXbWqSrlAAvxtiuMwx3w@public.gmane.org>
2009-06-18 22:32 ` Serge E. Hallyn
[not found] ` <20090618223213.GA13179-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-06-18 23:12 ` Nathan Lynch
[not found] ` <m3zlc5kugu.fsf-e+AXbWqSrlAAvxtiuMwx3w@public.gmane.org>
2009-06-19 4:14 ` Oren Laadan
2009-06-19 14:56 ` Serge E. Hallyn
[not found] ` <20090619145606.GB22381-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-06-19 17:10 ` Nathan Lynch
[not found] ` <m3ljnogneb.fsf-e+AXbWqSrlAAvxtiuMwx3w@public.gmane.org>
2009-06-19 17:53 ` Serge E. Hallyn
2009-06-19 4:06 ` Oren Laadan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4A3A6F61.5030401@cs.columbia.edu \
--to=orenl-eqauephvms7envbuuze7ea@public.gmane.org \
--cc=containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org \
--cc=serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox