public inbox for util-linux@vger.kernel.org
 help / color / mirror / Atom feed
From: Neil Horman <nhorman@tuxdriver.com>
To: "Ángel González" <ingenit@zoho.com>
Cc: util-linux@vger.kernel.org, kerolasa@gmail.com,
	grawity@gmail.com, Karel Zak <kzak@redhat.com>
Subject: Re: [PATCH v2] sys-tools: Enhance unshare command to support the switching of namespaces
Date: Fri, 28 Dec 2012 11:12:18 -0500	[thread overview]
Message-ID: <20121228161217.GA5325@neilslaptop.think-freely.org> (raw)
In-Reply-To: <50DD9695.4080507@zoho.com>

On Fri, Dec 28, 2012 at 01:54:45PM +0100, Ángel González wrote:
> On 20/12/12 19:22, Neil Horman wrote:
> >  		case 'm':
> > -			unshare_flags |= CLONE_NEWNS;
> > +			ns = "mount";
> > +			if (!optarg)
> > +				unshare_flags |= CLONE_NEWNS;
> >  			break;
> 
> Is this right? I don't have a /proc/<task>/ns/mount locally nor is it
> documented in
> http://git.kernel.org/?p=docs/man-pages/man-pages.git;a=blob;f=man5/proc.5
> 
> However looking at
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blob;f=fs/proc/namespaces.c
> there is a reference to mntns_operations, which is defined in
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blob;f=fs/proc/namespaces.c
> 
> but seems to be called "mnt", not "mount"
> 
Shoot, I thought Biederman was going to call it mount, not mnt, I'll fix that
shortly.

> There are also pid and user namespaces there, but support for those are
> better handled in a different patch IMHO.
> 
I'm not really sure what you mean by a different patch here.  Why would I add
support for setns for other pid/uts namespaces in a different patch?

> 
> > +				sprintf(path, "/proc/%d/ns/%s", (int)pid, ns); 
> > +				ns_pids[nscount] = open(path, O_RDONLY);
> > +				if (ns_pids[nscount] < 0)
> > +					err(EXIT_FAILURE, _("could not open %s"), path);
> > +				nscount++;
> 
> What about err(EXIT_FAILURE, _("The kernel doesn't seem to support %s
> migrations: could not open %s"), ns, path); ?
> 
Sure, I can do that.

> Mention in the man page the kernel version from which each namespace can
> be migrated.
> 
Yeah, ok
Neil

> --
> To unsubscribe from this list: send the line "unsubscribe util-linux" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

  reply	other threads:[~2012-12-28 16:13 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-19 19:06 [PATCH] sys-tools: Add setns utility to sys-tools Neil Horman
2012-12-19 20:16 ` Mantas M.
2012-12-19 21:01 ` Neil Horman
2012-12-19 23:15   ` Sami Kerola
2012-12-20  9:24 ` Karel Zak
2012-12-20 11:17   ` Sami Kerola
2012-12-20 15:34   ` Neil Horman
2012-12-20 18:22 ` [PATCH v2] sys-tools: Enhance unshare command to support the switching of namespaces Neil Horman
2012-12-28 12:54   ` Ángel González
2012-12-28 16:12     ` Neil Horman [this message]
2012-12-28 19:33       ` Ángel González
2012-12-28 21:26         ` Neil Horman
2012-12-28 16:22 ` [PATCH v3] " Neil Horman
2013-01-02 21:33   ` Neil Horman
2013-01-07 14:05   ` Karel Zak
2013-01-07 14:58     ` Neil Horman

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=20121228161217.GA5325@neilslaptop.think-freely.org \
    --to=nhorman@tuxdriver.com \
    --cc=grawity@gmail.com \
    --cc=ingenit@zoho.com \
    --cc=kerolasa@gmail.com \
    --cc=kzak@redhat.com \
    --cc=util-linux@vger.kernel.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