[Devel] [PATCH 0/8] [RFC] vzctl: Dump/restore of upstream containers

2013-05-15 Thread Andrey Vagin
Don't commit these patch, just look at them and send me comments. This patches have not been tested on OpneVZ CT-s:) Andrey Vagin (8): vzctl: save a pid of init in a state file vzctl: split ct_env_create vzctl: transfer vps_res in env_stop vzctl: save PID of init in a state file vzctl:

[Devel] [PATCH 1/8] vzctl: save a pid of init in a state file

2013-05-15 Thread Andrey Vagin
CRIU requires a pid of the init. Signed-off-by: Andrey Vagin --- etc/vz.conf.in| 1 + include/res.h | 1 + include/types.h | 2 ++ include/util.h| 1 + include/vzctl_param.h | 1 + src/lib/config.c | 10 ++ src/lib/util.c| 6 ++ 7 file

[Devel] [PATCH 2/8] vzctl: split ct_env_create

2013-05-15 Thread Andrey Vagin
ct_env_create will able to execute CT and to resume CT Signed-off-by: Andrey Vagin --- src/lib/hooks_ct.c | 45 +++-- 1 file changed, 27 insertions(+), 18 deletions(-) diff --git a/src/lib/hooks_ct.c b/src/lib/hooks_ct.c index 6a5e766..184c26a 100644 ---

[Devel] [PATCH 3/8] vzctl: transfer vps_res in env_stop

2013-05-15 Thread Andrey Vagin
It will be used to unlink a state file Signed-off-by: Andrey Vagin --- include/types.h| 3 ++- src/lib/env.c | 18 +- src/lib/hooks_ct.c | 4 ++-- src/lib/hooks_vz.c | 2 +- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/include/types.h b/include/typ

[Devel] [PATCH 5/8] vzctl: transfer vps_res in vps_chkpnt and vps_restore

2013-05-15 Thread Andrey Vagin
Signed-off-by: Andrey Vagin --- include/cpt.h | 2 +- include/env.h | 2 +- include/snapshot.h | 4 ++-- src/lib/cpt.c | 6 +++--- src/lib/hooks_vz.c | 2 +- src/snapshot.c | 13 - src/vzctl-actions.c | 6 +++--- 7 files changed, 19 insertions(+), 16 del

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

2013-05-15 Thread Andrey Vagin
It's a preparation for moving vz-specific code in hook_vz.c. Signed-off-by: Andrey Vagin --- 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 5501d92..24ba9a8 100644 --- a/src/lib/c

[Devel] [PATCH 4/8] vzctl: save PID of init in a state file

2013-05-15 Thread Andrey Vagin
It will be used for checkpointing this CT Signed-off-by: Andrey Vagin --- src/lib/hooks_ct.c | 20 ++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/lib/hooks_ct.c b/src/lib/hooks_ct.c index 0d4e439..3c82823 100644 --- a/src/lib/hooks_ct.c +++ b/src/lib/hook

[Devel] [PATCH 7/8] vzctl: move cpt/rst code in hook_vz

2013-05-15 Thread Andrey Vagin
Signed-off-by: Andrey Vagin --- include/cpt.h | 13 ++ include/types.h| 24 ++-- src/lib/cpt.c | 403 + src/lib/hooks_vz.c | 385 ++ 4 files changed, 415 insertions(+), 410 deletio

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

2013-05-15 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. Signed-off-by: Andrey Vagin --- scripts/ct-cpt | 19 scripts/ct-rst | 17 ++ src/lib/hooks_ct.c | 91 +++

Re: [Devel] [PATCH 0/8] [RFC] vzctl: Dump/restore of upstream containers

2013-05-15 Thread Andrew Vagin
Add Glauber in CC On Wed, May 15, 2013 at 08:10:45PM +0400, Andrey Vagin wrote: > Don't commit these patch, just look at them and send me comments. > > This patches have not been tested on OpneVZ CT-s:) > > Andrey Vagin (8): > vzctl: save a pid of init in a state file > vzctl: split ct_env_c

Re: [Devel] [PATCH 1/8] vzctl: save a pid of init in a state file

2013-05-15 Thread Kir Kolyshkin
On 05/15/2013 09:10 AM, Andrey Vagin wrote: CRIU requires a pid of the init. I suggest storing it in next to veipdumpdir (defined in paths.am as veipdumpdir = $(localstatedir)/lib/vzctl/veip) Something like /var/lib/vzctl/pids should be fine. Also, do not make it run-time configurable. Who ca

Re: [Devel] [PATCH 3/8] vzctl: transfer vps_res in env_stop

2013-05-15 Thread Kir Kolyshkin
On 05/15/2013 09:10 AM, Andrey Vagin wrote: It will be used to unlink a state file Same here -- if you will rely on hardcoded directory, you won't need this patch at all. Signed-off-by: Andrey Vagin --- include/types.h| 3 ++- src/lib/env.c | 18 +- src/lib/

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

2013-05-15 Thread Kir Kolyshkin
On 05/15/2013 09:10 AM, Andrey Vagin wrote: It will be used for checkpointing this CT Signed-off-by: Andrey Vagin --- src/lib/hooks_ct.c | 20 ++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/lib/hooks_ct.c b/src/lib/hooks_ct.c index 0d4e439..3c82823 10

Re: [Devel] [PATCH 5/8] vzctl: transfer vps_res in vps_chkpnt and vps_restore

2013-05-15 Thread Kir Kolyshkin
If the sole reason for vps_res is to use it for get_state_file() -- I have the same answer, just use hardcoded path. On 05/15/2013 09:10 AM, Andrey Vagin wrote: Signed-off-by: Andrey Vagin --- include/cpt.h | 2 +- include/env.h | 2 +- include/snapshot.h | 4 ++-- src/lib

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

2013-05-15 Thread Kir Kolyshkin
On 05/15/2013 09:10 AM, Andrey Vagin wrote: 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. Signed-off-by: Andrey Vagin --- scripts/ct-cpt | 19 scripts/ct-rst | 17 ++