public inbox for util-linux@vger.kernel.org
 help / color / mirror / Atom feed
From: "Ángel González" <ingenit@zoho.com>
To: Neil Horman <nhorman@tuxdriver.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 13:54:45 +0100	[thread overview]
Message-ID: <50DD9695.4080507@zoho.com> (raw)
In-Reply-To: <1356027729-26098-1-git-send-email-nhorman@tuxdriver.com>

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"

There are also pid and user namespaces there, but support for those are
better handled in a different patch IMHO.


> +				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); ?

Mention in the man page the kernel version from which each namespace can
be migrated.

  reply	other threads:[~2012-12-28 12:54 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 [this message]
2012-12-28 16:12     ` Neil Horman
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=50DD9695.4080507@zoho.com \
    --to=ingenit@zoho.com \
    --cc=grawity@gmail.com \
    --cc=kerolasa@gmail.com \
    --cc=kzak@redhat.com \
    --cc=nhorman@tuxdriver.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