- 01 Mar, 2017 15 commits
-
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Andrei Vagin authored
"zdtm.py run -a" doesn't work on Alpine: find: unrecognized: -executable So run zdtm/static/env00 for now to be sure that it is not broken at all. travis-ci: success for travis: execute tests on Alpine Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Andrei Vagin authored
It works faster and allows to check exit codes. travis-ci: success for series starting with [1/2] page-server: don't return a server pid from page-server Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Andrei Vagin authored
We see the "No space left on device" error on the current version, so let's try to use a newer version of Alpine, maybe this error has been fixed there. Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Cyrill Gorcunov authored
Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Andrei Vagin authored
travis-ci: success for A few fixes to c/r a docker container with a console (rev3) Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Andrei Vagin authored
Here we check that a master of a bind-mounted slave was opened in the root mount namespace. The problem is that we restore all mounts in the root mount namespace. Only when all mounts are restored, we create other mount namespaces. So when we are restoring mounts, we can open files only in the root mount namespace. Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Andrei Vagin authored
Currently all mounts are restored in a one mount namespace, then this namespace is cloned to restore other mount namespaces and we need another copy of this namespace to clean link remap files. Let's define terms: A - the root mount namespace B - the mount namespace where link remap files are destroyed Currently we restore all mounts in the B namespace and then clone it into the A namespace. But it doesn't work in a case, when we have to open file descriptores to restore mounts (e g to restore bind-mount pty slaves), because a file descriptor has to be opened from a specified mount (which is one of restore mount namespaces). This patch reworks code so, that all mounts is restored in the A mount namespace and then the B mount namespace is created. In this case we can open files from the root mount namespace (A). $ ./zdtm.py run -t zdtm/static/pty-console --iter 5 ====================== Run zdtm/static/pty-console in ns ======================= Start test Test is SUID ./pty-console --pidfile=pty-console.pid --outfile=pty-console.out Run criu dump Run criu restore Run criu dump =[log]=> dump/zdtm/static/pty-console/36/2/dump.log ------------------------ grep Error ------------------------ (00.106521) Error (criu/files-reg.c:1132): Can't lookup mount=563 for fd=4 path=/ptmx (00.106585) Error (criu/cr-dump.c:1325): Dump files (pid: 70) failed with -1 (00.129041) Error (criu/cr-dump.c:1674): Dumping FAILED. ------------------------ ERROR OVER ------------------------ Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Andrei Vagin authored
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 https://github.com/opencontainers/runc/issues/1202 travis-ci: success for A few fixes to c/r a docker container with a console (rev3) Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Andrei Vagin authored
Now we create pty pairs when file descriptors are restored. The problem is that a slave tty can be bind-mounted to somewhere and in this case we have to create this pair and hold a master file descritore before related file descriptors will not be restored. In this patch, a unix socket is used to hold file descriptros. And we use SK_PEEK_OFF and MSG_PEEK to get any of them. travis-ci: success for A few fixes to c/r a docker container with a console (rev3) Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Andrei Vagin authored
When we need to get a file descriptor, we have to set peek offset and then to peek a message. There are two system calls, so we need to be sure that nobody changes a socket peek offset after we set it. Acked-by:
Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Andrei Vagin authored
We need a storage for file descriptors which is shared between processes and doesn't use a lot of file descriptors. We are going to use it on restore and if it will use file descriptors, we will have to find descriptors which don't used by all restored processes to not confilict with their descriptors. There are two solutions. The first one is a service (process) which handles to command push_fd(id, fd) and pop_fd(id, fd). Another solution is to save descriptros in a unix socket. It requires only one extra descriptor which we can register as a service fd. Each unix socket has a buffer and can fit a number of file descriptros. We can use SK_PEEK_OFF and MSG_PEEK to get file descriptros from a socket as many times as we need. This patch implements the second solution. v2: call recvmsg with MSG_PEEK travis-ci: success for A few fixes to c/r a docker container with a console (rev3) Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Andrei Vagin authored
Now Docker creates a pty pair from a container devpts to use is as console. A slave tty is set as a control tty for the init process and bind-mounted into /dev/console. The master tty is handled externelly. Now CRIU can handle external resources, but here we have internal resources which are used externaly. https://github.com/opencontainers/runc/issues/1202 travis-ci: success for A few fixes to c/r a docker container with a console (rev3) Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
- 17 Feb, 2017 4 commits
-
-
Pavel Emelyanov authored
In 2.11 we've had several got bronek: - page-server start via RPC - Fedora build - ppc64le restorer switch Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Kir Kolyshkin authored
Recent Fedora releases add -Wp,-D_FORTIFY_SOURCE=2 to rpm builds, which breaks compiling pie code on some architectures due to its trying to use (absent) memcpy_chk() instead of usual memcpy(). We must stand strong against FORTIFY_SOURCE in pie code. No pasaran! Viva la resistance! NOTE: in tests, FORTIFY_SOURCE is disabled for completely different reasons (see commit d1a36cc9 for details), so we're not touching it. [v2: resend the correct (latest) version] Reported-by:
Reported-by: Adrian Reber <adrian@lisas.de> Signed-off-by:
Kir Kolyshkin <kir@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Laurent Dufour authored
The JUMP_TO_RESTORER_BLOB assembly macro has been rewrote through the commit '89d6b39c ppc64: pie -- Add ppc64le relocation's processing', but the Clobber list hasn't been updated. This doesn't generate build neither runtime errors since the Clobber list was larger than needed but GCC 7 is now raising an error when an assembly macro is clobbering the r2 register. This patch fix the Clobber list to just modified registers. Fixes: 89d6b39c ("ppc64: pie -- Add ppc64le relocation's processing") Reported-by:
Adrian Reber <adrian@lisas.de> Signed-off-by:
Laurent Dufour <ldufour@linux.vnet.ibm.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Pavel Emelyanov authored
Commit 10801f36 (page-server: don't return a server pid from page-server) broke page-server starting via RPC -- the latter code checks for return value being <=0 as failure. Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
- 13 Feb, 2017 1 commit
-
-
Pavel Emelyanov authored
This is a bugfix-mostly release. Interesting new features include the huge rework of files restoring engine which fixed us bugs we haven't seen in reality :) but have proven they exist. Als this rework opens the way for scm-rigts c/r we need for nginx. Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
- 09 Feb, 2017 1 commit
-
-
Adrian Reber authored
As runc uses the RPC interface to run criu it is necessary to expose the newly added status-fd feature via RPC. Using the status-fd interface makes it possible to use lazy migration with runc. travis-ci: success for RPC: make status-fd option available via RPC (rev3) Signed-off-by:
Adrian Reber <areber@redhat.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
- 08 Feb, 2017 2 commits
-
-
Cyrill Gorcunov authored
We will need it to include types once compel gets into own directory. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Cyrill Gorcunov authored
Will move the header into compel. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org>
-
- 07 Feb, 2017 1 commit
-
-
Adrian Reber authored
Migrating a process between a system with the 'xsave' CPU flag and another system without the 'xsave' CPU flags is not possible and fails during restore. To avoid this situation it is possible to boot the source system of the migration with 'noxsave' kernel command-line. Unfortunately criu currently tries to detect the presence of 'xsave' with the macro X86_FEATURE_XSAVE which represents the features of the CPU without taking into account if the operating system has disabled 'xsave'. Checking for 'xsave' availability with the macro X86_FEATURE_OSXSAVE detects correctly if Linux has been booted with disabled 'xsave' and thus migrating processes between hosts with and without 'xsave' is possible if the kernel uses the flag 'noxsave'. travis-ci: success for criu dump fails when using noxsave (rev2) Signed-off-by:
Adrian Reber <areber@redhat.com> Reviewed-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
- 06 Feb, 2017 16 commits
-
-
Pavel Emelyanov authored
Nowadays we have parasite and restorer logs just start with pie: prefix. Let's add timestamps in restorer too. For parasite adding timestamps would require passing the start timeval through the libcompel which is not (yet) clear how to do. travis-ci: success for pie: Print timestamps in restorer Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Pavel Emelyanov authored
When we collect all the read_page requests into one big preadv call, the latter one may not read all the data in one go and return less bytes read, than requested. This is valid and already met in a bug :) So advance the iovec set with the ret value and continue reading. v2: Compilation fix on arm-s A little bit more debugging https://github.com/xemul/criu/issues/271 travis-ci: success for series starting with [1/2] pagemap: Support async pages reading by chunks (v2) Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Andrei Vagin authored
This patch reworks this function, removes mess and fix the next coverity issue: 394 m->parent = parent; CID 175314 (#1 of 1): Dereference after null check (FORWARD_NULL) 27. var_deref_model: Passing null pointer &parent->children to list_add_tail, which dereferences it. [show details] travis-ci: success for mount: simplify mnt_build_ids_tree() Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Andrei Vagin authored
205 if (fd < 0) { >>> >>> CID 175317: (PW.BAD_PRINTF_FORMAT_STRING) >>> >>> invalid format string conversion 206 pr_perror("can't accept client connection %m"); travis-ci: success for zdtm: use pr_err if errno isn't required Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Andrei Vagin authored
1359 if (prep_unix_sk_cwd(ui, &cwd_fd, &root_fd)) >>> >>> CID 175319: Resource leaks (RESOURCE_LEAK) >>> >>> Handle variable cwd_fd going out of scope leaks the handle. travis-ci: success for unix: don't leak a file descriptor Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Kirill Tkhai authored
Every task and helper have ids populated, except this case. Fix that. https://travis-ci.org/tkhai/criu/builds/197728925 travis-ci: success for files: Fix not populated helper ids Signed-off-by:
Kirill Tkhai <ktkhai@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Andrei Vagin authored
The problem is in the chroot test: geninfo: ERROR: /home/travis/build/xemul/criu/test/zdtm/static/chroot.dir.test/home/travis/build/xemul/criu/images/timer.gcno: could not open file We can just ignore these errors. travis-ci: success for travis: fix collecting code coverage Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Andrei Vagin authored
This patch fixes an exit code if a page-server is started as a daemon. Now the criu exits with a pid of a page server, it's meaningless, because pid is usually bigger than 128. travis-ci: success for series starting with [1/2] page-server: don't return a server pid from page-server Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Andrei Vagin authored
Currently we check errno, but musl-libc doesn't zero it, if fscanf() has returned EOF without errors. travis-ci: success for A few fixes for Alpine Linux Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Andrei Vagin authored
They are not implemented in musl-libc (alpine). travis-ci: success for A few fixes for Alpine Linux Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Kirill Tkhai authored
In the case when one eventpoll in polled by another eventpoll, we should wait till the polled epoll is opened. So, as the stage FLE_RESTORED is after FLE_OPEN, it's also OK. travis-ci: success for eventpoll: Fix dependency check Signed-off-by:
Kirill Tkhai <ktkhai@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Kirill Tkhai authored
The callers of rfi_remap() are interested in a errno, linkat_hard() returns. So, preserve errno before we call rm_parent_dirs(). Reported-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Kirill Tkhai <ktkhai@virtuozzo.com> Acked-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Andrei Vagin authored
We are going to create slave pty-s to bind-mount them, but at this moment we don't have file_desc-s and actually can't open /dev/ptmx by path. Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Andrei Vagin authored
Absolute paths are used to delete old unix sockets. After 3f67731b8e all processes live in a mount root yard, so if we want to access absolute paths, we have to change root. https://travis-ci.org/avagin/criu/builds/197092365Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Kirill Tkhai authored
Save one syscall and analyze recvmsg() error code to check that there is no data in the socket. Signed-off-by:
Kirill Tkhai <ktkhai@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Pavel Emelyanov authored
As a slight side effect even expected fle is checked for being task_fle(), but that's OK. Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com> Acked-by:
Kirill Tkhai <ktkhai@virtuozzo.com>
-