2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-28 12:57:57 +00:00

5853 Commits

Author SHA1 Message Date
Pavel Emelyanov
65408e927f page-read: Fix compilation on arm (2)
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-11-12 23:51:15 +03:00
Pavel Emelyanov
efb31988ec page-read: Fix compilation on arm
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-11-12 23:27:57 +03:00
Andrey Vagin
a9e5d2b417 jenkins: fix path to report
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-11-12 22:32:06 +03:00
Andrew Vagin
25eb3d6db2 jenkin: mark all scripts as executalbe
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-11-12 20:59:07 +03:00
Pavel Emelyanov
a6cb3d782d jenkins: Do not test cgroup02 with --norst
This test expects that it _will_ be C/R-ed into new hierarchy

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-11-12 17:16:52 +03:00
Pavel Emelyanov
127152268a jenkins: Make criu-snap test use zdtm.py
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-11-12 18:11:38 +04:00
Pavel Emelyanov
cc378b909a jenkins: Make criu-dump test use zdtm.py
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-11-12 18:01:37 +04:00
Pavel Emelyanov
dc00fea333 net: Dont print error in rule save
This thing is new and can be absent in ip tool, which is OK
and is handled by net.c code itself.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-11-12 16:31:21 +03:00
Pavel Emelyanov
336b990995 net: Add flags to run_ip_tool
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-11-12 16:31:20 +03:00
Pavel Emelyanov
18d9170858 util: Add flags to cr_system
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-11-12 16:31:19 +03:00
Pavel Emelyanov
e5a91658c5 zdtm: Do not create dangling executables
Otherwise they are left after test and make zdtm.py list thing
these files are tests too.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-11-12 16:30:44 +03:00
Pavel Emelyanov
9a366728bc zdtm: Make /dev/net/tun optional device in test ns
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-11-12 16:30:44 +03:00
Andrew Vagin
79be3677bc zdtm: don't execute the bridge test from zdtm.sh
zdtm.sh doesn't suppport dependencies. This test uses the ip tool.

Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-11-12 16:24:04 +03:00
Pavel Emelyanov
37ec967643 jenkins: Move pre-dump test on .py launcher
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-11-12 15:58:44 +03:00
Pavel Emelyanov
7d72537dbd page-read: Properly handle overlapping pagemaps in stack
If the pagemap we read at some point covers two (or more) pagemaps
in parent images, we cannot just call the parent page read for all
those pages. Instead, we must call parent page read with shorter
requests so that it handles its own pagemaps properly.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-11-12 15:58:43 +03:00
Andrew Vagin
87c0376b60 zdtm: execute the bridge test in a new netns only
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-11-12 15:25:24 +03:00
Pavel Emelyanov
446a8ba857 jenkins: Exclude maps04 from -sibling test
This guy runs on tmpfs for dumps and maps04 is too heavy for it

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-11-12 15:15:47 +03:00
Cyrill Gorcunov
fa0587ed81 restore: Use min_t helper for type casting
On arm

 | CC       crtools.o
 | In file included from arch/arm/include/asm/bitops.h:4:0,
 |                  from arch/arm/include/asm/types.h:9,
 |                  from include/proc_parse.h:5,
 |                  from include/ptrace.h:8,
 |                  from cr-restore.c:27:
 | cr-restore.c: In function 'restore_priv_vma_content':
 | include/compiler.h:60:17: error: comparison of distinct pointer types lacks a cast [-Werror]
 |   (void) (&_min1 == &_min2);  \
 |

