- 17 Oct, 2017 40 commits
-
-
Pavel Emelyanov authored
In SCM code there will be the need to attach a newly created FdinfoEntry to a particulat file desc object, then get the created fdinfo helper object back. Current code only allows this via two lookup calls -- first one to attach entry to desc by ID (lookup #1), then get the fdinfo helper by FD (lookup #2). Fortunately, the exising code allows simple split that gives us the optimized routine. Reviewed-by:
Kirill Tkhai <ktkhai@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Pavel Emelyanov authored
In SCM patch we'll need to generate temporary fdinfo entry for a task that will send descriptors via sockets. Sometimes the files in questions will NOT have any other fdinfo-s (if they are SCM-sent and closed), so we need a helper that would either give us existing fdinfo or say there's no such. Reviewed-by:
Kirill Tkhai <ktkhai@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Pavel Emelyanov authored
An aux code to dump the received file and report back its ID and type. Reviewed-by:
Kirill Tkhai <ktkhai@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Pavel Emelyanov authored
Actually all file-s we dump have unique IDs, regardless of their types. This fact will be used to reduce complexity of the SCM code -- instead of keeping TYPE:ID pair it'll save only the ID. Siad that -- we will need the way to lookup desc by ID only. v2: Older images had fifo-s and tty-s having matching IDs with respective reg-file entries Reviewed-by:
Kirill Tkhai <ktkhai@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Pavel Emelyanov authored
To support SCMs we'll need to receive them into criu task (see the SCM patch for details), then dump the received file as if it was in the dumpee. Then the info about received descriptor will be written into packet entry. For this we'll need to perform all the regular file dumping code BUT not write the FdinfoEntry into image, so shuffle the code for that. The gist of the patch is in two changes -- one in the do_dump_gen_file(), the other in dump_task_files_seized(). The rest is just tossing the arguments of the functions relevant to that change. Reviewed-by:
Kirill Tkhai <ktkhai@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Pavel Emelyanov authored
Same thing as for fifo-s. Reviewed-by:
Kirill Tkhai <ktkhai@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Pavel Emelyanov authored
The plan is to have all file entries have unique ID. Fifo generates a reg file entry to reuse the whole reg-files c/r-ing engine (ghosts, open-by-path, etc.) and right now ID for this entry is the same as for fifo entry. Reviewed-by:
Kirill Tkhai <ktkhai@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Pavel Emelyanov authored
SCM-dumping code won't provide the ctl for TTY dump. To make this work we'll have to peek required tty info from current (see the SCM patch), but I doubt that anyone sends TTYs via sockets ... so keep this in TODO list. Reviewed-by:
Kirill Tkhai <ktkhai@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Pavel Emelyanov authored
Only the send code is altered, as upon receiving kernel merges all scm_rights int one. CRIU relies on this merge and this is to catch situations if the kernel suddenly stops doing this. Reviewed-by:
Kirill Tkhai <ktkhai@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Pavel Emelyanov authored
Reviewed-by:
Kirill Tkhai <ktkhai@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Pavel Emelyanov authored
Reviewed-by:
Kirill Tkhai <ktkhai@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Pavel Emelyanov authored
Reviewed-by:
Kirill Tkhai <ktkhai@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Kirill Tkhai authored
This will be used in further to determine whether task's namespace allows to restore file_desc. Signed-off-by:
Kirill Tkhai <ktkhai@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Kirill Tkhai authored
Keep int pid with short-len fields to avoid alignment gaps in structure. Signed-off-by:
Kirill Tkhai <ktkhai@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Kirill Tkhai authored
The algorhythm of searching file master will be more complicated in next patches. So, move current functionality in separate func. Signed-off-by:
Kirill Tkhai <ktkhai@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Kirill Tkhai authored
Signed-off-by:
Kirill Tkhai <ktkhai@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Kirill Tkhai authored
The only user is fifo, but it uses collect_fd() to do read only actions (the only change is fifo_info::reg_d population, which may be easily moved to open_fifo_fd()). So, move the collect_special_file() functionality from collect_fifo_fd() to open_fifo_fd() and kill collect_fd method at all. Signed-off-by:
Kirill Tkhai <ktkhai@virtuozzo.com>
-
Kirill Tkhai authored
Add new argument to this function. Signed-off-by:
Kirill Tkhai <ktkhai@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Kirill Tkhai authored
Declare it extern and allow to use outside files.c. Signed-off-by:
Kirill Tkhai <ktkhai@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Kirill Tkhai authored
On 01.06.2017 14:34, Kirill Tkhai wrote: > Everything is prepared: the pair "type and id" is > uniqul, so find_file_desc() in collect_fd() will > work as expected and it will find the file_desc > we just added in autofs_create_pipe()->collect_one_pipe_ops(). > > So, the not-generic helper may be killed. > > Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com> Returned debug print: [PATCH 4/5 v2]files: Kill autofs_create_fle() and use generic helper Everything is prepared: the pair "type and id" is uniqul, so find_file_desc() in collect_fd() will work as expected and it will find the file_desc we just added in autofs_create_pipe()->collect_one_pipe_ops(). So, the not-generic helper may be killed. v2: Leave debug print on the place. Signed-off-by:
Kirill Tkhai <ktkhai@virtuozzo.com> Acked-by:
Stanislav Kinsburskiy <skinsbursky@virtuozzo.com> Acked-by:
Stanislav Kinsburskiy <skinsbursky@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Kirill Tkhai authored
shmalloc() already returns address with sizeof(unsigned long) alignment. So, the second alignment is useless. Signed-off-by:
Kirill Tkhai <ktkhai@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Kirill Tkhai authored
Allow to mark some fles as "fake" and close them, when they are not needed. v2: Cache fake file in separate list, when they are restored, to do not iterate over files list again. Signed-off-by:
Kirill Tkhai <ktkhai@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Kirill Tkhai authored
Signed-off-by:
Kirill Tkhai <ktkhai@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Kirill Tkhai authored
It has only one user. Also, in next patches will be used pstree_item_by_virt() function, and I don't want to add "#include" to "files.h" for it, and to nest headers. Signed-off-by:
Kirill Tkhai <ktkhai@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Kirill Tkhai authored
Fake masters are files, which are not owned by a process, that is able to open them. Signed-off-by:
Kirill Tkhai <ktkhai@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Pavel Emelyanov authored
Due to a misprint in an if the 6rd info for sit device was restored when not present. https://github.com/xemul/criu/issues/366Signed-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>
-
Pavel Emelyanov authored
Same here -- prepare the IFLA_INFO_DATA section using the date from SitEntry. Issue #11 Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Pavel Emelyanov authored
Nothing special here, just parse all known NLAs and keep them on the image. Issue #11 Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Andrei Vagin authored
This flag is reseted each time when uid-s, gid-s or capabilities are changed. ------------------------ grep Error ------------------------ (00.235109) 6: Opening 0x002ad2fb7a1000-0x002ad2fb7a2000 0000000000000000 (101) vma (00.235115) 6: Search for 0x002ad2fb7a1000 shmem 0x3ec72 0x2b9ac74058c0/5 (00.235119) 6: Waiting for the 3ec72 shmem to appear (00.235122) 6: Opening shmem [/proc/5/fd/6] (00.235153) 6: Error (criu/shmem.c:453): Can't open 5/fd/6 on procfs: Permission denied (00.235171) 6: Error (criu/mem.c:1200): `- Can't open vma (00.283466) uns: calling exit_usernsd (-1, 1) (00.283521) uns: daemon calls 0x47f6b0 (189, -1, 1) (00.283532) uns: `- daemon exits w/ 0 (00.289212) uns: daemon stopped (00.289232) Error (criu/cr-restore.c:2152): Restoring FAILED. ------------------------ ERROR OVER ------------------------ Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Andrei Vagin authored
page_ids is a global variable and it is used to dump shared memroy, process memory and ipc shared memory. The problem is that an IPC namespace is dumped in a child process, so page_ids isn't changed in a parent process. This patch is a quick workaround this issue. Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Andrei Vagin authored
Currently test_daemon() sends a signal to a parent process, when a test completed a prepartion stage. But it doesn't work, if a child changed uid and gid, because it doesn't have enough permissions in this case. This patch reworks a synchronization scheme to use a futex instead of sending signals. Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Cyrill Gorcunov authored
Wait for thread to finish its creation instead of calling sleep. Same time call for test_daemon only when we're ready. CC: Vitaly Ostrosablin <vostrosablin@virtuozzo.com> Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Cyrill Gorcunov authored
CC: Vitaly Ostrosablin <vostrosablin@virtuozzo.com> Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Andrei Vagin authored
It is known issue that a vsyscall vmas are not unmapped from x32 processes. Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Andrei Vagin authored
If a process calls BUG(), it genereates a core file and we get a false warning from abrtd. Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Andrei Vagin authored
For us it doesn't matter what names of users and groups are used, we want to be sure that we restore right uid-s and gid-s. If we use these functions, we can't run tests in namespaces and they use an external unix socket, what can be a problem too. sk unix: Runaway socket: ino 0x1df1ae4 peer_ino 0x1df1ae3 family 1 type 1 state 1 name /run/dbus/system_bus_socket Error (criu/sk-unix.c:712): sk unix: External socket is used. Consider using --ext-unix-sk option. Cc: Vitaly Ostrosablin <vostrosablin@virtuozzo.com> Cc: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com> Acked-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Andrei Vagin authored
so that .gcda (coverage data) files are created with read-write permissions for all, otherwise uns tests will not be able to modify these files and code coverage data will not be collected for them. Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Andrei Vagin authored
This test create a closed socket with a non-empty sent queue. Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Andrei Vagin authored
If a connection was reseted, it can have some data in a sent queue, a use can't read this data, so we can ignore them too. https://jira.sw.ru/browse/PSBM-67026Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-