- 23 Sep, 2013 13 commits
-
-
Andrey Vagin authored
A task is stopped here for unmaping restorer blob and restoring a state. The method is the same as for parasite. CRIU attaches to processes via ptrace and start to trace all syscalls. v2: don't use a software breakpoint v3: stop all thread on the exit from sigreturn v4: attach to each thread Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
We are going to check is it valid or not. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
parse_thread allocated a buffer for threads and then it initialized read pid for each thread. Now we want to use it on restore and in this moment we already have a buffer with initialized virt pid-s, so we need to initialize read pid-s only. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
It will be used in cr-restore.c for stopping threads on the exit from sigreturn. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
The munmap syscall must be executed from a process memory. The code can be injected in memory and then removed. But we can avoid all these actions, if the code will be in the blob and a process will be trapped on the exit from the munmap syscall. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
This feature will be used for unmaping restorer blobs. All reqired code will be in the blob. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
All processes must be started by PTRACE_SYSCALL. The function calls wait in a loop and if a process on the exit from the required syscall, it is stopped, otherwise it will be reexecuted by PTRACE_SYSCALL. The function doesn't know, which processes should be trapped, so you should care, that wait() will not catch someone else. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
This patch adds nothing new, just splits the existant function. Currently a parasite stopped on sigreturn for unmaping a parasite blob. The same scheme will be used for restorer blob and this function will be used to stop on exit from the munmap syscall. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
For the root task the clone syscall returns the pid in criu's pidns, but for other processes the clone syscall returns PID in the restored namespace. The /proc/self link contains the PID value of the current process, so if we want to determing the PID in a criu's pidns, we should use criu's /proc. v2: readlink() does not append a null byte to buf, so we must do that Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
A pstree item will contain pid and state. Both these properties will be determined after creating processes and will be used from the controlling proces. v2: fix the error path Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Original-patch-by:
Andrey Vagin <avagin@openvz.org> Original-patch-by:
Ruslan Kuprieiev <kupruser@gmail.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Ruslan Kuprieiev authored
Signed-off-by:
Ruslan Kuprieiev <kupruser@gmail.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 20 Sep, 2013 1 commit
-
-
Andrey Vagin authored
Otherwise threads can handle them before calling sigreturn with wrong (not belonging to crtools, but to the target task) handers: __export_restore_task | __export_restore_thread restore_finish_stage(CR_STATE_RESTORE); | restore_finish_stage(CR_STATE_RESTORE); sys_sigaction(SIGCHLD, &args->sigchld_act, ...) | restore_signals() | ksigfillset(&to_block); | sys_rt_sigqueueinfo(sys_getpid(), ...); | | execute signal handler() <------ BUG !!! | restore_signals() | ksigfillset(&to_block); Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 18 Sep, 2013 1 commit
-
-
Cyrill Gorcunov authored
For debug purpose. | (00.013002) 1: Restoring link lo type 1 | (00.013002) 1: Restoring netdev lo idx 1 | (00.015002) 1: Restoring link venet0 type 4 | (00.015002) 1: Restoring link eth0 type 2 | (00.015002) 1: Restoring netdev eth0 idx 3 Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 17 Sep, 2013 4 commits
-
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
We was going to block a connections in both directions (v0.6-97-g0a1b70bb), but both iptable rules are added in the INPUT table. It's wrong, because the rule must be added to the OUTPUT table to block locally-generated packets Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
SO_SNDBUF and SO_RCVBUF sets a double input value, because "Linux reserves half of te socket buffer for metadata." So if a process is suspended/restored many times, a socket buffer size is doubled on each iteration and in a one moment it is overflowed. Very likely the program hangs in such situation, because the socket with negative buffer size is unusable. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Acked-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Alexander Kolesen authored
An error occurs when trying to build crtools on ARM systems with perl versions earlier than 5.13.2 due to lack of /r modifier. % make ... GEN arch/arm/syscalls.S Bareword found where operator expected at arch/arm/gen-syscalls.pl line 8, near "s/.*include\///gr" Bareword found where operator expected at arch/arm/gen-syscalls.pl line 10, near "s/.*include\///gr" Bareword found where operator expected at arch/arm/gen-syscalls.pl line 13, near "s/.*include\///gr" Bareword found where operator expected at arch/arm/gen-syscalls.pl line 16, near "tr/.-/_/r" Bareword found where operator expected at arch/arm/gen-syscalls.pl line 17, near "tr/.-/_/r" syntax error at arch/arm/gen-syscalls.pl line 8, near "s/.*include\///gr" syntax error at arch/arm/gen-syscalls.pl line 10, near "s/.*include\///gr" syntax error at arch/arm/gen-syscalls.pl line 13, near "s/.*include\///gr" syntax error at arch/arm/gen-syscalls.pl line 16, near "tr/.-/_/r" syntax error at arch/arm/gen-syscalls.pl line 17, near "tr/.-/_/r" BEGIN not safe after errors--compilation aborted at arch/arm/gen-syscalls.pl line 60. make[1]: *** No rule to make target `arch/arm/syscalls.S', needed by `arch/arm/syscalls.o'. Stop. Signed-off-by:
Alexander Kolesen <kolesen.a@gmail.com> Acked-by:
Alexander Kartashov <alekskartashov@parallels.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 16 Sep, 2013 7 commits
-
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Ruslan Kuprieiev authored
When service/page server becomes daemon, we may need to know it's pid. Signed-off-by: Ruslan Kuprieiev<kupruser@gmail.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
We need 2 parameters only to form it properly. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Now we don't have generic criu_msg thing -- instead, we have explicit request (with per-type args) and explicit responce (yet again -- with per-type args). Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Put important things first, secondary last. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Ruslan Kuprieiev authored
The most of fields are to be changed to "optional", because they are optional in fact. Signed-off-by:
Ruslan Kuprieiev <kupruser@gmail.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 14 Sep, 2013 14 commits
-
-
Cyrill Gorcunov authored
If criu is built from git repo print git commit id, convenient for debug. For example | $ ./criu -V | Version: 0.7 | GitID: 7985251 Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
Defining it as static char is a bad idea especially if it get included and never used -- we will get "unused" variable error. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
-vv...v must increase logging level on a number of the 'v' symbols. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
We should zeroify all data actually for security reason but this aspect will be addressed in further patches. Meanwhile at least allocate enought space so pb_write won't access data which is not allocated for us. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Kir Kolyshkin authored
After parsing options we expect either 0 or 1 arguments, no more. Signed-off-by:
Kir Kolyshkin <kir@openvz.org> Acked-by:
Andrew Vagin <avagin@parallels.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Kir Kolyshkin authored
Signed-off-by:
Kir Kolyshkin <kir@openvz.org> Acked-by:
Andrew Vagin <avagin@parallels.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Kir Kolyshkin authored
Easier that way Signed-off-by:
Kir Kolyshkin <kir@openvz.org> Acked-by:
Andrew Vagin <avagin@parallels.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Kir Kolyshkin authored
It's cleaner to have all options parsed in the same way (and in the same manner). Factor out usage() and call it when -h is found. Also, print usage text to stdout not stderr. Signed-off-by:
Kir Kolyshkin <kir@openvz.org> Acked-by:
Andrew Vagin <avagin@parallels.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Kir Kolyshkin authored
It's more cleaner to have all options parsed in one place. Signed-off-by:
Kir Kolyshkin <kir@openvz.org> Acked-by:
Andrew Vagin <avagin@parallels.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Kir Kolyshkin authored
Looks cleaner this way. Signed-off-by:
Kir Kolyshkin <kir@openvz.org> Acked-by:
Andrew Vagin <avagin@parallels.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Kir Kolyshkin authored
It's got not get. Signed-off-by:
Kir Kolyshkin <kir@openvz.org> Acked-by:
Andrew Vagin <avagin@parallels.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-