Reported-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-11-12 14:57:05 +03:00
Cyrill Gorcunov
ee2409ec37 compiler: Grab min_t, max_t from the kernel
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-11-12 14:57:00 +03:00
Andrew Vagin
23a2472ccb test: use the ip tool instead of ifconfig and brctl
I'm too lazy to install new tools on all test hosts.

Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-11-12 14:08:16 +03:00
Cyrill Gorcunov
c63a42ac2f restore: Use bitmap_set helper
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-11-12 11:15:13 +03:00
Cyrill Gorcunov
ba475b8dcf bitmap -- Add few helpers for bits manipulations
Grabbed from kernel. Probably worth to gather
all bits manipulators here in future.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-11-12 11:15:02 +03:00
Pavel Emelyanov
03b217c0a6 restore: Restore as many pages at once as possible
When the VMA being restored is not COW-ed we read pages from images
one-by-one which results in suboptimal pages.img access. Fix this
by reading as many pages from iamge at once as possible withing the
active pagemap and VMA.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-11-12 11:14:44 +03:00
Pavel Emelyanov
780d699401 page-read: Teach page-read to read multiple pages at once
This is preparatory patch, the problem to solve is described in
the next one.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-11-12 11:14:43 +03:00
Tycho Andersen
e41f4dbcab gitignore: ignore a bunch of other generated stuff
Some test binaries weren't ignored, and some of the new zdtm.py files.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-11-12 10:32:27 +03:00
Tycho Andersen
34f33bd7ba tests: add a test for c/r of an empty bridge
v2: * add a zdtm.py .desc file
    * only look to make sure inet addresses match (in particular, don't
      match the state)

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-11-12 10:32:24 +03:00
Tycho Andersen
8a95be0679 net: allow c/r of empty bridges in the container
Implementing c/r of bridges with slaves shouldn't be too hard (viz. the
comment), but this is all I need to for right now.

v2: remove extra debug statement
v3: * remember to close fd in dump_bridge
    * use "known" buffer length and snprintf for spath in dump_bridge
    * change brace style

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-11-12 10:31:58 +03:00
Pavel Emelyanov
b67bde83bb collect: Print info about collection finish
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-11-11 19:03:09 +03:00
Tycho Andersen
a0470e9bd9 add seccomp syscall
We'll use this when restoring eBPF programs in FILTER mode.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-11-11 15:57:27 +03:00
Tycho Andersen
934c312554 rst: unmap restore memory after seccomp restore
In order to restore seccomp filters, we need to have access to dynamically
allocated memory from the restorer blob, so we should unmap this memory
afterwards. In order to do this, we need to suspend seccomp earlier, right
after we attach to the tasks instead of just before we do the unmap of the
restorer blob itself.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-11-11 15:57:26 +03:00
Tycho Andersen
5577c2e865 unix: turn down unlink warning
This isn't really an, so let's call it a warning.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-11-11 15:42:49 +03:00
Andrew Vagin
1c1795412e jenkins: add script to create a test container
We want to execute tests in an isolated environment

Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-11-11 11:40:10 +03:00
Pavel Emelyanov
20088c4fcc jenkins: Move regular test on .py
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-11-11 11:36:18 +03:00
Pavel Emelyanov
6f0681c1b1 Revert "rst: Re-use opened fd when restoring private mappings"
This reverts commit 73cb87f9182bf46fceacde1e9023d8d5cdf99de6.

Two reasons: individual VMA-s may require different open flags
and ghost and link-remap files should be properly unlinked at
the end of open_path().

Need some more intelligent solution to this.
2015-11-10 17:20:55 +03:00
Andrew Vagin
a3bfe43ef9 zdtm.py: print shorter separators for less significant blocks
Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-11-10 16:52:35 +03:00
Andrew Vagin
2fb61d3f9d zdtm.py: grep errors even if criu exists with 0
Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-11-10 16:52:28 +03:00
Pavel Emelyanov
3fbb8e7f13 proc: Open anon_dev mapped files with O_RDONLY
Commit a3a10c44af made all map_files opens happen with
O_PATH for speed. However some files (sockets and aio
rings) are not detected by this, since kernel's ->open
callback is not called and we don't get the ENXIO code.

