- 09 Jul, 2018 40 commits
-
-
Pavel Tikhomirov authored
We want to use a simple fact: If we have an alive process in a pstree we want to dump, and a starttime of that process is less than pre-dump's timestamp (taken while all processes were freezed), then these exact process existed (100% sure) at the time of these pre-dump and the process' memory was dumped in images. So save inventory image on pre-dump and put there an uptime. https://jira.sw.ru/browse/PSBM-67502 v9: improve comment, put uptime to ivnentory image as 1) where is no stats in parent images directory if --work-dir option is set to something different then images directory, 2) stats-dump is not an image and it is a bad practice to put there data required for restoring. v10:s/u_int64_t/uint64_t/ Signed-off-by:
Pavel Tikhomirov <ptikhomirov@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Pavel Tikhomirov authored
will be used in the next patch https://jira.sw.ru/browse/PSBM-67502 note: man for /proc/uptime says that uptime is in seconds and for now the format is "seconds.centiseconds", where ecentiseconds is 2 digits note: now uptime is in csec but I prefer saving it in usec, that allows us to be reuse these image field when/if we have more accurate value. v8: add length specifier to parse only centiseconds v9: put uptime to u_int64_t directly, define CSEC_PER_SEC v10: switch to uint64_t from u_int64_t, comment about usec in image Signed-off-by:
Pavel Tikhomirov <ptikhomirov@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Pawel Stradomski authored
Signed-off-by:
Pawel Stradomski <pstradomski@google.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Paweł Stradomski authored
Signed-off-by:
Pawel Stradomski <pstradomski@google.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Pawel Stradomski authored
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>
-
Cyrill Gorcunov authored
Reported-by:
Andrey Vagin <avagin@virtuozzo.com> Signed-off-by:
Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Daniel Black authored
Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Cyrill Gorcunov authored
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>
-
Cyrill Gorcunov authored
- 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>
-
Ronny Chevalier authored
Signed-off-by:
Ronny Chevalier <ronny.chevalier@hp.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Ronny Chevalier authored
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>
-
Adrian Reber authored
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>
-
Pavel Tikhomirov authored
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>
-
Cyrill Gorcunov authored
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>
-
Cyrill Gorcunov authored
Print its type and state. Signed-off-by:
Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Cyrill Gorcunov authored
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>
-
Cyrill Gorcunov authored
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>
-
Cyrill Gorcunov authored
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>
-
Cyrill Gorcunov authored
This makes code more accurate. Signed-off-by:
Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Cyrill Gorcunov authored
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>
-
Cyrill Gorcunov authored
For readable printings. Signed-off-by:
Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Adrian Reber authored
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>
-
Andrei Vagin authored
Our __ffs implementation is straightforward and non-optimal, __builtin_ffsl should be faster. Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Cyrill Gorcunov authored
Reviewed-by:
Dmitry Safonov <0x7f454c46@gmail.com> Signed-off-by:
Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Cyrill Gorcunov authored
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>
-
Adrian Reber authored
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>
-
Andrei Vagin authored
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>
-
Andrei Vagin authored
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>
-
Mike Rapoport authored
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>
-
Cyrill Gorcunov authored
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-83892Signed-off-by:
Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Andrei Vagin authored
test/zdtm.py:1238:3: F821 undefined name 'raw_input' v2: ask to press enter, not just any key Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Adrian Reber authored
I am regularly running zdtm.py after updating the CRIU rpm to test if the new rpm still works. Until know I usually did: -criu_bin = "../criu/criu" -crit_bin = "../crit/crit" +criu_bin = "/usr/sbin/criu" +crit_bin = "/usr/bin/crit" This commit adds two arguments to zdtm.py: --criu-bin CRIU_BIN Path to criu binary --crit-bin CRIT_BIN Path to crit binary It still defaults to the old values from above, but can now easily be changed to the CRIU binary provided by the packaging system. This change was more complicated than expected which is probably related to the fact that zdtm restarts itself in namespaces. v2: - rebase v3: - fix errors reported by 'make lint' Signed-off-by:
Adrian Reber <areber@redhat.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Dmitry Safonov authored
check_tun_netns_cr() should return 0 on CONFIG_TUN=n kernels. That is, when we fail to open tun device. Fixes: #496 Signed-off-by:
Dmitry Safonov <dima@arista.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Andrei Vagin authored
test/dump/zdtm/static/msgque/43/1/ipcns-msg-12.img decode fails: object of type 'NoneType' has no len() Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Adrian Reber authored
Running the test suite on aarch64 showed two tests failing (static/fd and transition/maps0007). Debugging showed that the atomic_{sub,add}_return() functions did not return the value but the lower 32bit of the address of that value. Simply dereferencing the input solves the two mentioned test cases. Signed-off-by:
Dmitry Safonov <dima@arista.com> Signed-off-by:
Adrian Reber <areber@redhat.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Dmitry Safonov authored
Syscalls do return negative value in case of an error. But errno contains the error code itself. Add uint32_t to sys_futex() definition. sizeof(unsigned int) might be not 4 bytes. Signed-off-by:
Dmitry Safonov <dima@arista.com> Signed-off-by:
Adrian Reber <areber@redhat.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Andrei Vagin authored
Send pre-dump notify to 36 Traceback (most recent call last): File "zdtm.py", line 2161, in <module> do_run_test(tinfo[0], tinfo[1], tinfo[2], tinfo[3]) File "zdtm.py", line 1549, in do_run_test cr(cr_api, t, opts) File "zdtm.py", line 1264, in cr test.pre_dump_notify() File "zdtm.py", line 490, in pre_dump_notify fdin.write(struct.pack("i", 0)) TypeError: write() argument 1 must be unicode, not str Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Radostin Stoyanov authored
Signed-off-by:
Radostin Stoyanov <rstoyanov1@gmail.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Andrei Vagin authored
Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Andrei Vagin authored
On Alpine Linux, libxt_standard.so is installed in /usr/lib/xtables/ Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-