- 27 Dec, 2013 2 commits
-
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
The -F|--fields option specifies which fields (by name, comma separated) should be printed. For nested fields all names in path should be specified. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 26 Dec, 2013 22 commits
-
-
Andrey Vagin authored
Modern tar and rsync can replace zero chunks with holes. So it's valid situation and shouldn't abort the restore. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
One note -- the macvlan's index _does_ change. We should either patch iproute2 or use raw kernel API to preserve it. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Well, when we create external link with ip utility we cannot specify its index. Thus we will not be able to move external device to namespace and ask criu to restore link params. However, RTM_SETLINK can happily work with the link name only. And since we do have one in the images, we can omit setting the index in the requrest. TODO: Send patch with index specification to iproute2. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
We should call external scripts when namespaces are created, but before we try to fill them with data from images. This is done so e.g. to make it possible to push external net links to netns. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
If we meet a link we cannot dump we call plugin to check whether it's the link, that should be treated as external. Note, that on restore we don't call any plugins, but consider the setup-namespace script to move the respective link into the namespace. Links are not hierarchical and can be moved between namespaces easily, so it's OK to delegate the link creation to the script. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
For now this "dumping" is just a warning. In the next patches there will be call to plugins. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
To make it look symmetrical to over types dumping. And for simpler further patching. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
If the former file had a path long enough to be near PATH_MAX limit, sprintf'ing link_remap.%d here might overrun the limit. Use snprintf instead. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
The expression in if () becomes quite complex and deserves a helper with proper explanation of what's going on. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrew Vagin authored
Use the format specifier %zu instead of %lu to print a size_t integer. 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>
-
Pavel Emelyanov authored
It's not freed anywhere. Makes code look simpler. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
All the entries with with_plugin set will be mounted by plugin. The interesting case is when we do the pivot-root restore. In this case we call restore callback very early (before we unmount the old tree) and ask it to create the mountpoint at temporary location. Later we move the mount to proper place. The old_root argument of the callback is where it can find files in the original mount namespace. The is_file is return-argument. Sine files and directories cannot be bind-mounted to each-other, the callback should create the mountpoint itself and report whether it created file or directory. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
External bind mounts are those with source sitting outside of the current FS view. Such are detected in validate_mounts(), so we just go ahead and call plugins. The plugin is provided with the mountpoint to decide whether it's his or not (what else does the guy need?) and an ID with this it can identify the mountpoint in /proc. The same ID will be used at restore time to find the needed restore info. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
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 9 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>
-