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 <ava...@virtuozzo.com> > CC: Andrey Ryabinin <aryabi...@virtuozzo.com> > CC: Konstantin Khorenko <khore...@virtuozzo.com> > CC: "Denis V. Lunev" <d...@virtuozzo.com>

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

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

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 > >

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 <ava...@virtuozzo.com> > Signed-off-by: Cyrill Gorcunov <gorcu...@virtuozzo.com> > --- > criu/mount.c | 11 +-- > 1 file changed, 9 insertions(+), 2 deletions(-)

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

2017-07-25 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

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] 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 <ava...@virtuozzo.com> > написал: > > On Wed, Jul 19, 2017 at 08:04:22PM +0300, Andrey Ryabinin wrote: > > > > >

[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

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 <ava...@openvz.org> >

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 <ava...@virtuozzo.com> 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: > > > > > > Ac

[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

[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

[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

[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

[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

[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

[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

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

[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

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

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

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 > > &

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
uent recvmsg > calls. Instead lets exit early with error. > > In sake of https://jira.sw.ru/browse/PSBM-57921 > > CC: Andrey Vagin <ava...@openvz.org> > Signed-off-by: Cyrill Gorcunov <gorcu...@openvz.org> > --- > net/netlink/af_netlink.c |4 > 1 f

[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,

[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

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

2016-12-08 Thread Andrey Vagin
w, > 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 <ava...@openvz.org> >

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 <ava

[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

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

[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 @@

[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

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

2016-11-15 Thread Andrey Vagin
org> Cc: Patrick McHardy <ka...@trash.net> Signed-off-by: Andrey Vagin <ava...@openvz.org> Signed-off-by: David S. Miller <da...@davemloft.net> --- include/uapi/linux/tcp.h | 10 + net/ipv4/tcp.c | 57 2 files

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

2016-06-15 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

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

2016-06-15 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

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

2016-06-15 Thread Andrey Vagin
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/diag: report

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

2016-06-15 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

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 <ava...@virtuozzo.com> > Signed-off-by: Vasily Averin <v...@virtuozzo.com> > diff --git a/fs/namespace.c b/fs/namespace.c > index 988320b..4fb935a 100644 > --- a

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. > >

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 <ava...@virtuozzo.com> > > > > On Mon, May 16, 2016 at 11:

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

2016-05-16 Thread Andrey Vagin
Acked-by: Andrey Vagin <ava...@virtuozzo.com> On Mon, May 16, 2016 at 11:28:51AM +0300, Cyrill Gorcunov wrote: > This is a backport of commit > > ML: bdb4d100afe9818aebd1d98ced575c5ef143456c > > From: Calvin Owens <calvinow...@fb.com> > > Currently

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.

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

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

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

2015-05-25 Thread Andrey Vagin
-by: Andrey Vagin ava...@odin.com Signed-off-by: Cyrill Gorcunov gorcu...@odin.com CC: Vladimir Davydov vdavy...@odin.com CC: Konstantin Khorenko khore...@odin.com CC: Pavel Emelyanov xe...@odin.com CC: Andrey Vagin ava...@odin.com --- If there some better idea, please share. drivers/net

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

2015-05-25 Thread Andrey Vagin
to unload the venet module? Is it ok with this patch? Signed-off-by: Cyrill Gorcunov gorcu...@odin.com CC: Vladimir Davydov vdavy...@odin.com CC: Konstantin Khorenko khore...@odin.com CC: Pavel Emelyanov xe...@odin.com CC: Andrey Vagin ava...@odin.com --- If there some better idea

[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 ava...@openvz.org --- src/lib/hooks_ct.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lib/hooks_ct.c b/src

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

2014-01-22 Thread Andrey Vagin
any more. Signed-off-by: Andrey Vagin ava...@openvz.org --- 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

[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-by: Andrey Vagin ava

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

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

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

2014-01-20 Thread Andrey Vagin
it is that this configuration doesn't supported by CRIU. Signed-off-by: Andrey Vagin ava...@openvz.org --- 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
it is that this configuration doesn't supported by CRIU. Signed-off-by: Andrey Vagin ava...@openvz.org --- 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 ava...@openvz.org --- src/lib

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

2014-01-13 Thread Andrey Vagin
point. ... Signed-off-by: Andrey Vagin ava...@openvz.org --- 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

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

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

[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 umounting

[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 ava...@openvz.org --- scripts/Makefile.am| 3

[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 ava...@openvz.org --- 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 ava...@openvz.org

[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 ava...@openvz.org --- scripts/vps-rst.in | 11 ++- src/lib/hooks_ct.c | 16 +--- 2

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

2013-05-30 Thread Andrey Vagin
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 ava...@openvz.org --- include/cpt.h | 3 ++- scripts/vps-rst.in | 11 ++- src/lib/env.c | 10 +- src/lib/hooks_ct.c | 31

[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 ava...@openvz.org --- include/types.h | 2 ++ scripts/vps-netns_dev_add.in | 5 - src/lib

[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 ava...@openvz.org --- scripts/vps-rst.in | 12 ++-- src/lib/hooks_ct.c | 16 +--- 2 files changed, 23 insertions

[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 ava...@openvz.org --- 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

[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 ava...@openvz.org --- include/types.h | 2 ++ scripts/vps-netns_dev_add.in | 5 - src/lib

[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 ava...@openvz.org --- 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

[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 ava...@openvz.org --- scripts/vps-rst.in | 15 +-- src/lib/hooks_ct.c | 18 ++ 2 files changed, 27 insertions(+), 6 deletions

[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: split

[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 ava...@openvz.org --- src/lib/hooks_ct.c | 79 +++--- 1 file changed, 45 insertions(+), 34

[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 ava...@openvz.org --- 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

[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 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 626c055..cca15b6

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

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

[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 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 4fef438..7426d63 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-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 ava...@openvz.org --- scripts

[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 b

[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 --- scripts

[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 ava...@openvz.org --- 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

[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 ava...@openvz.org --- 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

[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 ava...@openvz.org --- 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

[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 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 5501d92..24ba9a8

[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 ava...@openvz.org --- 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

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

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

[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 ava...@openvz.org --- scripts/ct-cpt | 19 scripts/ct-rst | 17 ++ src/lib/hooks_ct.c | 91

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