Re: [Devel] [PATCH 0/7] Profiling sleep times (v3)

2011-12-05 Thread Andrey Vagin
Hello Arnaldo, I found, that you commit patches for perf. Could you review this part? Arun Sharma said, that the second versions of patches works ok for him. (Arun is the first user of this functionality after me.) Thanks. On 11/28/2011 01:03 PM, Andrew Vagin wrote: Do you want to know where

[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

[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

[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

[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

[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/sr

[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

[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

[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

[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

[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 --- 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 6a5e766..83ef20a 100644

[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 --- 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 100644 --- a/sr

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

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

[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 --- 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 b/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 --- 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 @@ -typedef int

[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 --- scripts/Makefile.am

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

2013-05-21 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. v3: env_create_FN returns PID or a negative error code Andrey Vagin (6): vzctl:

[Devel] [PATCH 1/6] vzctl: split ct_env_create (v2)

2013-05-21 Thread Andrey Vagin
ct_env_create will able to execute CT and to resume CT v2: A return code contains one of known codes with inverted sign. Signed-off-by: Andrey Vagin --- src/lib/hooks_ct.c | 79 +++--- 1 file changed, 45 insertions(+), 34 deletions(-) diff --git

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

2013-05-21 Thread Andrey Vagin
CRIU requires a pid of the init. Signed-off-by: Andrey Vagin --- include/types.h| 2 ++ include/util.h | 1 + src/lib/hooks_ct.c | 18 +- src/lib/util.c | 5 + 4 files changed, 25 insertions(+), 1 deletion(-) diff --git a/include/types.h b/include/types.h

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

2013-05-21 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 626c055..cca15b6 100644 --- a/sr

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

2013-05-21 Thread Andrey Vagin
Signed-off-by: Andrey Vagin --- include/cpt.h | 13 ++ include/types.h| 25 ++-- src/lib/cpt.c | 404 + src/lib/hooks_vz.c | 386 ++ 4 files changed, 417 insertions(+), 411

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

2013-05-21 Thread Andrey Vagin
Signed-off-by: Andrey Vagin --- 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 4fef438..7426d63 100644 --- a/include/env.h +++ b/include/env.h @@ -34,8 +34,8 @@ -typedef int

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

2013-05-21 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 --- scripts/Makefile.am

[Devel] [PATCH 0/3] cpt: restore network devices

2013-05-27 Thread Andrey Vagin
Andrey Vagin (3): vzctl: pass vps_res in env_create_FN vzctl: add ability to skip creation of veth devices cpt: restore veth devices with correct names include/env.h| 2 +- include/types.h | 2 ++ scripts/vps-netns_dev_add.in | 5 - scripts/vps-rst.in

[Devel] [PATCH 1/3] vzctl: pass vps_res in env_create_FN

2013-05-27 Thread Andrey Vagin
Signed-off-by: Andrey Vagin --- include/env.h | 2 +- src/lib/hooks_ct.c | 4 ++-- src/lib/hooks_vz.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/env.h b/include/env.h index 7426d63..67ab3ef 100644 --- a/include/env.h +++ b/include/env.h @@ -34,7 +34,7

[Devel] [PATCH 2/3] vzctl: add ability to skip creation of veth devices

2013-05-27 Thread Andrey Vagin
It will be used for resuming CT with help CRIU. CRIU restores veth devices and configures them inside CT, so vzctl should configures them on the host side. Signed-off-by: Andrey Vagin --- include/types.h | 2 ++ scripts/vps-netns_dev_add.in | 5 - src/lib/hooks_ct.c

[Devel] [PATCH 3/3] cpt: restore veth devices with correct names

2013-05-27 Thread Andrey Vagin
transmit pair of veth names to criu via the option --veth-pair Signed-off-by: Andrey Vagin --- scripts/vps-rst.in | 14 -- src/lib/hooks_ct.c | 18 ++ 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/scripts/vps-rst.in b/scripts/vps-rst.in index

[Devel] [PATCH 3/3] cpt: restore veth devices with correct names

2013-05-27 Thread Andrey Vagin
transmit pair of veth names to criu via the option --veth-pair v2: unset IFS and delete eval from vps-rst Signed-off-by: Andrey Vagin --- scripts/vps-rst.in | 15 +-- src/lib/hooks_ct.c | 18 ++ 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/scripts

[Devel] [PATCH 1/2] vzctl: add ability to skip creation of veth devices (v2)

2013-05-29 Thread Andrey Vagin
It will be used for resuming CT with help CRIU. CRIU restores veth devices and configures them inside CT, so vzctl should configures them on the host side. Signed-off-by: Andrey Vagin --- include/types.h | 2 ++ scripts/vps-netns_dev_add.in | 5 - src/lib/hooks_ct.c

[Devel] [PATCH 2/2] cpt: restore veth devices with correct names (v3)

2013-05-29 Thread Andrey Vagin
transmit pair of veth names to criu via the option --veth-pair v2: unset IFS and delete eval from vps-rst v3: fix comments from Kir Signed-off-by: Andrey Vagin --- scripts/vps-rst.in | 12 ++-- src/lib/hooks_ct.c | 16 +--- 2 files changed, 23 insertions(+), 5 deletions

[Devel] [PATCH 2/2] cpt: restore veth devices with correct names (v4)

2013-05-30 Thread Andrey Vagin
transmit pair of veth names to criu via the option --veth-pair v2: unset IFS and delete eval from vps-rst v3: fix comments from Kir v4: vzcheckvar VE_VETH_DEVS Signed-off-by: Andrey Vagin --- scripts/vps-rst.in | 11 ++- src/lib/hooks_ct.c | 16 +--- 2 files changed, 23

[Devel] [PATCH] [RFC] cpt: clean up dump files

2013-05-30 Thread Andrey Vagin
nly a tools, which checkpoints CT, knows how to delete own data, so lets do that in the script vzt-rst. Signed-off-by: Andrey Vagin --- include/cpt.h | 3 ++- scripts/vps-rst.in | 11 ++- src/lib/env.c | 10 +- src/lib/hooks_ct.c | 31 +-- sr

[Devel] [PATCH 1/2] vzctl: synchronize CRIU with vzctl

2013-05-31 Thread Andrey Vagin
vzctl provides two descriptors signalfd and waitfd, it's used for apply host-side configuration after creating environment. A signal is send to signalfd after creating environment and an answer is recieved from waitfd. Signed-off-by: Andrey Vagin --- scripts/Makefile.am| 3 ++- script

[Devel] [PATCH 2/2] ct: return positive error code from ct_env_create_real and ct_restore_fn

2013-05-31 Thread Andrey Vagin
The most part of vzctl functions return positive error code. This two functions were exceptions, because they return PID of init to create netns file. Currently each of these functions creates netns file by itself. Signed-off-by: Andrey Vagin --- src/lib/hooks_ct.c | 40

[Devel] [PATCH 1/2] vzctl: synchronize CRIU with vzctl (v2)

2013-05-31 Thread Andrey Vagin
vzctl provides two descriptors signalfd and waitfd, it's used for apply host-side configuration after creating environment. A signal is send to signalfd after creating environment and an answer is recieved from waitfd. v2: fix comments from Kir Signed-off-by: Andrey Vagin --- sc

[Devel] [PATCH 1/2] hooks-ct: bind-mount the root in itself after entering in a user namespace

2014-01-13 Thread Andrey Vagin
-off-by: Andrey Vagin --- src/lib/hooks_ct.c | 19 +++ 1 file changed, 19 insertions(+) diff --git a/src/lib/hooks_ct.c b/src/lib/hooks_ct.c index 4972dac..aff9cee 100644 --- a/src/lib/hooks_ct.c +++ b/src/lib/hooks_ct.c @@ -103,6 +103,25 @@ int ct_chroot(const char *root

[Devel] [PATCH 2/2] hooks_ct: mount /proc and /sys before umounting the old root

2014-01-13 Thread Andrey Vagin
and /sys/fs/cgroup/ that exist explicitly for other filesystems to mount on top of. Signed-off-by: Andrey Vagin --- src/lib/env.c | 9 - src/lib/hooks_ct.c | 26 ++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/src/lib/env.c b/src/lib

[Devel] [PATCH 0/2] fix launching of containers on the mainstream kernel

2014-01-13 Thread Andrey Vagin
User namespaces was restricted in the mainstream kernel and vzctl must follow to the current rules. ps: I didn't test these patches on OpenVZ kernels. Andrey Vagin (2): vzctl: bind-mount the root in itself after entering in a user namespace hooks_ct: mount /proc and /sys before umou

[Devel] [PATCH 1/2] hooks_ct: mount /proc and /sys before umounting the old root

2014-01-20 Thread Andrey Vagin
and /sys/fs/cgroup/ that exist explicitly for other filesystems to mount on top of. Signed-off-by: Andrey Vagin --- src/lib/env.c | 9 - src/lib/hooks_ct.c | 26 ++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/src/lib/env.c b/src/lib

[Devel] [PATCH 2/2] hook_ct: remove the non-working with devpts

2014-01-20 Thread Andrey Vagin
this configuration doesn't supported by CRIU. Signed-off-by: Andrey Vagin --- src/lib/hooks_ct.c | 48 ++-- 1 file changed, 2 insertions(+), 46 deletions(-) diff --git a/src/lib/hooks_ct.c b/src/lib/hooks_ct.c index a1b91d9..b0a3e7b 100644 ---

[Devel] [PATCH 1/2] hook_ct: remove the non-working with devpts

2014-01-20 Thread Andrey Vagin
this configuration doesn't supported by CRIU. Signed-off-by: Andrey Vagin --- src/lib/hooks_ct.c | 48 ++-- 1 file changed, 2 insertions(+), 46 deletions(-) diff --git a/src/lib/hooks_ct.c b/src/lib/hooks_ct.c index 5ec4a93..2a0b54c 100644 ---

[Devel] [PATCH 2/2] hook_ct: bind mount the host /dev directory in CT

2014-01-20 Thread Andrey Vagin
All modern distributions require devtmpfs in /dev. devtmpfs can't be mounted from userns. This patch bind-mounts the host /dev. It's secure, because permissions are handled according with uid and gid maps for the user namespace. Signed-off-by: Andrey Vagin --- src/lib/hooks

[Devel] [PATCH] hook_ct: mount devtmpfs in CT

2014-01-22 Thread Andrey Vagin
t required any more. Signed-off-by: Andrey Vagin --- etc/dists/scripts/prestart.sh | 4 --- src/lib/hooks_ct.c| 66 +++ 2 files changed, 16 insertions(+), 54 deletions(-) diff --git a/etc/dists/scripts/prestart.sh b/etc/dists/scripts/prestar

[Devel] [PATCH] scripts/prestart.sh: don't execute fixup_udev in background

2014-01-22 Thread Andrey Vagin
This script must be started before the init will be executed, so it must not be executed in background. Probably the author want to write && instead of &. I don't think, that we need to check errors here, because the next script is independent from the previous one. Signed-off

[Devel] [PATCH] hoot_ct: do not change a set of CT0's mountpoints

2014-01-29 Thread Andrey Vagin
for that we must remount root with MS_PRIVATE before doing anything else. https://bugzilla.openvz.org/show_bug.cgi?id=2879 Signed-off-by: Andrey Vagin --- src/lib/hooks_ct.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lib/hooks_ct.c b/src/lib/hooks_ct.c

Re: [Devel] [RFC rh7] net: venet -- Cleanup ip address on ve exit

2015-05-25 Thread Andrey Vagin
ith the patch applied I can checkpoint/restore container > with venet configured. Is it posibale to unload the venet module? Is it ok with this patch? > > Signed-off-by: Cyrill Gorcunov > CC: Vladimir Davydov > CC: Konstantin Khorenko > CC: Pavel Emelyanov > CC: Andrey Vagi

Re: [Devel] [RFC rh7] net: venet -- Cleanup ip address on ve exit

2015-05-25 Thread Andrey Vagin
ith the patch applied I can checkpoint/restore container > with venet configured. > Acked-by: Andrey Vagin > Signed-off-by: Cyrill Gorcunov > CC: Vladimir Davydov > CC: Konstantin Khorenko > CC: Pavel Emelyanov > CC: Andrey Vagi

[Devel] TRD: Start CT in a new user namespace: 1:1 user mapping

2015-10-13 Thread Andrey Vagin
Now CT starts in a new user namespace. This allows us * to remove our capabilities (CAP_VE_*) * to improve security of our containers, because a process doesn't have privileges outside the container Here is a good article about user namespaces https://lwn.net/Articles/532593/ https://jira.sw.ru

Re: [Devel] [PATCH rh7] ve: Add interface for @start_timespec and @real_start_timespec adjustmen

2016-02-10 Thread Andrey Vagin
On Tue, Feb 09, 2016 at 01:02:09PM +0300, Vladimir Davydov wrote: > On Mon, Feb 08, 2016 at 11:32:12AM +0300, Cyrill Gorcunov wrote: > > +static int ve_ts_read(struct cgroup *cg, struct cftype *cft, struct > > seq_file *m) > > +{ > > + struct ve_struct *ve = cgroup_ve(cg); > > + struct timespe

Re: [Devel] [PATCH] fs/locks: Make CAP_LEASE work in containers

2016-05-05 Thread Andrey Vagin
On Tue, Apr 26, 2016 at 12:36:12PM +0300, Cyrill Gorcunov wrote: > On Mon, Apr 25, 2016 at 06:22:10PM +0300, Evgenii Shatokhin wrote: > > https://jira.sw.ru/browse/PSBM-46199 > > > > Allowing the privileged processes in the containers to set leases on > > arbitrary files seems to make no harm. Let

Re: [Devel] [PATCH rhel7] procfs: always expose /proc//map_files/ and make it readable

2016-05-16 Thread Andrey Vagin
Acked-by: Andrey Vagin On Mon, May 16, 2016 at 11:28:51AM +0300, Cyrill Gorcunov wrote: > This is a backport of commit > > ML: bdb4d100afe9818aebd1d98ced575c5ef143456c > > From: Calvin Owens > > Currently, /proc//map_files/ is restricted to CAP_SYS_ADMIN, and

Re: [Devel] [PATCH rhel7] procfs: always expose /proc//map_files/ and make it readable

2016-05-20 Thread Andrey Vagin
> reasons as well. > > -- > Best regards, > > Konstantin Khorenko, > Virtuozzo Linux Kernel Team > > On 05/16/2016 10:42 PM, Andrey Vagin wrote: > > Acked-by: Andrey Vagin > > > > On Mon, May 16, 2016 at 11:28:51AM +0300, Cyrill Gorcunov wrote: >

Re: [Devel] [patch vz7] do not allow rootfs umount

2016-06-08 Thread Andrey Vagin
On Mon, Jun 06, 2016 at 03:45:11PM +0300, Vasily Averin wrote: > In mainline rootfs is marked always as MNT_LOCKED, > sys_umount checks this flag and fails its processing. > Our kernels lacks for MNT_LOCKED flag, so we use another kind of check > to prevent incorrect operation. > > https://jira.sw

Re: [Devel] [patch vz7 v2] do not allow rootfs umount

2016-06-14 Thread Andrey Vagin
> > v2: use mnt_has_parent() > > https://jira.sw.ru/browse/PSBM-46437 > Acked-by: Andrey Vagin > Signed-off-by: Vasily Averin > diff --git a/fs/namespace.c b/fs/namespace.c > index 988320b..4fb935a 100644 > --- a/fs/namespace.c > +++ b/fs/namespace.c > @@ -1355,6 +

[Devel] [PATCH 1/3] netlink: allow to set peeking offset for sockets

2016-06-14 Thread Andrey Vagin
This allows us to read socket's queue without removing skbs from it. The same logic was implemented for unix and inet sockets and we use this to dump and restore sockets in CRIU. Here is a question whether sk_peek_off has to be protected by locks. Currently it isn't protected and an user who uses

[Devel] [PATCH net-next 0/3] [RFC] netlink: prepare to dump and restore data from a receive queue

2016-06-14 Thread Andrey Vagin
ke we do for tcp sockets. * When we can dump data from a receive queue. I think we can do this only if a socket doesn't have a running callback. Andrey Vagin (3): netlink: allow to set peeking offset for sockets netlink: add an ability to restore messages in a receive queue netlink/di

[Devel] [PATCH 2/3] netlink: add an ability to restore messages in a receive queue

2016-06-14 Thread Andrey Vagin
This patch adds an repair mode for netlink sockets. sendmsg queues messages into a receive queue if a socket is in the repair mode. --- include/uapi/linux/netlink.h | 19 ++--- net/netlink/af_netlink.c | 51 +++- 2 files changed, 47 insertion

[Devel] [PATCH 3/3] netlink/diag: report flags for netlink sockets

2016-06-14 Thread Andrey Vagin
We need to know flags for dumping and restoring netlink sockets. All flags except NDIAG_FLAG_CB_RUNNING can be received with help of getsockopt(), but in this case we need a socket descriptor and we need to call getsockopt() to get each flag. With this chages we will be able to show netlink socke

[Devel] [PATCH] tcp: add an ability to dump and restore window parameters

2016-11-15 Thread Andrey Vagin
easons why we need to restore snd_wnd was described above. Cc: Pavel Emelyanov Cc: "David S. Miller" Cc: Alexey Kuznetsov Cc: James Morris Cc: Hideaki YOSHIFUJI Cc: Patrick McHardy Signed-off-by: Andrey Vagin Signed-off-by: David S. Miller --- include/uapi/linux/tcp.h | 10 +

[Devel] [PATCH] seccomp, ptrace: add support for dumping seccomp filters

2016-11-15 Thread Andrey Vagin
From: Tycho Andersen ML: f8e529ed941ba2bbcbf310b575d968159ce7e895 https://jira.sw.ru/browse/PSBM-55322 This patch adds support for dumping a process' (classic BPF) seccomp filters via ptrace. PTRACE_SECCOMP_GET_FILTER allows the tracer to dump the user's classic BPF seccomp filters. addr shoul

[Devel] [PATCH criu 1/3] mount: handle error from restore_shared_options()

2016-11-21 Thread Andrey Vagin
From: Andrei Vagin Signed-off-by: Andrei Vagin --- criu/mount.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/criu/mount.c b/criu/mount.c index fcec92f..76d1505 100644 --- a/criu/mount.c +++ b/criu/mount.c @@ -2493,7 +2493,8 @@ static int propagate_mount(struct mount_inf

[Devel] [PATCH criu 2/3] mount: fix mounting non-root shared mounts

2016-11-21 Thread Andrey Vagin
From: Andrei Vagin A widest mount of a shared group has to be mounted first and then other mounts of this group has to be mounted from the first mount to inherite the shared group. https://jira.sw.ru/browse/PSBM-55494 Signed-off-by: Andrei Vagin --- criu/mount.c | 13 - 1 file chan

[Devel] [PATCH criu 3/3] mount: don't create a temporary directory if /tmp exists

2016-11-21 Thread Andrey Vagin
From: Andrei Vagin pivot_root requires a place where to move an old root. Currently a temporary directory is created for that, but it doesn't work if the / directory is read-only. Actually we can use any existing directory. In this patch, criu tries to use /tmp and only if it doesn't exist, criu

Re: [Devel] [PATCH rh7] seccomp, ptrace: Fix typo in filter fetching

2016-12-07 Thread Andrey Vagin
On Tue, Dec 06, 2016 at 05:59:30PM +0300, Cyrill Gorcunov wrote: > In commit 42b65fd18057d64410a0519962cd0650c762c99f there > is a typo: we need to copy the complete filter chain > not only first number. > > https://jira.sw.ru/browse/PSBM-55593 > Acked-by: Andrey Vagin

Re: [Devel] [PATCH rh7] seccomp, ptrace: Save original BPF program when setting the filer

2016-12-08 Thread Andrey Vagin
ht now, > lets rather do a trick for seccomp sake and simply carry a copy inside > struct seccomp_filter. The socket filters are decoded into userspace form > anyway so this area is safe. > > https://jira.sw.ru/browse/PSBM-55593 > > CC: Andrey Vagin > Signed-off-by: Cyrill

[Devel] [PATCH criu] mount: clone a mount namespace to open a detached mount

2016-12-12 Thread Andrey Vagin
From: Andrei Vagin If we can't create a temporary directory for a detached mount, we can clone a whole mount namespace, open a mount and release the created namespace. The result will be the same. https://jira.sw.ru/browse/PSBM-57135 Signed-off-by: Andrei Vagin --- criu/mount.c | 18 ++

[Devel] [PATCH criu-ovz] tcp: bind tcp sockets after enabling the repair mode

2016-12-15 Thread Andrey Vagin
From: Andrei Vagin Only sockets in the repair mode can be bound to the same port a few time, what is required to restore tcp connects. Signed-off-by: Andrei Vagin --- criu/sk-inet.c | 10 +- soccr/soccr.c | 10 ++ 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a

Re: [Devel] [PATCH rh7] netlink: Don't manipulate @sk_peek_off if data fetching failed

2016-12-22 Thread Andrey Vagin
ubsequent recvmsg > calls. Instead lets exit early with error. > > In sake of https://jira.sw.ru/browse/PSBM-57921 > > CC: Andrey Vagin > Signed-off-by: Cyrill Gorcunov > --- > net/netlink/af_netlink.c |4 > 1 file changed, 4 insertions(+) > &

Re: [Devel] [PATCH rh7] netlink: Don't manipulate @sk_peek_off if data fetching failed

2016-12-22 Thread Andrey Vagin
On Thu, Dec 22, 2016 at 03:34:15PM -0800, Andrey Vagin wrote: > On Thu, Dec 22, 2016 at 06:41:42PM +0300, Cyrill Gorcunov wrote: > > When skb_copy_datagram_iovec called to fetch queued data > > it may fail with EFAULT and if MSG_PEEK set by a caller > > the position get

Re: [Devel] [PATCH rh7] netlink: Don't manipulate @sk_peek_off if data fetching failed

2016-12-22 Thread Andrey Vagin
On Thu, Dec 22, 2016 at 04:12:13PM -0800, Andrey Vagin wrote: > On Thu, Dec 22, 2016 at 03:34:15PM -0800, Andrey Vagin wrote: > > On Thu, Dec 22, 2016 at 06:41:42PM +0300, Cyrill Gorcunov wrote: > > > When skb_copy_datagram_iovec called to fetch queued data > > > it

Re: [Devel] [PATCH criu 2/6] action-scripts: Add "pre-resume" stage

2017-02-08 Thread Andrey Vagin
On Wed, Feb 08, 2017 at 12:05:37AM +0300, Cyrill Gorcunov wrote: > The main idea is to be able to operate with container > at the moment where its processess and resources are > already restored but the processes are not yet in > running state, ie just before we kick them. > > Beside the need of t

Re: [Devel] [PATCH criu 2/6] action-scripts: Add "pre-resume" stage

2017-02-09 Thread Andrey Vagin
On Thu, Feb 09, 2017 at 12:01:20AM +0300, Cyrill Gorcunov wrote: > On Wed, Feb 08, 2017 at 12:37:18PM -0800, Andrey Vagin wrote: > > On Wed, Feb 08, 2017 at 12:05:37AM +0300, Cyrill Gorcunov wrote: > > > The main idea is to be able to operate with container > > > at the

[Devel] [PATCH 2/2] test: check ucred for netlink messages

2017-02-13 Thread Andrey Vagin
From: Andrei Vagin Send a netlink message with ucred and check that it received with the same ucred. Signed-off-by: Andrei Vagin --- test/zdtm/static/sk-netlink.c | 55 ++- 1 file changed, 54 insertions(+), 1 deletion(-) diff --git a/test/zdtm/static/sk

[Devel] [PATCH 1/2] netlink: dump and restore ucred-s for netlink messages

2017-02-13 Thread Andrey Vagin
From: Andrei Vagin ucred in a netlink message contains the same pid and it doesn't metter from which pidns it is read. https://jira.sw.ru/browse/PSBM-59339 Cc: Kirill Tkhai Signed-off-by: Andrei Vagin --- criu/include/sk-queue.h | 5 ++- criu/sk-netlink.c | 2 +- criu/sk-queue.c

[Devel] [PATCH] criu: add more information about control messages

2017-02-16 Thread Andrey Vagin
From: Andrei Vagin We need to know a type of unsupported control messages. https://jira.sw.ru/browse/PSBM-60643 Signed-off-by: Andrei Vagin --- criu/sk-queue.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/criu/sk-queue.c b/criu/sk-queue.c index be33ca1..f68d26f 100644 --- a/criu/sk-qu

[Devel] [PATCH 0/5] A few fixes for netlink sockets

2017-02-18 Thread Andrey Vagin
From: Andrei Vagin https://jira.sw.ru/browse/PSBM-60643 Andrei Vagin (5): netlink: restore queues and only then restore opts netlink: dump/restore netlink options socket: don't restore ucred from kernel messages netlink: skip pktinfo scm if a sender group is less than 32 netlink: avoid

[Devel] [PATCH 2/5] netlink: dump/restore netlink options

2017-02-18 Thread Andrey Vagin
From: Andrei Vagin There are a few netlink specific opotions, which have to be dumped. Signed-off-by: Andrei Vagin --- criu/sk-netlink.c | 60 + images/sk-netlink.proto | 9 2 files changed, 69 insertions(+) diff --git a/criu/sk-

[Devel] [PATCH 4/5] netlink: skip pktinfo scm if a sender group is less than 32

2017-02-18 Thread Andrey Vagin
From: Andrei Vagin nl_pktinfo control messages is used to get the extended destination group number. Signed-off-by: Andrei Vagin --- criu/sk-queue.c | 13 + 1 file changed, 13 insertions(+) diff --git a/criu/sk-queue.c b/criu/sk-queue.c index 88e47b8..8124f75 100644 --- a/criu/sk

[Devel] [PATCH 3/5] socket: don't restore ucred from kernel messages

2017-02-18 Thread Andrey Vagin
From: Andrei Vagin ucred.pid is zero for kernel messages and in this case it is impossible to restore it. Signed-off-by: Andrei Vagin --- criu/sk-queue.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/criu/sk-queue.c b/criu/sk-queue.c index e72ca45..88e47b8 100644 --

[Devel] [PATCH 1/5] netlink: restore queues and only then restore opts

2017-02-18 Thread Andrey Vagin
From: Andrei Vagin When we restore queues, we set limits to unlimited values, so then we need to restore required values for them. Signed-off-by: Andrei Vagin --- criu/sk-netlink.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/criu/sk-netlink.c b/criu/sk-netlink.c ind

[Devel] [PATCH 5/5] netlink: avoid ENOBUF when a netlink queue is dumped

2017-02-18 Thread Andrey Vagin
From: Andrei Vagin If a socket buffer is full and some messaged have been dropped, the first recvmsg will return -ENOBUF. We can avoid this if we set the NETLINK_NO_ENOBUFS opt for a socket. Signed-off-by: Andrei Vagin --- criu/sk-netlink.c | 19 ++- 1 file changed, 18 inserti

Re: [Devel] [PATCH rh7 v2] netlink: Don't manipulate @sk_peek_off if data fetching failed

2017-03-21 Thread Andrey Vagin
Acked-by: Andrey Vagin On Fri, Dec 23, 2016 at 10:19:01AM +0300, Cyrill Gorcunov wrote: > On Fri, Dec 23, 2016 at 09:59:28AM +0300, Cyrill Gorcunov wrote: > > On Thu, Dec 22, 2016 at 04:45:10PM -0800, Andrey Vagin wrote: > > > > > > Actually, this patch breaks

Re: [Devel] [PATCH rh7 v2] netlink: Don't manipulate @sk_peek_off if data fetching failed

2017-03-31 Thread Andrey Vagin
On Mon, Mar 27, 2017 at 03:39:40PM +0300, Konstantin Khorenko wrote: > Andrey, are you going to send your patch to mainstream? > (Kirill's patch is based on your patch, AFAIK) > > commit 523b88d0b87acbc7af9ae1677e993ed20f55dc5e > Author: Andrey Vagin > Date: Fri Jun

[Devel] [PATCH] dump: any non-negative return code of run_scripts means an error

2017-04-06 Thread Andrey Vagin
From: Andrei Vagin run_scripts can execute notifications via rpc, so WEXITSTATUS() can't be applied to return codes in this case. And an action script can be killed and it is an error too. This patch may fix on of errors of https://jira.sw.ru/browse/PSBM-62583 Signed-off-by: Andrei Vagin ---

Re: [Devel] [PATCH] kernel: call task_work_run() before exit_task_namespaces()

2017-07-19 Thread Andrey Vagin
On Wed, Jul 19, 2017 at 11:31:28AM -0700, Stanislav Kinsburskiy wrote: > > > 19 июля 2017 г. 9:14 PM пользователь Andrey Vagin > написал: > > On Wed, Jul 19, 2017 at 08:04:22PM +0300, Andrey Ryabinin wrote: > > > > > > On 07/19/2017 04:14 AM

Re: [Devel] [PATCH 3/3] net: do iptables restore in ve0

2017-07-24 Thread Andrey Vagin
On Mon, Jul 24, 2017 at 07:12:50PM +0300, Cyrill Gorcunov wrote: > On Mon, Jul 24, 2017 at 07:09:39PM +0300, Stanislav Kinsburskiy wrote: > > > >Well, no. I don't like this defines. > >And I don't think that pid has to be explicitly provided. At least for > >ve0. > >But frankly, I

Re: [Devel] [PATCH 3/3] net: do iptables restore in ve0

2017-07-24 Thread Andrey Vagin
On Mon, Jul 24, 2017 at 11:37:52PM -0700, Stanislav Kinsburskiy wrote: > > > 24 июля 2017 г. 7:12 PM пользователь Kirill Gorkunov > написал: > > On Mon, Jul 24, 2017 at 07:09:39PM +0300, Stanislav Kinsburskiy wrote: > > > >Well, no. I don't like this defines. > >And I do

Re: [Devel] [PATCH vz7-u5 v2 1/2] mount: restore_task_mnt_ns - Lookup for mount namespace conditionally

2017-07-25 Thread Andrey Vagin
PSBM-68062 > > v2: > - make sure the ids is inherited if zombie met > Acked-by: Andrey Vagin > Signed-off-by: Cyrill Gorcunov > --- > criu/mount.c | 11 +-- > 1 file changed, 9 insertions(+), 2 deletions(-) > > diff --git a/criu/mount.c b/criu/mount.c >

Re: [Devel] [PATCH criu v7-u5 1/2] mount: restore_task_mnt_ns - Lookup for mount namespace conditionally

2017-07-25 Thread Andrey Vagin
On Sat, Jul 22, 2017 at 01:27:08PM +0300, Cyrill Gorcunov wrote: > In case if our parent is a dead task (zombie) we should lookup > for parent ids which will be inherited on restore. Otherwise > parent->ids may be nil and SIGSEGV produced. > > https://jira.sw.ru/browse/PSBM-68062 > > Signed-off-b

Re: [Devel] [PATCH] images: Reserve tty numbers in task_core_entry

2017-07-28 Thread Andrey Vagin
Applied, thanks! On Tue, Jul 18, 2017 at 10:57:54PM +0300, Cyrill Gorcunov wrote: > We will need them to handle tty inheritance. > > Signed-off-by: Cyrill Gorcunov > --- > images/core.proto | 4 > 1 file changed, 4 insertions(+) > > In sake of https://jira.sw.ru/browse/PSBM-67671 > > diff

Re: [Devel] [PATCH] criu: threads -- Allow uids/gids being different

2017-09-18 Thread Andrey Vagin
Do we need this patch for the upstream criu? On Tue, Sep 12, 2017 at 05:49:43PM +0300, Cyrill Gorcunov wrote: > On Tue, Sep 12, 2017 at 5:43 PM, Cyrill Gorcunov wrote: > > On Sun, Jul 23, 2017 at 6:15 PM, Cyrill Gorcunov wrote: > >> We are carrying uids/gids in per-thread way since v1.8, > >> so

Re: [Devel] [PATCH 0/2] vz7: Fix id trimming in pagemap- images

2017-10-18 Thread Andrey Vagin
Reviewed-by: Andrey Vagin On Wed, Oct 18, 2017 at 01:01:40PM +0300, Cyrill Gorcunov wrote: > Andrew, Kirill, take a look please. I think we should use %lu > for all images names instead of %d, but this will require more > code changes which I'm planning to do for vanilla criu firs

Re: [Devel] [PATCH rh7]: ve: Provide interface for current tty inheritance

2018-02-15 Thread Andrey Vagin
ks, Andrei > > https://jira.sw.ru/browse/PSBM-76490 > > CC: Andrey Vagin > CC: Andrey Ryabinin > CC: Konstantin Khorenko > CC: "Denis V. Lunev" > Signed-off-by: Cyrill Gorcunov > --- > Guys, take a look please. Note the patch on its own is useless >