Fix this by opening non-regular files with O_RDONLY.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-11-10 17:38:27 +04:00
Pavel Emelyanov
a20ed3c6f0 page-server: Fine grained corking control (v3)
When live migrating a container with large amount of processes
inside the time to do page-server-ed dump may be up to 10 times
slower than for the local dump.

The delay is always introduced in the open_page_server_xfer()
when criu negotiates the has_parent bit on the 2nd task. This
likely happens because of the Nagel algo taking place -- after
the write() of the OPEN2 command happened kernel delays this
command sending waiting for more data.

v2:
Fix this by turning on CORK option on memory transfer sockets
on send side, and NODELAY one once on urgent data. Receive
side is always NODELAY-ed. According to Alexey Kuznetsov this
is the best mode ever for such type of transfers.

v3:
Push packets in pre-dump's check_parent_server_xfer too.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Acked-by: Andrew Vagin <avagin@odin.com>
2015-11-10 16:00:25 +03:00
Pavel Emelyanov
73cb87f918 rst: Re-use opened fd when restoring private mappings
On restore we do a sequence of open+mmap+close steps. On real apps
there exists chains of private file mappings for the same file with
different pgoffs and/or flags/prots.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-11-10 15:59:28 +03:00
Pavel Emelyanov
d6d06c9dfc Open proc links with O_PATH
These three are like map_files one.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
2015-11-10 15:58:36 +03:00
Pavel Emelyanov
a3a10c44af Open map_files with O_PATH
This descriptor is stat()-ed and used to dump file information.
In both cases even read access is not required. Even if we decide
to go dump ghost file out of it we'll re-open one with O_RDONLY.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
2015-11-10 15:58:35 +03:00
Pavel Emelyanov
427ea60bba Open proc helper fds with O_PATH
These descriptors are purely used for openat()-s, so having
them opened with O_PATH is OK and saves a little bit operations
in the kernel space.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
2015-11-10 15:58:34 +03:00
Adrian Reber
7b32bee414 page-read: print missing page address in hex
Signed-off-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-11-10 15:57:05 +03:00
Andrew Vagin
2440482bcf zdtm: create devices with proper major and minor numbers
Currently numbers for /dev/net/tun and /dev/rtc are hardcoded and
they changed after the last kernel update.

Reported-by: Mr Jenkins
Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-11-10 15:55:51 +03:00
Andrey Vagin
4aaa707260 jenkins: save report in the "test" directory
Now we save report in test/dump/report. It doesn't work when
we mount tmpfs into test/dump, because Jenkins runs in another
mount namespace.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-11-10 15:55:15 +03:00
Artem Kuzmitskiy
4e99f18f64 Expand task_size variable for AArch32
Task size depends from VM_SPLIT_* kernel option and cannot be hard coded.
This patch based on c0c0546c31e6df4932669f4740197bb830a24c8d from
Christopher Covington.

Signed-off-by: Artem Kuzmitskiy <artem.kuzmitskiy@lge.com>
Reviewed-by: Christopher Covington <cov@codeaurora.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-11-10 15:54:01 +03:00
Andrew Vagin
9bbb2b092c zdtm: call test_daemon when a test state is created
Otherwise a test can create or delete some mappings:

