- 05 Sep, 2014 6 commits
-
-
Pavel Emelyanov authored
When service starts page server all the preparations (log, wdir, img dir, etc.) happen in parent task, then we fork page server. This is OK for now, but when we will serve several requests per connection, all these resources would be leaked in parent. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
The problem with several requests is that criu leaks resources after doing dump/restore. It's OK since process exits anyway, but for multy requests per connection it's better to audit this thing. For now -- allow to do requests after the page-server-start one only. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
That's preparation to "several requests per connection" patch. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 04 Sep, 2014 2 commits
-
-
Andrey Vagin authored
It is called from prepare_cgroup_sfd() and cr_restore_tasks(). + criu restore --file-locks --tcp-established --evasive-devices --link-remap --root /var/lib/vz/root/101 --restore-detached --action-script /usr/local/libexec/vzctl/scripts/vps-rst-env -D /vz/dump/Dump.101 -o restore.log -vvvv --pidfile /var/lib/vzctl/vepid/101 *** Error in `criu': double free or corruption (fasttop): 0x00000000006bcd40 *** Program terminated with signal 6, Aborted. Missing separate debuginfos, use: debuginfo-install glibc-2.17-20.fc19.x86_64 libgcc-4.8.3-1.fc19.x86_64 protobuf-c-0.15-7.fc19.x86_64 (gdb) bt #0 0x00007ffff72179e9 in raise () from /lib64/libc.so.6 #1 0x00007ffff72190f8 in abort () from /lib64/libc.so.6 #2 0x00007ffff7257d17 in __libc_message () from /lib64/libc.so.6 #3 0x00007ffff725f0b8 in _int_free () from /lib64/libc.so.6 #4 0x0000000000426971 in cr_restore_tasks () at cr-restore.c:1833 #5 0x0000000000418426 in main (argc=<optimized out>, argv=0x7fffffffeb38, envp=<optimized out>) at crtools.c:479 Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
To show which events are coming and flush events before dump as required by new fsnotify mode. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Acked-by:
Andrew Vagin <avagin@parallels.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 03 Sep, 2014 11 commits
-
-
Andrey Vagin authored
If a controller is mounted during dumping processes, criu may fail with error: Error (cgroup.c:768): cg: Set 3 is not subset of 2 so lets create all test controllers before executing tests. Reported-by: Mr Jenkins Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
Events are not dumped/restored. An idea of ignoring them isn't good. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Acked-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Tycho Andersen authored
There is a potential attack here where if someone is restoring something and criu write the pid to a file the attacker controls, the attacker can then re-write that to whatever pid they want. ciru should instead open the file with O_EXCL so that the restore fails if the file exists. We don't need O_TRUNC here since we're O_EXCL-ing the file. Reported-by:
Serge Hallyn <serge.hallyn@ubuntu.com> Signed-off-by:
Tycho Andersen <tycho.andersen@canonical.com> Acked-by:
Serge E. Hallyn <serge.hallyn@ubuntu.com> 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
If we need to check if current loglevel will suppress our messagess (say you need to run pr_debug in a cycle) we can use this helper to eliminate unneded calls. Like if (!pr_quelled(LOG_DEBUG)) { ... do something specific to LOG_DEBUG ... } Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
All marks are collected in a list and then they are written in the eventpoll image as a repeated field. This images merge reduces the amount of image files criu generates and may simplify the fix of mentioned above issue v2: save the original order of entries Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
All marks are collected in a list and then they are written in the fanotify image as a repeated field. This images merge reduces the amount of image files criu generates and may simplify the fix of mentioned above issue v2: don't leak fe.mark_entry v3: save the original order of marks Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
All watch descriptors are collected in a list and then they are written in inotify image as a repeated field. This images merge reduces the amount of image files criu generates and may simplify the fix of mentioned above issue. v2: use free_inotify_wd_entry() instead of xfree in dump_one_inotify() v3: don't leak ie.wd_entry v4: save the original order of watchers Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
The swrk action is turning out to be a cool thing. We can spawn criu with swrk action with some FD being open, then ask for dump/pre-dump/page-server telling it that some descriptor it needs is "out there". This patch lets us specify that the page server communication channel is already in criu's fdtable. TODO: teach regular service to accept fd via service socket. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
Here we define new api to be used in plugins. - Plugin should provide a descriptor with help of CR_PLUGIN_REGISTER macro, or in case if plugin require no init/exit functions -- with CR_PLUGIN_REGISTER_DUMMY. - Plugin should define a plugin hook with help of CR_PLUGIN_REGISTER_HOOK macro. - Now init/exit functions of plugins takes @stage argument which tells plugin which stage of criu it's been called on dump/restore. For exit it also takes @ret which allows plugin to know if something went wrong and it needs to cleanup own resources. The idea behind is to not limit plugins authors with names of functions they might need to use for particular hook. Such new API deprecates olds plugins structure but to keep backward compatibility we will provide a tiny layer of additional code to support old plugins for at least a couple of release cycles. For example a trivial plugin might look like | #include <sys/types.h> | #include <sys/stat.h> | #include <fcntl.h> | #include <libgen.h> | #include <errno.h> | | #include <sys/socket.h> | #include <linux/un.h> | | #include <stdio.h> | #include <stdlib.h> | #include <string.h> | #include <unistd.h> | | #include "criu-plugin.h" | #include "criu-log.h" | | static int dump_ext_file(int fd, int id) | { | pr_info("dump_ext_file: fd %d id %d\n", fd, id); | return 0; | } | | CR_PLUGIN_REGISTER_DUMMY("trivial") | CR_PLUGIN_REGISTER_HOOK(CR_PLUGIN_HOOK__DUMP_EXT_FILE, dump_ext_file) Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Acked-by:
Andrew Vagin <avagin@parallels.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
- use custom multiline comments style - ending #endif comment Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Acked-by:
Andrew Vagin <avagin@parallels.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 02 Sep, 2014 21 commits
-
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
These guys may have pids that are not met in pstree. This is not the reason for skipping those, try to resolve flocks anyway. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Criu may re-lock the lock, thus spoiling the pid, so compare the file inode number instead. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
Return 0 in a success case Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
After patches, that dump locks w/o dfds array, we can even not allocate one when we don't need it. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
If we open a file, lock one, fork, then close and open the file in parent again, lock should 'slide' to the child process anyway. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Inherited flock is the one that a task got from its parent. In case parent closes the corresponding fd, the /proc/locks still shows the parent pid, while the lock is owned by child. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Shared here means that a flock is visible from two tasks -- the owner one and its child. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
We have a problem with file locks (bug #2512) -- the /proc/locks file shows the ID of lock creator, not the owner. Thus, if the creator died, but holder is still alive, criu fails to dump the lock held by latter task. The proposal is to find who _might_ hold the lock by checking for dev:inode pairs on lock vs file descriptors being dumped. If the creator of the lock is still alive, then he will take the priority. One thing to note about flocks -- these belong to file entries, not to tasks. Thus, when we meet one, we should check whether the flock is really held by task's FD by trying to set yet another one. In case of success -- lock really belongs to fd we dump, in case it doesn't trylock should fail. At the very end -- walk the list of locks and dump them all at once, which is possible by merge of per-task file-locks images into one global one. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Same reason as for previous patch. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Currently we keep the lock type (posix/flock) till the time we dump it, then "decode" it into binary value. I will need the easy-to-check one early, so parse the kind in proc_parse. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
We can't dump netlink socket, inotify, fanotify, if they have queued data, so lets add a function to chech this. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Acked-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Ruslan Kuprieiev authored
Signed-off-by:
Ruslan Kuprieiev <kupruser@gmail.com> Acked-by:
Kir Kolyshkin <kir@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Ruslan Kuprieiev authored
Check for setproctitle_init, as old versions of libbsd don't have one. Reported-by:
Kir Kolyshkin <kir@openvz.org> Signed-off-by:
Ruslan Kuprieiev <kupruser@gmail.com> Acked-by:
Kir Kolyshkin <kir@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Ruslan Kuprieiev authored
Signed-off-by:
Ruslan Kuprieiev <kupruser@gmail.com> Acked-by:
Kir Kolyshkin <kir@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
Usually /tmp is a mount point. Recently we found a bug in criu, when it restore mount fanotify on "./" instead of "/". The test didn't find it, because they are pointed on the same mount point. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
We try to remove mark on the correct mount point and if the mark is restored on a wrong mount point, we will get ENOENT. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-