[Devel] [PATCH 0/6] vzctl: Dump/restore of upstream containers (v2)

2013-05-16 Thread Andrey Vagin
The project CRIU is used for dumping and restoring containers. http://criu.org/ Known issues: Network devices are not supported yet. v2: The patch set was fixed according with Kir's comments. Andrey Vagin (6): vzctl: split ct_env_create vzctl: save PID of init in a state file

[Devel] [PATCH 1/6] vzctl: split ct_env_create

2013-05-16 Thread Andrey Vagin
ct_env_create will able to execute CT and to resume CT Signed-off-by: Andrey Vagin ava...@openvz.org --- src/lib/hooks_ct.c | 49 ++--- 1 file changed, 30 insertions(+), 19 deletions(-) diff --git a/src/lib/hooks_ct.c b/src/lib/hooks_ct.c index

[Devel] [PATCH 3/6] vzctl: split vps_chkpnt and vps_restore

2013-05-16 Thread Andrey Vagin
It's a preparation for moving vz-specific code in hook_vz.c. Signed-off-by: Andrey Vagin ava...@openvz.org --- src/lib/cpt.c | 43 +-- 1 file changed, 33 insertions(+), 10 deletions(-) diff --git a/src/lib/cpt.c b/src/lib/cpt.c index 362c646..e4213a2

[Devel] [PATCH 4/6] vzctl: move cpt/rst code in hook_vz

2013-05-16 Thread Andrey Vagin
Signed-off-by: Andrey Vagin ava...@openvz.org --- include/cpt.h | 13 ++ include/types.h| 25 ++-- src/lib/cpt.c | 403 + src/lib/hooks_vz.c | 385 ++ 4 files changed, 416

[Devel] [PATCH 2/6] vzctl: save PID of init in a state file

2013-05-16 Thread Andrey Vagin
CRIU requires a pid of the init. Signed-off-by: Andrey Vagin ava...@openvz.org --- include/types.h| 2 ++ include/util.h | 1 + src/lib/hooks_ct.c | 20 ++-- src/lib/util.c | 5 + 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/include/types.h

[Devel] [PATCH 5/6] vzctl: transfer fs in vps_chkpnt, vps_restore, env_start_FN

2013-05-16 Thread Andrey Vagin
Signed-off-by: Andrey Vagin ava...@openvz.org --- include/env.h | 4 ++-- src/lib/hooks_vz.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/env.h b/include/env.h index 1628bbf..dd5c2f8 100644 --- a/include/env.h +++ b/include/env.h @@ -34,8 +34,8 @@

[Devel] [PATCH 6/6] vzctl: checkpoint/restoer of upstream CTs

2013-05-16 Thread Andrey Vagin
It can be done by any third party tools. sripts/ct-cpt and script/ct_rst are executed to dump and restore CT This patch adds scripts for CRIU. v2: add the GPL header and descriptions in scripts describe and check variables in scripts Signed-off-by: Andrey Vagin ava...@openvz.org ---

Re: [Devel] [PATCH 1/6] vzctl: split ct_env_create

2013-05-16 Thread Glauber Costa
On 05/16/2013 04:14 PM, Andrey Vagin wrote: + ret = ct_env_create_real(arg); + if (ret 0) return VZ_RESOURCE_ERROR; - } Isn't it better to just keep the return values intact in create_real, and then return them as is if ret != 0 ?

Re: [Devel] [PATCH 2/6] vzctl: save PID of init in a state file

2013-05-16 Thread Glauber Costa
On 05/16/2013 04:14 PM, Andrey Vagin wrote: CRIU requires a pid of the init. Signed-off-by: Andrey Vagin ava...@openvz.org The way you coded it, it seems to me that we will always overwrite the pid file, which is fine: this way we won't run into the usual pid file already exists kinds of

Re: [Devel] [PATCH 1/6] vzctl: split ct_env_create

2013-05-16 Thread Kir Kolyshkin
On 05/16/2013 09:19 AM, Glauber Costa wrote: On 05/16/2013 04:14 PM, Andrey Vagin wrote: + ret = ct_env_create_real(arg); + if (ret 0) return VZ_RESOURCE_ERROR; - } Isn't it better to just keep the return values intact in create_real, and then return them as

Re: [Devel] [PATCH 1/6] vzctl: split ct_env_create

2013-05-16 Thread Andrey Wagin
2013/5/16 Glauber Costa glom...@parallels.com: On 05/16/2013 04:14 PM, Andrey Vagin wrote: + ret = ct_env_create_real(arg); + if (ret 0) return VZ_RESOURCE_ERROR; - } Isn't it better to just keep the return values intact in create_real, and then return them as is

Re: [Devel] [PATCH v4 1/7] user namespace support for upstream containers

2013-05-16 Thread Kir Kolyshkin
On 05/14/2013 03:52 AM, Glauber Costa wrote: From: Glauber Costa glom...@parallels.com This patch allows the execution of unprivileged containers running ontop of an upstream Linux Kernel. We will run at whatever UID is found in the configuration file (so far empty, thus disabled).

Re: [Devel] [PATCH v4 2/7] add user mismatch test

2013-05-16 Thread Kir Kolyshkin
On 05/14/2013 03:52 AM, Glauber Costa wrote: From: Glauber Costa glom...@parallels.com In theory, we won't be able to run if our private area is not owned by ourselves. We could, if it have very wide open security permissions, but we should never set up a container like that. Aside from a

Re: [Devel] [PATCH v4 3/7] Also pass cmd_p pointer to container open

2013-05-16 Thread Kir Kolyshkin
On 05/14/2013 03:52 AM, Glauber Costa wrote: We would like to know early on in the container lifetime (before creation) if the container should use user namespaces. At this point, we not yet have a ct s/not/do not/ configuration file, just the global one. It may very well be that the user