8306  getppid()                         = 83
8306  kill(83, SIGTERM)                 = 0
8306  clock_gettime(CLOCK_BOOTTIME, {1916694, 423447417}) = 0
8306  clock_gettime(CLOCK_MONOTONIC_COARSE, {1916694, 419509587}) = 0
8306  open("/etc/localtime", O_RDONLY|O_CLOEXEC)              = 3
8306  fstat(3, {st_mode=S_IFREG|0644, st_size=127, ...}) = 0
8306  fstat(3, {st_mode=S_IFREG|0644, st_size=127, ...}) = 0
8306  mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0 <unfinished ...>
8306  <... mmap resumed> )              = 0x3fffa8570000
8306  read(3, "TZif2...", 4096) = 127
8306  lseek(3, -71, SEEK_CUR)             = 56
8306  read(3, "TZif2...", 4096) = 71
8306  close(3 <unfinished ...>
8306  <... close resumed> )             = 0
8306  munmap(0x3fffa8570000, 4096 <unfinished ...>
8306  <... munmap resumed> )            = 0
8306  write(2, "12:15:36.347:    84: ( start) boottime 1916694 boottime-coarse 1916694 total_sleep_time 0\n", 90 )             = 90
8306  futex(0x10020850, FUTEX_WAIT, 0, NULL <unfinished ...>

Reported-by: Mr Jenkins
Signed-off-by: Andrew Vagin <avagin@openvz.org>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-11-09 19:30:51 +03:00
Tycho Andersen
5f0b9ae1de net: ipv4: add ignore_routes_with_linkdown sysctl
Looks like this is new as of the 4.2 timeframe. It does bring up a
question: should we do a ls /proc/sys/net/conf/lo on the host to figure out
what sysctls to try and dump instead of use this hardcoded list? I guess we
need to check file modes too, because of mc_forwarding, but something like
that.

v2: add ignore_routes_with_linkdown to the end of the hardcoded devconfs
    list, so as not to break migration across criu versions.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-11-09 12:02:40 +03:00
Tycho Andersen
b6cdc5e9bd mnt: don't dump external mounts
These are going to be bind mounted from the outside world after all, so
there is no use in dumping them.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-11-09 11:57:32 +03:00
Tycho Andersen
b6a355c33c mnt: always_fail should report an error
Otherwise, you just see an anonymous failure in the logs, like:

(00.244773) mnt: Dumping mountpoints
(00.244781) mnt:        253: 42:/ @ ./dev/.lxc
(00.244793) mnt: Path `/dev/.lxc' resolved to `./dev/.lxc' mountpoint
(00.249039) mnt:        133: 41:/ @ ./dev/hugepages
(00.249052) mnt:        116: 40:/ @ ./run/lock
(00.249064) mnt: Path `/run/lock' resolved to `./run/lock' mountpoint
(00.251948) mnt:        115: 3f:/ @ ./run
(00.251970) mnt: Something is mounted on top of ./run
(00.264803) mnt: Path `/run' resolved to `./run' mountpoint
tar: ./uuidd/request: socket ignored
tar: ./dbus/system_bus_socket: socket ignored
tar: ./acpid.socket: socket ignored
tar: ./systemd/journal/syslog: socket ignored
tar: ./systemd/journal/dev-log: socket ignored
tar: ./systemd/journal/socket: socket ignored
tar: ./systemd/journal/stdout: socket ignored
tar: ./systemd/private: socket ignored
tar: ./systemd/notify: socket ignored
(00.368950) mnt:        113: 3e:/ @ ./dev/shm
(00.368978) mnt: Path `/dev/shm' resolved to `./dev/shm' mountpoint
(00.371551) mnt:        112: 3d:/ @ ./dev/pts
(00.371566) mnt:        249: 28:/ @ ./var/lib/lxcfs
(00.371749) Unlock network
(00.371762) Running network-unlock scripts
(00.371766) Unfreezing tasks into 1
(00.371770)     Unseizing 13683 into 1
(00.371784)     Unseizing 14839 into 1
(00.371794)     Unseizing 15678 into 1
(00.371800)     Unseizing 16126 into 1
(00.371805)     Unseizing 16177 into 1
(00.371814)     Unseizing 16301 into 1
(00.371843)     Unseizing 16323 into 1
(00.371854)     Unseizing 16414 into 1
(00.371900)     Unseizing 16595 into 1
(00.371911)     Unseizing 16695 into 1
(00.371942)     Unseizing 16744 into 1
(00.371964)     Unseizing 16904 into 1
(00.372103)     Unseizing 16944 into 1
(00.372140)     Unseizing 17558 into 1
(00.372196) Error (cr-dump.c:1631): Dumping FAILED.

...which is hard to debug.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-11-09 11:57:25 +03:00