Standalone criu target should not be used here
because it doesn't carry all prerequisites needed.
Instead simply use @all.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
So, first of all we've fixed (I hope) the security issues
spotted by RedHat people. Another big thing of this release
is the huge amount of bug fixes found while testing live
migration. And enhancements for live migration itself is
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This directory is generated by the install-crit target, so let's .gitignore
it and clean it on `make clean`.
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
As we've deleted them in previous two patches.
Signed-off-by: Ruslan Kuprieiev <rkuprieiev@cloudlinux.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This patch change the build chain to not use pie objects in the crtools
executable.
This done by building the shared source files twice:
1. for parasite/restorer as '<file>-pie-build.o'
2. for crtools as '<file>.o'
Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Reviewed-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
To build piegen tool with different compiler/linker than
gcc/ld -- simply run make as
HOSTCC="host-compiler" HOSTLD="host-ld" make
where host-compiler/ld is appropriate program needed.
https://github.com/xemul/criu/issues/63
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Reviewed-by: Christopher Covington <cov@codeaurora.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
There were multiple copy of the same code spread over the different
architectures handling the vDSO.
This patch is merging the duplicated code in arch/*/vdso-pie.c and
arch/*/include/asm/vdso.h in the common files and let only the architecture
specific part in the arch/*/* files.
The file are now organized this way:
include/asm-generic/vdso.h
contains basic definition which could be overwritten by
architectures.
arch/*/include/asm/vdso.h
contains per architecture definitions.
It may includes include/asm-generic/vdso.h
pie/util-vdso.c
include/util-vdso.h
These files contains code and definitions common to both criu and
the parasite code.
The file include/util-vdso.h includes arch/*/include/asm/vdso.h.
pie/parsite-vdso.c
include/parasite-vdso.h
contains code and definition specific to the parasite code handling
the vDSO.
The file include/parasite-vdso.h includes include/util-vdso.h.
arch/*/vdso-pie.c
contains the architecture specific code installing the vDSO
trampoline.
vdso.c
include/vdso.h
contains code and definition specific to the criu code handling the
vDSO.
The file include/vdso.h includes include/util-vdso.h.
CC: Christopher Covington <cov@codeaurora.org>
CC: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Acked-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
We have quite a lot of new stuff this time. More flexibility
in cgroup management code (and this story far from being over)
in the library and in the crit command line, preparations to
x66 32bit, that also helped the PPC port, freezer cgroup
filannly found its place in the code. We also had our first
CVE-s found :) and a LOT of bugs fixed.
So the plan for the 1.8 is: cgroups, secured containers and
bugfixes. x86 32bit is tempting too.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Use CRTOOLSVERSION instead of GITID to write criu.pc version. With
GITID, criu.pc had version '0' when built from tarballs.
Signed-off-by: Cédric Bosdonnat <cbosdonnat@suse.com>
Acked-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
criu_opts contains rpc options and notify callback,
so we can keep all options in just one structure.
This will allow us to easily extend libcriu functionality
and yet keep all options in one place.
We're also not hiding rpc opts structure anymore, so
it is pretty clear where power-user should put his own
CriuOpts instance if he would like to do that.
Signed-off-by: Ruslan Kuprieiev <rkuprieiev@cloudlinux.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
For testing purpose we need to disable using of
piegen utility. So lets add PIEGEN make option
thus one can "PIEGEN=no make" to build criu
without piegen at all.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This cleans the assembly code, removing no more needed trick with the
register 2 (TOC pointer). As a consequence, the __export_restore_task_trampoline()
and __export_unmap_trampoline() are no more needed.
Thus, the changes introduced by the commit de9df91002 ("Per architecture restorer
trampolines") in cr-restore.c are no more used but are not impacting
runtime code anyway.
Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
After this patch one can run ARCH="ia32" make to build
32bit version on CRIU on 64bit host. Note this is only
build procedure which tuned up, the CRIU itself is not
yet ready to make a checkpoint/restore cycle -- a lot
of additional code is needed and here we rather put
stubs simply to make build procedure run.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Since at the moment we're running only x86-64 not 32 bit tasks,
and our code is not carrying any big statically defined structures
we can use relocatable files directly with all relocation applied
during building.
This gonna be changed soon once we start supporting 32 bit tasks.
IOW even currently we need (which is not yet done but it's safe)
- check for gotpcrel relocations
- apply relocations with generated elf_apply_relocs helper
Currently overall scheme looks this way
- our object files are linked together into parasite.built-in.bin.o file
- then pie/piegen/piegen tool is called which parses this file and generates
C source code file with bytestream and all information needed to rellocate
this bytestream into a new place (see elf_apply_relocs helper)
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Here we simply build piegen tool which gonna be used
to generate parasite code safe to rellocate. The tool
is taking object file as an argument, parses it and
generates C file with rellocations encoded in form
suitable for fast appliance.
Currently only x86-32 x86-64 is supported.
v2 (by ldufour@):
- Filter PIEGEN
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
The criu(8) man-page is generated using asciidoc. The problem with
asciidoc is that, due to its dependencies, it is not available on
all distributions or it is undesired to install all asciidoc
dependencies. The install target was unconditionally installing and thus
building the man-page even if not explicitly specified with 'make docs'.
With the new 'install-criu' target everything besides the man-page is
installed and the target 'install-man' is only called by the target
'install'.
Signed-off-by: Adrian Reber <areber@redhat.com>
Acked-by: Tycho Andersen <tycho.andersen@canonical.com>
Looks-ok-to: Cyril Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Passing both $DESTDIR and $PREFIX into --prefix option of crit install
results in the bogus $DESTDIR embedded in the installed object.
Instead, pass $DESTDIR to --root and $PREFIX to --prefix options,
respectively.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
So, we've got quite a lot of new stuff this release :) The biggest
code-merge was POWER arch port. Another big thing that has happened
was criu integration with libcontainer. And a tiny change that will
become big next release -- the "criu show" command is going to be
thrown away in 3 monthes, the CRIT tool should be used instead.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Trying to create a RPM from current CRIU HEAD fails as the crit
installation ignores $(DESTDIR).
This simple patch adds staged installation for crit:
3f7dd40047
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
When it is run, cscope complains about files it cannot find:
cscope: cannot find file test/zdtm/live/streaming/socket-tcp.c
cscope: cannot find file test/zdtm/live/streaming/socket-tcp6.c
cscope: cannot find file test/zdtm/live/static/socket-tcpbuf-local.c
cscope: cannot find file test/zdtm/live/static/mntns_shared_bind02.c
cscope: cannot find file test/zdtm/live/static/socket_listen6.c
cscope: cannot find file test/zdtm/live/static/socket-tcp6.c
cscope: cannot find file test/zdtm/live/static/socket-tcpbuf6.c
cscope: cannot find file test/zdtm/live/static/mntns_link_ghost.c
cscope: cannot find file test/zdtm/live/transition/fork2.c
These files are relative symbolic links, and since cscope is run at the top
directory, the ../* links are not valid.
This patch removes the symbolic links from the list of scanned files. This
is not removing any tags since the real file are still scanned.
In addition, the test directory is not taken in account.
Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
I use Makefile.local to add my own rules for submitting a build
to Coverity. As those rules contain login credentials, they should
be kept private. Including Makefile.local (if present) seems to be
the best way to achieve that.
Also, add Makefile.local to .gitignore to make sure it never gets
commited into repo.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This patch initiates the ppc64le architecture support in CRIU.
Note that ppc64 (Big Endian) architecture is not yet supported since there
are still several issues to address with this architecture. However, in the
long term, the two architectures should be addressed using the almost the
same code, so sharing the ppc64 directory.
Major ppc64 issues:
Loader is not involved when the parasite code is loaded. So no relocation
is done for the parasite code. As a consequence r2 must be set manually
when entering the parasite code, and GOT is not filled.
Furthermore, the r2 fixup code at the services's global address which has
not been fixed by the loader should not be run. Branching at local address,
as the assembly code does is jumping over it.
On the long term, relocation should be done when loading the parasite code.
We are introducing 2 trampolines for the 2 entry points of the restorer
blob. These entry points are dealing with r2. These ppc64 specific entry
points are overwritting the standard one in sigreturn_restore() from
cr-restore.c. Instead of using #ifdef, we may introduce a per arch wrapper
here.
CRIU needs 2 kernel patches to be run powerpc which are not yet upstream:
- Tracking the vDSO remapping
- Enabling the kcmp system call on powerpc
Feature not yet supported:
- Altivec registers C/R
- VSX registers C/R
- TM support
- all lot of things I missed..
Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
We will need it for x86-32 as well, not on ARM only.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
# Build criu in a docker container
$ make direct-build
# Execute tests in a docker container
$ make direct-test
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Here it is. The major new thing I think is the CRIT tool
that will be the main one to mainupulate images and will
eventually replace the "criu show" action.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Currently we run into lots of race conditions when building in
multithreded mode.
Reported-by: Mr Jenkins
Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Acked-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
install-crit uses scripts/crit-setup.py install --prefix=$(DESTDIR)
to act the way the install target expects it too.
Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
/tmp/ccq2xzf8.s: Assembler messages:
/tmp/ccq2xzf8.s:5748: Error: thumb conditional instruction should be in IT block -- strexeq r1,r2,[r3]'
Cc: Alexander Kartashov <alekskartashov@parallels.com>
Cc: Ruslan Kuprieiv <kupruser@gmail.com>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
So, according to the recently accepted plan we have 1.4.
Biggest achievement here is that we've finally started with
user namespaces, fixed CRIU to work smoothly with the p.haul
project and optimized images and /proc files IO.
And a bunch of bugs, of course.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
It's been a long delay since 1.2, but we did it :)
The greatest new acheivement is finally support for Docker
and LXC on CRIU side. Some work is still to be don on the
other, but here in CRIU everything is ready.
Another notable things are AArch64 support and, of course,
a lot of bugfixes.
Further plan is to make releases be not so rare :)
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This modifies the x86 VDSO code to work on AArch64.
Signed-off-by: Christopher Covington <cov@codeaurora.org>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Building criu with "make criu" on a clean tree was not working, failing on:
make[1]: *** No rule to make target `arch/x86/vdso-pie.o'. Stop.
make: *** [arch/x86/vdso-pie.o] Error 2
git bisect traced the regression to commit c473461d24 (vdso: Make it arch
specific) which apparently dropped the rule to build $(ARCH_DIR)/vdso-pie.o
using the pie rule. Restore the dependency for "make criu" to work again from
a clean tree.
Tested:
$ git clean -fdx
$ make criu
Fixes: c473461d24
Signed-off-by: Filipe Brandenburger <filbranden@google.com>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Next acheivement -- external bind mounts and tasks-to-cgroups
bindings. Plus many bugfixes in memory restore and mounpoints
dump, many thanks to Google guys for reports and patches!
We have quite a few things left to make workable LXC and Docker
support, hopefully the next tag will be the 1.3 one :)
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
We use config.h in vDSO handling code so arch
targets should depend on it.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Currently we build vDSO handling code for all archs provided
in the source code having some "common" parts inside pie/vdso.c,
pie/vdso-stub.c, vdso-stub.c and vdso.c. This were more or
less well but in new linux kernels (starting from 3.16 presumably)
the vDSO has been significantly reworked so every architecture
must have own vDSO handling engine (just like the kernel does).
So in this patch we move vDSO code to arch specific and because
aarch64 actually doesn't implement proxification yet due to
kernel restrictions -- we drops it out. When there will be
kernel support we bring it back in proper arch/aarch64
implementation.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
We will need it to figure out if architecture
needs vDSO handling code to be built. Note
currently only x86 is exporting vDSO simply
because ARM support is not yet ready.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Filipe Brandenburger <filbranden@google.com>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Without the added dependencies, "make criu" will fail when trying to
build arch/x86/crtools.d because it can not find include/config.h, the
extra dependencies force the "config" rule to be processed before the
dependencies of "criu" are evaluated.
Signed-off-by: Filipe Brandenburger <filbranden@google.com>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
test/Makefile knows better how to execute tests.
For example it allows to execute tests simultaneously
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
We have made big step towards C/R of LXC containers -- made support
for nested mount namespaces and addressed the re-attach issue. Also
we have AArch64 support merged.
Some work is still to be done, but it's good time to show what we
have so far, thus -- the 1.3-rc1.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>