- 30 Oct, 2018 40 commits
-
-
Pavel Tikhomirov authored
call variables of type RemapFilePathEntry - "rpe" everywhere, similar as we already name them in oher places while on it remove unused second argument of open_remap_linked Signed-off-by:
Pavel Tikhomirov <ptikhomirov@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Andrei Vagin authored
./test//zdtm.py --set inhfd run --all --rpc Cc: Adrian Reber <areber@redhat.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Pavel Tikhomirov authored
After running criu test, docker on the node becomes unusable, as it is confused by our leftover cgroups. Surely docker should be fixed to ignore custom cgroups (https://github.com/moby/moby/issues/37601), but we should not leave them after test also. v2: rmdir the holder only if it exists, remove racy wait and remove wrongly added cleanup method in class criu v3: bring back missed semicolon Signed-off-by:
Pavel Tikhomirov <ptikhomirov@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Cyrill Gorcunov authored
When checkpointing applications with really big memory slab (like in our vz7 test with 920G of memory) the int type get cutted, we should use long int instead, just like we do in other code pieces. Otherwise get | pie: 756: Daemon waits for command | (01.193097) Wait for ack 12 on daemon socket | (01.193112) Fetched ack: 12 12 0 | (01.193164) 988065 fdinfo 0: pos: 0 flags: 100002/0 | (01.193201) fdinfo: type: 0xb flags: 0100002/0 pos: 0 fd: 0 | (01.193279) 988065 fdinfo 1: pos: 0 flags: 100002/0 | (01.193307) fdinfo: type: 0xb flags: 0100002/0 pos: 0 fd: 1 | (01.193341) 988065 fdinfo 2: pos: 0 flags: 100002/0 | (01.193365) fdinfo: type: 0xb flags: 0100002/0 pos: 0 fd: 2 | (01.193375) ---------------------------------------- | (01.193405) Error (criu/parasite-syscall.c:243): BUG at criu/parasite-syscall.c:243 | pie: 756: Error (criu/pie/parasite.c:676): Trimmed message received (1> Signed-off-by:
Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Cyrill Gorcunov authored
In case if pipe buffers are full the splicing may wakeup reader first with incomplete data transfer. Thus splice data in cycle. Signed-off-by:
Cyrill Gorcunov <gorcunov@gmail.com> Acked-by:
Mike Rapoport <rppt@linux.vnet.ibm.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Pavel Tikhomirov authored
05:57:35.640: 1238: FAIL: fork.c:80: Task 16275 didn't exit (errno = 10 (No child processes)) There is no info about the killing signal in logs, add it. https://jira.sw.ru/browse/PSBM-87579Signed-off-by:
Pavel Tikhomirov <ptikhomirov@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Cyrill Gorcunov authored
Integer is too small for big memory slabs. Signed-off-by:
Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Pavel Tikhomirov authored
Signed-off-by:
Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
-
Mike Rapoport authored
Signed-off-by:
Mike Rapoport <rppt@linux.vnet.ibm.com>
-
Mike Rapoport authored
Signed-off-by:
Mike Rapoport <rppt@linux.vnet.ibm.com>
-
Mike Rapoport authored
The stack pointers will be later use by the memory dump to ensure that current stack pages are not treated as lazy. Signed-off-by:
Mike Rapoport <rppt@linux.vnet.ibm.com>
-
Mike Rapoport authored
Currently parasite_thread_ctl for non-leader threads is initialized after we stop the compel daemon. Moving this initialization earlier will allow us to make stack pointers of all threads available during memory dump. Signed-off-by:
Mike Rapoport <rppt@linux.vnet.ibm.com>
-
Mike Rapoport authored
Signed-off-by:
Mike Rapoport <rppt@linux.vnet.ibm.com>
-
Mike Rapoport authored
We need to know what are stack pointers of every thread to ensure that the current stack page will not be treated as lazy. Signed-off-by:
Mike Rapoport <rppt@linux.vnet.ibm.com> Acked-by:
Alice Frosi <alice@linux.vnet.ibm.com> Reviewed-by:
Laurent Dufour <ldufour@linux.vnet.ibm.com>
-
Adrian Reber authored
Signed-off-by:
Adrian Reber <areber@redhat.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Adrian Reber authored
This is obviously not a real check. This only exists, so that CRIU clients/users can check if this CRIU version supports the external network namespace feature. Theoretically the CRIU client or user could also parse the version, but especially for CLI users version comparison in the shell is not easy. This feature check does not exist for RPC as RPC has a special version call which does not require string parsing and the external network namespace feature is available for all CRIU versions newer than 3.9. Signed-off-by:
Adrian Reber <areber@redhat.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Radoslaw Burny authored
Since the processes and fds are restored from images in the increasing order, and they are stored in sorted lists, CRIU always needed (at least in my experiments) to traverse the whole list before inserting them. With this change, lists are traversed in reverse, so the fds should be inserted immediately. Acked-by:
Kirill Tkhai <ktkhai@virtuozzo.com> Signed-off-by:
Radoslaw Burny <rburny@google.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Adrian Reber authored
The latest patches to cr-service.c broke compilation with gcc-8: criu/cr-service.c: In function ‘setup_opts_from_req’: criu/cr-service.c:323:3: error: ‘strncpy’ specified bound 4096 equals destination size [-Werror=stringop-truncation] strncpy(images_dir_path, opts.imgs_dir, PATH_MAX); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ criu/cr-service.c:343:3: error: ‘strncpy’ specified bound 4096 equals destination size [-Werror=stringop-truncation] strncpy(work_dir_path, opts.work_dir, PATH_MAX); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors This fixes the errors by specifying the strncpy() size as 'PATH_MAX - 1'. Signed-off-by:
Adrian Reber <areber@redhat.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Adrian Reber authored
With this commit it is possible to specify a configuration file via RPC. In python this would look like this: req.opts.config_file = 'path/to/config_file' With this commit CRIU's configuration file handling works like this: * apply_config(global_conf) * apply_config(user_conf) * apply_config(environment variable) * apply_config(config file via CLI) * apply_rpc_options() or apply_cli_options() * apply_config(rpc_conf) (only for RPC) This is at least (probably) the third iteration of the RPC configuration file code and it still is complicated. Most CRIU options are correctly used by just writing the new values to the corresponding fields of the opts structure. For the RPC case there are, however, a few options (output, work_dir, imgs_dir) which need special handling. So the RPC configuration file is parsed twice. First time to get output, work_dir and imgs_dir. Once those are read and correctly used, the RPC code overwrites all options again by values set by the RPC interface. At the end the RPC configuration file is read a second time and finally overwrites the values set via RPC. Signed-off-by:
Adrian Reber <areber@redhat.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Adrian Reber authored
This test checks the following things: * Does configuration file parsing work at all. * Does the parser detect wrong options. * Does the configuration file work via RPC. * Do the configuration file options not overwrite the RPC settings in the default setup. * Is it possible to tell CRIU to prefer the configuration file via RPC. Signed-off-by:
Adrian Reber <areber@redhat.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Adrian Reber authored
When CRIU is started in RPC mode ('criu swrk') it used to ignore all command-line options and configuration files. This moves the jump to RPC mode after the configuration file parsing to enable configuration. With this configuration files are now also evaluated in RPC mode and it is possible to change the behavior of CRIU via the configuration file if used via RPC. Signed-off-by:
Adrian Reber <areber@redhat.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Adrian Reber authored
With this it is possible to point the environment variable CRIU_CONFIG_FILE to a CRIU configuration file. The order the configuration files are evaluated now is: 1. global (/etc/criu/default.conf) 2. user ($HOME/.criu/default.conf) 3. CRIU_CONFIG_FILE 4. --config FILENAME 5. CLI Signed-off-by:
Adrian Reber <areber@redhat.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Adrian Reber authored
With the previous change to dynamically allocate memory for each possible configuration source (three different configuration files, CLI, RPC) the char * options can no longer directly point to the character strings extracted by getopt() as the memory might be free'd at some point. This introduces a macro to set the char * options which first does a xfree() and then a xstrdup(). Signed-off-by:
Adrian Reber <areber@redhat.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Adrian Reber authored
The code to read and parse configuration files was writing the result of the global configuration file to one variable and the result from the configuration file in the user's home to another variable: char **global_conf = NULL; char **user_conf = NULL; With this change the code now uses dynamic memory allocation to handle the different configuration files. It used to be: * parse global config * parse user config * evaluate global config * evaluate user config * evaluate CLI And now it is: * parse global config * evaluate global config * parse user config * evaluate user config * evaluate CLI This change is in preparation for the upcoming setting of a configuration file via environment variable and RPC configuration file usage. Signed-off-by:
Adrian Reber <areber@redhat.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Adrian Reber authored
This just moves the functions init_opts() and deprecated_ok() also to config.c as that is where most of the option and configuration setup and handling is done today. Signed-off-by:
Adrian Reber <areber@redhat.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Adrian Reber authored
The variable show_dump_file and show_fmt are assigned but never used, this remove the assignment. The CLI option still exists to not break the user interface. It exists, but it is unused. Signed-off-by:
Adrian Reber <areber@redhat.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Adrian Reber authored
This removes the code around '--pid, -p' which is not used at all. The command-line option is still available to not break CRIU users, but as the result has not been used, just remove the code assigning it. Signed-off-by:
Adrian Reber <areber@redhat.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Adrian Reber authored
This moves the whole getopt setup and analysis out of main() into its own function in config.c. The main motivation for this change is to be able to call getopt parsing and configuration file parsing also from the RPC code path. In one of the discussion emails about configuration files in CLI and RPC mode the following architecture was proposed: apply_config(global_conf) apply_config(user_conf) apply_config(pre_conf) parse_command_line() apply_rpc_options() apply_config(post_conf) And especially for the last step the getopt parsing needs to be out of main() and callable from the RPC code path. Signed-off-by:
Adrian Reber <areber@redhat.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Andrei Vagin authored
CC criu/cr-restore.o criu/cr-restore.c:3470:22: error: address of array 'thread_args[i].comm' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion] if (thread_args[i].comm) ~~ ~~~~~~~~~~~~~~~^~~~ 1 error generated. Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Andrei Vagin authored
This reverts commit 8f1ba5892dd2b137a24e144febed2464f245ed1a. This test doesn't work right now: =[log]=> dump/zdtm/transition/maps007/174/3/restore.log ------------------------ grep Error ------------------------ (00.237564) 1: `- FD 2 pid 6 (00.237566) 1: `- type 1 ID 0xa (00.237567) 1: `- FD 3 pid 5 (00.237568) 1: `- FD 3 pid 6 (00.240025) 1: Error (criu/image.c:432): Unable to open pages-3.img: Permission denied (00.270600) uns: calling exit_usernsd (-1, 1) (00.270640) uns: daemon calls 0x469f80 (199, -1, 1) (00.270648) uns: `- daemon exits w/ 0 (00.271193) uns: daemon stopped (00.271199) Error (criu/cr-restore.c:2308): Restoring FAILED. ------------------------ ERROR OVER ------------------------ Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Andrei Vagin authored
Fixes: e8f913fbfd9d ("unix: check that a length of a socket is less than UNIX_PATH_MAX") Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Andrei Vagin authored
Reported-by:
志平 林 <larry.lin@outlook.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Andrei Vagin authored
CID 190774 (#1 of 1): Out-of-bounds access (OVERRUN) 5. overrun-buffer-arg: Overrunning array addr.sun_path of 108 bytes by passing it to a function which accesses it at byte offset 4094 using argument ui->ue->name.len (which evaluates to 4095). Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Andrei Vagin authored
CID 190775 (#1 of 1): Dereference before null check (REVERSE_INULL) check_after_deref: Null-checking m->parent suggests that it may be null, but it has already been dereferenced on all paths leading to the check. Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Andrei Vagin authored
CID 190777 (#1 of 1): Resource leak (RESOURCE_LEAK) 15. leaked_handle: Handle variable server_fd going out of scope leaks the handle. Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Adrian Reber authored
Signed-off-by:
Adrian Reber <areber@redhat.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Cyrill Gorcunov authored
The host compel-host-bin must be built before criu, same time the criu itself should not depend on libcompel or plugins because they are the part of the compel package. Signed-off-by:
Cyrill Gorcunov <gorcunov@gmail.com> Reviewed-by:
Dmitry Safonov <0x7f454c46@gmail.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Cyrill Gorcunov authored
They were occasionally kept in obj-y. Signed-off-by:
Cyrill Gorcunov <gorcunov@gmail.com> Reviewed-by:
Dmitry Safonov <0x7f454c46@gmail.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Cyrill Gorcunov authored
Thus to choose which deps to include, for example if only particular file is being build there is no need to include any other deps. Signed-off-by:
Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Cyrill Gorcunov authored
Signed-off-by:
Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-