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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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.
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>