Fix vzctl enter/exec to upstream container

Testing vzctl enter on 3.8rc3 kernel, got this:

	# uname -a
	Linux kirpad 3.8.0-0.rc3.git0.1.fc19.x86_64 #1 SMP Thu Jan 10 21:09:08 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

	# vzctl start 101
	Directory /proc/vz not found, assuming non-OpenVZ kernel
	Starting container...
	Container is mounted
	Container start in progress...

	# vzctl enter 101
	Directory /proc/vz not found, assuming non-OpenVZ kernel
	enter into CT 101 failed
	Can't add task creator to container: (null)

strace shows that vzctl (cgroup_get_cgroup() called from
container_add_task() I guess) checks for existence of
/sys/fs/cgroup/$WHATEVET/vz-101/ and it fails, apparently because
after setns() we don't have these anymore.

Fix my doing setns() after container_add_task() not before.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
1 file changed