- 26 Dec, 2013 4 commits
-
-
Pavel Emelyanov authored
The t and m match there, but strictly speaking we're working on the m. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
We'll have to pre-mount some, so move the read_mnt_ns_img before pivot_root call. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
To carry them with us in a local variable (next patches), not the global mntinfo one. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
We will need images at hands while we do pivot_root (see further patches), so prepare the images reading routine. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 23 Dec, 2013 7 commits
-
-
Andrey Vagin authored
CID 1141016 (#1 of 1): Extra sizeof expression (SIZEOF_MISMATCH) suspicious_pointer_arithmetic: Adding "40UL /* sizeof (FilePermsEntry) */" to pointer "(FownEntry *)perms" of type "FownEntry *" is suspicious because adding an integral value to this pointer automatically scales that value by the size, 48 bytes, of the pointed-to type, "FownEntry". Most likely, "sizeof (FilePermsEntry)" is extraneous and should be replaced with 1. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
CID 1141017 (#1-2 of 2): Resource leak (RESOURCE_LEAK) 14. leaked_handle: Handle variable fd going out of scope leaks the handle. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
CID 1141015 (#1 of 1): Resource leak (RESOURCE_LEAK) 8. leaked_handle: Handle variable fd going out of scope leaks the handle. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
CID 1141011 (#1 of 1): Double free (USE_AFTER_FREE) 24. double_free: Calling "free(void *)" frees pointer "ue" which has already been freed. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
The timeout can be exceeded during dumping and restoring. When we are testing snapshots, the test is dumped three times. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrew Vagin authored
In file included from arch/x86/crtools.c:11:0: include/ptrace.h:16:0: error: "PTRACE_LISTEN" redefined [-Werror] #define PTRACE_LISTEN 0x4208 ^ In file included from include/ptrace.h:5:0, from arch/x86/crtools.c:11: /usr/include/sys/ptrace.h:150:0: note: this is the location of the previous definition #define PTRACE_LISTEN PTRACE_LISTEN ^ cc1: all warnings being treated as errors make[1]: *** [arch/x86/crtools.o] Error 1 Signed-off-by:
Andrew Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
CID 1141012 (#1 of 1): Copy into fixed size buffer (STRING_OVERFLOW) 2. fixed_size_dest: You might overrun the 108 byte fixed-size string "addr.sun_path" by copying "service_address" without checking the length. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 20 Dec, 2013 18 commits
-
-
Pavel Emelyanov authored
Just a small mistake in prev patch. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrew Vagin authored
It's a feature of PTRACE_SEIZE. So we need to do something, only if we want to change the state. [xemul: If task _was_ in stopped state before dump and we want them to stay alive after dump, the existing code queues one more STOP to it. This affects subsequent dump, as we seize a stopped task with STOP in queue. One more item in TODO list -- support stopped tasks with STOP in queue :) ] Signed-off-by:
Andrew Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
Why we do several attempts to freeze tasks. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Kir Kolyshkin authored
Before this patch, backslash was at 81th column which makes the text twice longer on a standard 80 col terminal, which is quite annoying. Signed-off-by:
Kir Kolyshkin <kir@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Kir Kolyshkin authored
Remove whitespace at EOL (found by git grep ' $') (the character before $ is real tab, typed in shell using Ctrl+V Tab) To people using vim, I'd suggest adding the following code to ~/.vimrc: let c_space_errors = 1 highlight FormatError ctermbg=darkred guibg=darkred match FormatError /\s\+$\|\ \+\t\|\%80v.\|\ \{8\}/ Signed-off-by:
Kir Kolyshkin <kir@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Kir Kolyshkin authored
Since sd_listen_fds() doesn't set errno when returning a value > 1, it doesn't make sense to use pr_perror(). Use pr_err() instead. While at it, remove the period from the log message. [v2: fix function names] Signed-off-by:
Kir Kolyshkin <kir@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
Here is nothing interecting. If a file can't be dumped by criu, plugins are called. If one of plugins knows how to dump the file, the file entry is marked as need_callback. On restore if we see this mark, we execute plugins for restoring the file. v2: Callbacks are called for all files, which are not supported by CRIU. v3: Call plugins for a file instead of file descriptor. A few file descriptors can be associated with one file. v4: A file descriptor is opened in a callback. It's required for restoring anon vmas. v5: Add a separate type for unsupported files v6: define FD_TYPES__UNSUPP v7: s/unsupp/ext (external) Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
Here are client, server programs and two libraries for dumping client sockets and syslog socket. The client can ask server to save a value and then request it later. We suppose that after dumping and restoring the client will get the same value. So the dump callback requests the value and save it in a file. The restore callback creates a new socket and ask server to save the value from the file. v2: open a syslog socket Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
We don't know a state behind an external socket. It depends on logic of the program, which handles this socket. This patch adds ability to load a library with callbacks for dumping and restoring external sockets. This patch introduces two callbacks cr_plugin_dump_unix_sk and cr_plugin_restore_unix_sk. If a callback can not handle a socket, it must return -ENOTSUP. The main questions, what kind of information should be tranfered in these callbacks. Pls, think a few minutes about that and send me your opinion. v2: Use uflags instread of adding a new field v3: clean up v4: Unsuitable callbacks return -ENOTSUP. v5: set USK_CALLBACK, if a socket was dumped by callback. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
Unix sockets are dumped, when a peer socket is found. We are going to dump external sockets with help plugins. For the we need to set the USK_CALLBACK flags in unix entry. Currently a socket is dumped immediately when it's transfered, but we can be sure that a socket is not external, only when we have its peer. v2: add comments in code 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 add callback-s for dumping external sockets. All external sockets are added into unix_list, but for dumping we need to know all peers. And one more thing is that a socket is not closed before its peer is not be dumped. We are going to transfer the socket decriptor in the callback. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
We read /proc/pid/status to determine a task state, but if a task is running in this moment, its state may be changed. This patch stops tasks before reading their /proc/pid/status Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
Before this patch crtools freezes processes and if something is changed, it unfreezes all processes and starts again from the beginning. If if are going to dump fork-bomb, this method doesn't work. Because a big tree is always changed. We don't need unfreeze processes, which have been frozen and this patch does that. This patch uses depth-first search (DFS) for traversing a process tree. A root task is frozen at first turn, than a child is frozen, than a child of child and so on. When all children of one process are frozen, criu reads the list of children again and check that nothing changed. This processes continues until all of them will not be frozen. Afte that a new child can not be appeared, because all children for children are frozen too. v2: add comments in code Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
When we try to freeze threads, some of them can exit and a few new ones can be born. Currently we unfreeze process free int this case, so we have the same chance to failed in the next case. I suggest to not unfreeze frozen threads, just try to update thread list and freeze unfrozen threads. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Kir Kolyshkin authored
A warning catched by clang: > > mount.c:869:71: error: variable 'progress' is uninitialized when used here > > [-Werror,-Wuninitialized] > > ...prev, MNT_WALK_NONE, fn, (struct list_head *) NULL, progress); > > ^~~~~~~~ > > mount.c:802:4: note: expanded from macro 'MNT_TREE_WALK' > > _prgs++; > > \ > > ^ > > mount.c:867:14: note: initialize the variable 'progress' to silence this > > warning > > int progress; > > ^ > > = 0 > > 1 error generated. Signed-off-by:
Kir Kolyshkin <kir@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 19 Dec, 2013 6 commits
-
-
Andrey Vagin authored
A thread can create another threads, if the number of threads is less than the limit. This test case is very useful to check criu freezer. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
Currently all task are restored as alive, but stopped tasks must be restored as stopped. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
It is not needed, because stat is a property of task, so we can restore a state of task and it should be enough. 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
Libraries (plugins) is going to be used for dumping and restoring external dependencies (e.g. dbus, systemd journal sockets, charecter devices, etc) A plugin can have the cr_plugin_init() and cr_plugin_fini functions for initialization and deinialization. criu-plugin.h contains all things, which can be used in plugins. v2: rename lib to plugin v3: add a default value for a plugin path. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 18 Dec, 2013 5 commits
-
-
Andrey Vagin authored
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>
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Ruslan Kuprieiev authored
If restore fails on early stage(like no images in directory), then root_item might be uninitialized, so when we are trying to send response with root_item->pid criu crashes. Signed-off-by:
Ruslan Kuprieiev <kupruser@gmail.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Ruslan Kuprieiev authored
cr_dump_tasks() may return not only -1 on fail. Signed-off-by:
Ruslan Kuprieiev <kupruser@gmail.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-