Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/checkpoint-restore/criu.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-07-10travis: fix building on s390xwip/nested-namespaceswip/check-onlyAdrian Reber
The travis build for s390x started to fail with: Failed to fetch http://security.debian.org/debian-security/dists/jessie/updates/InRelease Unable to find expected entry 'main/binary-s390x/Packages' in Release file (Wrong sources.list entry or malformed file) This changes the repository definition just like it is done for ppc64le. Signed-off-by: Adrian Reber <areber@redhat.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-06-29Revert "Revert "travis: run test/other/rpc tests""Adrian Reber
This reverts commit 3abb6f5cd6a2d3056ed7ba372f8439ae4d66163d. This reverts the revert as the tests are now fixed. Signed-off-by: Adrian Reber <areber@redhat.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-06-29tests: fix builds on alpine and centosAdrian Reber
Install sudo, create test user with ID 1000, install bash, fix pidfile creation and pidfile chmod. v2: * use sleep to give the criu daemon some time to start up v3: * Andrei is of course right and sleep is not good solution. After adding --status-fd support to criu service, this is how we now detect that criu is ready. v4: * This was much more complicated than expected which is related to the different versions of the tools on the different travis test targets. There seems to be a bug in bash on Ubuntu https://lists.gnu.org/archive/html/bug-bash/2017-07/msg00039.html which prevents using 'read -n1' on Ubuntu. As a workaround the result from CRIU's status FD is now read via python. Another problem was discovered on alpine with the loop restore test. CRIU says to use setsid even if the process is already using setsid. As a workaround, still with setsid, this process is now using shell-job true for checkpoint and restore. Parts of v2 have been committed before. So the changes from this commit are partially already in another commit. Signed-off-by: Adrian Reber <areber@redhat.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-06-29criu service: support status-fdAdrian Reber
Make the --status-fd option also work in 'criu service' mode to avoid race conditions during testing. Signed-off-by: Adrian Reber <areber@redhat.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-06-29Add information about --ps-socket to usage information in crtools.cPawel Stradomski
Signed-off-by: Pawel Stradomski <pstradomski@google.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-06-29Add --ps-socket option to Documentation/criu.txtPaweł Stradomski
Signed-off-by: Pawel Stradomski <pstradomski@google.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-06-29Allow passing ps-socket file descriptor when launching criu.Pawel Stradomski
This makes it possible to have the pageserver communication go over anonymous unix sockets, e.g. created by socketpair(). Such setup makes it easier to secure pageserver connection by wrapping it in an encrypted tunnel. It also helps prevent attacks where a malicious process connects to page server and injects its own stream of pages to either fool criu into restoring wrong pages or to DoS the pageserver by having it exhaust local storage by writing large .img files. Signed-off-by: Pawel Stradomski <pstradomski@google.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-06-23Revert "travis: run test/other/rpc tests"Andrei Vagin
This reverts commit 5c26d8063923bdf4213c1e8a83157ac7beede88c. This test fails in Travis. Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-06-23unix: test, sk-unix01 -- Fix data sending for be machinesCyrill Gorcunov
Reported-by: Andrey Vagin <avagin@virtuozzo.com> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-06-23tests: fix builds on alpine and centosAdrian Reber
Install sudo, create test user with ID 1000, install bash, fix pidfile creation and pidfile chmod. v2: * use sleep to give the criu daemon some time to start up Signed-off-by: Adrian Reber <areber@redhat.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-06-22README.md correct travis linksDaniel Black
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-06-22net: veth -- Don't force to create master peer index if no nsidCyrill Gorcunov
In case if master peer of veth device is laying inside node root net-ns we should not request device index but rather allow the kernel to number it automatically. When there is separate net-ns for master peer it should be safe to request an index though. Signed-off-by: Cyrill Gorcunov <gorcunov@virtuozzo.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-06-22tests: others,rpc -- Tune up headerCyrill Gorcunov
- string.h is missed for memX helpers - fcntl.h should be included instead of sys With this patch the test-c is compiled on alpine tests, but there is a problem related to the container itself | protoc-c --proto_path=. --c_out=. rpc.proto | gcc -g -Werror -Wall -I. -c -o test-c.o test-c.c | gcc -g -Werror -Wall -I. -c -o rpc.pb-c.o rpc.pb-c.c | gcc test-c.o rpc.pb-c.o -lprotobuf-c -o test-c | protoc --proto_path=. --python_out=. rpc.proto | cp ../../../criu/criu criu | chmod u+s criu | mkdir -p build | chmod a+rwx build | sudo -g '#1000' -u '#1000' ./criu service -v4 -W build -o service.log --address criu_service.socket -d --pidfile pidfile | make: sudo: Command not found Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-06-22lib/c: add missing criu_local_set_service_binary signatureRonny Chevalier
Signed-off-by: Ronny Chevalier <ronny.chevalier@hp.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-06-22lib/c: add const qualifier to criu_set_service_binaryRonny Chevalier
service_binary is either set to a const char * (CR_DEFAULT_SERVICE_BIN) or to a user provided char *, but there is no reason to give a char *. Users of such function will most likely provide a const char *, that will generate a warning. Thus, we add the const qualifier to better represent the usage of service_binary, and avoid such warnings. Signed-off-by: Ronny Chevalier <ronny.chevalier@hp.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-06-20scripts/systemd-autofs-restart.sh: fix variable nameAdrian Reber
The script checks if $NSENTER is executable and sets $NS_ENTER if not. This seems to be a typo (once with '_' and once without). Untested and not reproducible. It just looks wrong. Signed-off-by: Adrian Reber <areber@redhat.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-06-20x86: cpu -- Proceed even if xsavec detected for dev reasonCyrill Gorcunov
Andrew reported that previously he been able to c/r even on the machine with xsavec enabled, so allow to process for now. P.S.I'm investigating the problem and to not block testing process lets permit passing with xsaves bit present. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-06-20zdtm.py: ignore unicode encode errorsPavel Tikhomirov
We have a problem after commit 212e4c771a1b ("test: make zdtm.py python2/python3 compatible") when running tests on python2: https://ci.openvz.org/job/CRIU/job/CRIU-virtuozzo/job/criu-dev/3804/console Traceback (most recent call last): File "./test/zdtm.py", line 2249, in <module> opts['action'](opts) File "./test/zdtm.py", line 2001, in run_tests launcher.run_test(t, tdesc, run_flavs) File "./test/zdtm.py", line 1680, in run_test self.wait() File "./test/zdtm.py", line 1737, in wait self.__wait_one(0) File "./test/zdtm.py", line 1725, in __wait_one print(open(sub['log']).read()) UnicodeEncodeError: 'ascii' codec can't encode character u'\u2018' in position 258: ordinal not in range(128) print does not like "‘" symbol in zdtm_static_cgroup04.log: ... rmdir: failed to remove ‘cgclean.sKFHLm/zdtmtst/special_prop_check’: No such file or directory Small reproducer: [snorch@snorch ~]$ cat test_ascii.py from __future__ import absolute_import, division, print_function, unicode_literals from builtins import (str, open, range, zip, int, input) f = open('./zdtm_static_cgroup04.log') s = f.read() print(s) [snorch@snorch ~]$ python test_ascii.py | grep "" Traceback (most recent call last): File "test_ascii.py", line 6, in <module> print(s) UnicodeEncodeError: 'ascii' codec can't encode character u'\u2018' in position 258: ordinal not in range(128) So just ignore these quote symbol when printing logs. Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-06-19unix: test -- Add sk-unix01 testCyrill Gorcunov
To test the case where sockets are removed together with directory they are living in. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-06-19unix: Improve debug message when collecting socketCyrill Gorcunov
Print its type and state. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-06-19unix: Add support of ghost socketsCyrill Gorcunov
Unix sockets may be connected via deleted socket name, moreover the name may be reused (ie same sun_addr but different inodes). To be able to handle them we do a few tricks: - when collecting sockets we figure out if "deleted" mark is present on the socket and if such we order this sockets creation and deletion with mutex, together with adding missing directories, and save this descriptors in fdstore if there are peers connected to - on restore we connect via procfs/fd/X as suggested by Andrew Vagin Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-06-19unix: Use decimal format for inode printingCyrill Gorcunov
For debug sake, to unify with helpers tools such as ss, stat and etc. Requested-by: Andrey Vagin <avagin@virtuozzo.com> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-06-19unix: Rename unlink_stale to unlink_skCyrill Gorcunov
We gonna use it to detele not only stale sockets but ghost sockets as well. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-06-19unix: Move unix_resolve_name declaration on topCyrill Gorcunov
This makes code more accurate. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-06-19unix: Unify id and ino printsCyrill Gorcunov
Most of them already in hex form, lets do the same for the rest. Also incoming connections are identified by inode number so use hex for them as well for consistency. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-06-19sockets: Add sock_type_name and tcp_state_name helpersCyrill Gorcunov
For readable printings. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-06-19travis: run test/other/rpc testsAdrian Reber
Signed-off-by: Adrian Reber <areber@redhat.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-06-19test/others/rpc: also run RPC version command via serviceAdrian Reber
This extends the test.py to also run the RPC command VERSION via 'criu service'. It was already running using 'criu swrk'. Signed-off-by: Adrian Reber <areber@redhat.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-06-19test/other/rpc: resurrect the RPC test casesAdrian Reber
In this directory there are various test cases using CRIU in RPC mode (or SWRK mode). This fixes the broken tests by moving the start of 'criu service' from run.sh to the Makefile as the test cases is running using "sudo -g '#1000' -u '#1000'" and the PID file created by CRIU can only be read by the root user. If starting the 'criu service' before run.sh the PID file still can be changed to 0666 and fixing the test script. This also adds version.py to the test cases that are executed. Signed-off-by: Adrian Reber <areber@redhat.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-06-19restore: do not kill restored process on failureAdrian Reber
While trying to resurrect the test cases in test/other/rpc one test case was checking for returned errors during restore failures. The process was dumping itself and while the process kept on running it tried to restore from that checkpoint. That should fail as the PID is in use of the process doing the test. CRIU, however, killed the test process during restore failure. This is the fix as proposed by Andrei Vagin on the CRIU mailing list. Signed-off-by: Adrian Reber <areber@redhat.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-06-18bitops: use a gcc builtin function instead of our __ffsAndrei Vagin
Our __ffs implementation is straightforward and non-optimal, __builtin_ffsl should be faster. Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-06-18x86: cpu -- Show which exactly features are failing in fpu capability modeCyrill Gorcunov
For easier understanding what is failed. Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-06-18x86: cpu -- Use rt information since it might we filteredCyrill Gorcunov
With new cpu-cap='op=noxsaves' mode on x86 we should use compel's instance of rt info since only it carries features masked. Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-06-18x86: cpu -- Add ability to ignore xsavesCyrill Gorcunov
Currently even if kernel supports compact xsave frame a user can disable it by passing noxsaves argument as a boot option. Thus cpuid instruction will report its presence but in real it gonna be masked from kernel pov. Lets do the same and allow a user to mask it via --cpu-cap=noxsaves option (valid for x86 only). Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-06-18compel: cpu -- Add ability to clear featuresCyrill Gorcunov
Will need them to mask some of the features from command line options. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-06-18x86: cpu -- Report when unsupported compact xsave frame detectedCyrill Gorcunov
We don't have yet support of compacted xsave frames so report error on cpu-check, checkpoint, restore actions. Basically it is done in cpu_init routine which is called in the sites we're interested in. Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-06-18x86: cpu -- Check for xsaves bit on cpu validationCyrill Gorcunov
Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-06-18x86: cpu -- Show additional xsave info on initCyrill Gorcunov
For debug sake. Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-06-18x86: cpu -- Add new instruction bits to checkCyrill Gorcunov
Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-06-18x86: cpu -- Sync bits with kernelCyrill Gorcunov
Tracking cpuid features is easier when sync'ed with kernel source code. Note though that while in kernel feature bits are not part of ABI, we're saving bits into an image so as result make sure they are posted in proper place together with keeping in mind the backward compatibility issue. Here we also start using v2 of cpuinfo image with more feature bits. Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-06-18crit: Show cpuinfo imageCyrill Gorcunov
Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-06-18x86: Use uint_x types in rt_sigcontextCyrill Gorcunov
To be close to the kernel code. Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-06-18zdtm/static/maps06: removed hardcoded page-sizeAdrian Reber
zdtm/static/maps06 failed on systems with different page-size than 4096. This changes maps06 to use sysconf(_SC_PAGESIZE) instead. Signed-off-by: Adrian Reber <areber@redhat.com> Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-06-18bitops: use the UL literal for constantsAndrei Vagin
We operate by long variables in out bit arithmetics, so our constants should be marked as long too. Cc: Adrian Reber <areber@redhat.com> Reported-by: Adrian Reber <areber@redhat.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com> Tested-by: Adrian Reber <areber@redhat.com> Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-06-18zdtm.py: exclude a vsyscall vma for x32 testsAndrei Vagin
We alwasy exclude vsyscall vma-s for x32 tests, but this part was broken by python3 patches. 1: Old maps lost: set([]) 1: New maps appeared: set([u"ffffffffff600000-ffffffffff601000 [u'r-xp']"]) Reported-by: Mr Jenkins Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-06-15lazy-pages: uffd_{copy, zeropage}: rework error handlingMike Rapoport
Improve code readability and take into account that even if uffdio_{copy,zeropage} has failed, some pages had been updated. Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-06-15zdtm/lib: don't close bad criu_status_in file descriptor in signal handlerMike Rapoport
The criu_status_in is not always used and it may be -1 when the signal handler closes it. With lazy-pages we hit a corner case which clobbers the errno value. This happens when we resume the process inside glibc syscall wrapper and get the signal before the page containing errno is copied. In this case, signal handler is invoked before the syscall return value is written to errno and the actual value of errno seen by the process becomes -EBADF because of close(-1) in the signal handler. Let's ensure that close() in signal handler does not fail to make Jenkins happier while the proper solution for the lazy-pages issue is found. Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-06-14image: Add missing newlines to warn messageCyrill Gorcunov
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-06-14sfd: Don't forget to test sfd_map when closing old fdsCyrill Gorcunov
is_any_service_fd didn't check for service file descriptor being marked in sfd_map in result we may end up leaving some garbage file obtained from the program executing criu. [root@sqvm0910 criu-stable.git]# ll /proc/354877/fd lr-x------ 1 root root 64 May 16 19:03 114 -> / lr-x------ 1 root root 64 May 16 19:03 115 -> / l--------- 1 root root 64 May 16 19:03 117 -> /18311 (deleted) lr-x------ 1 root root 64 May 16 19:03 119 -> /vzt/del/vzctl-rm-me.X1JH4vI (deleted) We are to test if the file descriptor was indeed installed explicitly. https://jira.sw.ru/browse/PSBM-83892 Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-06-14remote: Remove unused constantsRadostin Stoyanov
Drop the constants for default cache host/port and page size because they are not used anywhere. Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com> Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>