Commit graph

214 commits

Author SHA1 Message Date
Pavel Emelyanov
429e81954b criu: Version 1.3.1
We have a couple of problems missed in 1.3, so here's
the -stable .1 for that release.

First of all, we nail down the way CRIU decides whether
restore root task as child or as sibling with the
explicit API switch.

And there are two nasty issues in how CRIU dumps mountpoints.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-09-12 12:14:39 +04:00
Pavel Emelyanov
c716f6b8a3 criu: Version 1.3
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>
2014-09-01 14:18:37 +04:00
Christopher Covington
cf219f9284 Customize AArch64 VDSO code
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>
2014-08-06 19:00:17 +04:00
Ruslan Kuprieiev
1211ca01ef make: clean at test/rpc when performing "make clean" from main dir
Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-08-06 09:36:37 +04:00
Tycho Andersen
89d3840c9c build: install target depends on libcriu
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-08-04 13:59:00 +04:00
Tycho Andersen
14cad21eb5 lib: Generate pkgconfig file
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-08-04 13:57:18 +04:00
Filipe Brandenburger
2812d04d29 make: fix "make criu" after arch-specific vdso broke it
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>
2014-06-26 16:32:53 +04:00
Pavel Emelyanov
7edf0994c9 criu: Version 1.3-rc2
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>
2014-06-18 13:34:36 +04:00
Cyrill Gorcunov
06f559fcc7 vdso: make -- Arch targets depends on config
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>
2014-05-28 00:51:07 +04:00
Cyrill Gorcunov
c473461d24 vdso: Make it arch specific
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>
2014-05-27 23:41:31 +04:00
Cyrill Gorcunov
46661cf8b2 vdso: make -- Export VDSO and CONFIG_VDSO
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>
2014-05-27 23:39:51 +04:00
Filipe Brandenburger
81fe07e54d make: respect USERCFLAGS in zdtm makefiles
Signed-off-by: Filipe Brandenburger <filbranden@google.com>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-05-26 17:38:52 +04:00
Filipe Brandenburger
2351d188c3 make: fix dependencies for "make criu" to work
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>
2014-05-26 17:38:51 +04:00
Andrey Vagin
5a14695777 make: "make test" executes make in the test directory
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>
2014-05-14 17:35:20 +04:00
Pavel Emelyanov
54a996b0f3 criu: Version 1.3-rc1
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>
2014-04-25 15:40:17 +04:00
Christopher Covington
2713b6a39c Make sure logrotate directory exists
Otherwise, `make install` may fail.

Signed-off-by: Christopher Covington <cov@codeaurora.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-04-11 15:15:18 +04:00
Alexander Kartashov
7535c3909a vdso.c: share the PIE part of the vDSO proxy machinery between all architectures
This patch splits the file arch/x86/vdso-pie.c into machine-dependent
and machine-independent parts by moving the routines vdso_fill_symtable(),
vdso_proxify(), and vdso_remap() to the file pie/vdso.c.

The ARM version of the routines is moved to the source pie/vdso-stub.c
to provide the vDSO proxy stub implementation for architectures
that don't provide the vDSO.

Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Looks-good-to: Cyrill Gorcunov <gorcunov@openvz.org>
Reviewed-by: Christopher Covington <cov@codeaurora.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-03-19 21:09:01 +04:00
Alexander Kartashov
9e6a062c43 vdso: share the vDSO proxy initialization between all architectures
This patch splits the file arch/x86/vdso.c into machine-independent
and machine-dependent parts by moving the routine vdso_init()
from the file vdso.c. The routine seems to be suitable for all
architectures supporting the vDSO.

The ARM version of the routine is moved to the source vdso-stub.c
that is supposed to be the vDSO proxy stub implementation for
architectures that don't provide the vDSO. The build scripts are
adjusted as well to enable selection between the full-fledged
and stub vDSO proxy implementations.

Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Looks-good-to: Cyrill Gorcunov <gorcunov@openvz.org>
Reviewed-by: Christopher Covington <cov@codeaurora.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-03-19 21:08:55 +04:00
Pavel Emelyanov
402101c345 criu: Version 1.2 release
This time we've made minimal required support for live-migration,
so that the p.haul project can work. Another big achievement is
better dump and restore performance.

Other than this -- a lot of bugfixes here and there, as usual.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-02-26 16:50:39 +04:00
Cyrill Gorcunov
aaef7b7f87 Add ability to compile program with gprof output
To be able to profile CRIU with gprof support we need a special flag
passed to the compiler and linker. But same time we can't build parasite
code with prof support because it'll call for mcount() service routine
for which we don't have any stub yet (and even if we had there are
other tech details involved). Thus PIE code won't be profiled.

To compile with prof support make it as

  make DEBUG=1 GMON=1

The idea to run gprof then over criu sources. Once you've it
compiled with the flags mentioned above -- simply run it (test or whatever,
I've been running sh test/zdtm.st static.maps00).

Then run gprof ./criu gmon.out

Note the gmon.out file lays in directory where criu were running, thus
in case of sh test/zdtm.st static.maps00 the output file will be in test/
directory.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-02-21 23:44:37 +04:00
Christopher Covington
5997913d5c Force symlink creation
Otherwise the build can fail with the following message.

ln: .../libcriu.so.1: File exists
make: *** [install] Error 1

Signed-off-by: Christopher Covington <cov@codeaurora.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-02-18 12:45:00 +04:00
Christopher Covington
5af7fd3695 Complete the conversion to SRCARCH
Signed-off-by: Christopher Covington <cov@codeaurora.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-02-18 12:44:59 +04:00
Ruslan Kuprieiev
bf288e27a2 install: install criu-service logrotate config
Thank Vladimir Davydov <vdavidov@parallels.com> for help and config.

Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Acked-by: Vladimir Davydov <vdavydov@parallels.com>
Acked-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-02-18 12:39:50 +04:00
Christopher Covington
4be26b4383 Make -march settings part of USERCFLAGS
The current -march settings will cause an error if the user a
conflicting flags such as -mcpu=cortex-a15. Use USERCFLAGS instead
of CFLAGS so that a default is provided but can be overridden.

Change-Id: I8ffecd6bfd7ad5794486a5d14d27bce3170898d3

Acked-by: Alexander Kartashov <alekskartashov@parallels.com>

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-02-10 14:36:26 +04:00
Christopher Covington
9ca415c3b6 Allow for user CFLAGS
Ideally, a user could set CFLAGS on the command line to contain
compilation options and include and library paths (or maybe set
those last two with CPPFLAGS and LDFLAGS). Unfortunately, setting
CFLAGS on the command line currently short-circuits essential
logic in the makefile and breaks the build. After a first failed
attempt it appears that a monolithic overhaul or "flag day" to
fix this is a substantial undertaking, so for now just provide a
workaround in the form of a USERCFLAGS variable.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-02-10 14:35:52 +04:00
Christopher Covington
f69fe9aa13 Remove ARM AT_VECTOR_SIZE from x86 header
Perhaps left over from when a single types.h was being used for
multiple architectures, remove the ARM definition of
AT_VECTOR_SIZE from the x86 types.h header. Also remove the
CONFIG_ARM definition since it unused.

Acked-by: Alexander Kartashov <alekskartashov@parallels.com>

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-02-10 14:35:32 +04:00
Christopher Covington
851e89ce3a Default to ARMv7
The current mechanism for determining ARM architecture version
breaks down when cross-compiling. Default to ARMv7 if the user
specifies ARCH=arm. Users wishing to cross-compile for ARMv6
platforms such as the Raspberry Pi should use ARCH=armv6 as
previously required.

Acked-by: Alexander Kartashov <alekskartashov@parallels.com>

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-02-10 14:35:08 +04:00
Christopher Covington
d6005ed12e Use SRCARCH internally
ARCH is a user-facing variable and setting it on the command line
clobbers any manipulation attempted in the makefile. Following
the example of the Linux kernel makefiles, use a SRCARCH variable
instead for the internal, potentially fixed-up, architecture name.
This fixes the following error.

make ARCH=x86_64
Makefile:69: *** "The architecture x86_64 isn't supported".  Stop.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-02-10 14:33:47 +04:00
Christopher Covington
89bb170a26 Always use ARCH_DIR
The top-level makefile defines an ARCH_DIR variable. Always use
it rather than referencing ARCH directly, since ARCH may be set
by the user on the command line and that raw input may not be
what needs to be used internally.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-02-10 14:33:11 +04:00
Christopher Covington
b0549064c1 Make tpacket_req3 definition conditional
The makefile includes need to be moved for everything to be
defined properly when the configure tests run.

The Ubuntu 12.04 x86_64 GCC and Linaro's 13.08 and newer AArch64
GCC's have the if_packet.h kernel header, but as of 13.12,
the Linaro AArch32 GCC does not.

Change-Id: I363c43fdb81b028f99aac77e15bff9462c87af4b

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-02-10 14:31:02 +04:00
Adrian Reber
35763e0b50 Makefile: fix libcriu.so links and man page installation
The links to the versioned libcriu.so.* included $(DESTDIR) and
$(LIBDIR) which will generate wrong links if building criu packages.
Now the links points to the correct file without any path.

For some reason criu.8 was installed with executable permission. Use
'install' with '-m 644' to make sure this does not happen.

Signed-off-by: Adrian Reber <adrian@lisas.de>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-02-10 14:27:43 +04:00
Adrian Reber
b0e6ebc1c7 Makefile: add soname to libcriu.so
Using a soname makes it easy for applications to
detect if the ABI of libcriu.so has changed.
It still creates libcriu.so as before in lib. During
'make install' additional links are created:

 libcriu.so -> libcriu.so.1.0
 libcriu.so.1 -> libcriu.so.1.0

Signed-off-by: Adrian Reber <adrian@lisas.de>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-02-07 15:35:20 +04:00
Adrian Reber
48b22f0d95 Makefile: Also install libcriu.so and headers
To link Open MPI against CRIU I need the header files installed.
Attached is a patch which adds the necessary Makefile rules to
install libcriu.so and the header file to compile against CRIU.

Signed-off-by: Adrian Reber <adrian@lisas.de>
Acked-by: Kir Kolyshkin <kir@openvz.org>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-02-05 16:20:19 +04:00
Pavel Emelyanov
004f1f5bbe criu: Version 1.1 release
The bugfix period after 1.1-rc1 seems to be over.
With this version we pin down the API to plugins and libcriu.so.

Next steps will be tied with live-migration usecase for CRIU :)

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-01-28 13:04:03 +04:00
Pavel Emelyanov
9f2f4afbcc criu: Version 1.1-rc2
The feedback we got helped us to improve several issues all over
the criu code. And we have some more stuff to get fixed before we
can make a good release.

That said, let's go ahead with the -rc2.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-01-20 15:28:23 +04:00
Pavel Emelyanov
b876dfa3a9 criu: Version 1.1-rc1
Two major changes so far -- libcriu.so (RPC wrapper) and plugins.
Both define some API and we want to check this API is good enough.
Thus we tag the -rc1 to let people try it. If things go smooth, we
will just go agead and tar the 1.1.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-12-31 14:08:50 +04:00
Andrey Vagin
d7cf271ed4 crtools: preload libraries (v2)
Libraries (plugins) is going to be used for dumping and restoring
external dependencies (e.g. dbus, systemd journal sockets, charecter
devices, etc)

A plugin can have the cr_plugin_init() and cr_plugin_fini functions for
initialization and deinialization.

criu-plugin.h contains all things, which can be used in plugins.

v2: rename lib to plugin
v3: add a default value for a plugin path.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-12-19 21:48:33 +04:00
Ruslan Kuprieiev
ca1f60d267 test: libcriu
This test is similiar to test/rpc, and can also be used as an
example of using libcriu.

Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-12-18 14:26:12 +04:00
Shawn Landden
2e15e4da92 systemd socket activation support
Makes the criu RPC socket socket-activated with
systemd [1], meaning that systemd will create and listen to
the UNIX socket /var/run/criu-srvice.socket
on behalf of criu until a connection comes in, when it will
then pass control of the socket, along with the first connection
over to a newly spawned criu daemon.

This is similar to inetd, but criu stays around after getting
started, listening itsself on the socket.

[1] http://0pointer.de/blog/projects/socket-activation.html

v2: stripped down sd-daemon.[ch]
    moved units to scripts/sd

v3: stripped down further by removing unneeded includes

Signed-off-by: Shawn Landden <shawn@churchofgit.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-12-12 09:58:50 +04:00
Pavel Emelyanov
f2bb77c017 criu: Version 1.0 release
The next version is ready. It looks like it's time to make it
be the first major release, so here it is -- the v1.0. It's as
functional as v0.8 but with a lot of bug fixes and improvements.
And it's still :) compatible wrt images and cli options with
older criu-s.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-25 20:05:10 +04:00
Alexander Kartashov
9af8d94901 cr: identify LDARCH and ARCH by default
Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-01 14:27:07 +04:00
Pavel Emelyanov
272c94e35b criu: Version 0.8 release
As planned, this was bugfix-mainly release. However, some new
features were added. Looking forward the v1.0 release :)

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-10-18 20:45:08 +04:00
Andrey Vagin
9a2219af0c make: clean up test data, if a test completed successfully
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-09-14 14:56:59 +04:00
Pavel Emelyanov
74070c84dd criu: Version 0.7 release
* Quite a lot of bugfixes and improvements in documentation, thanks to
feedback from users.

* New notable features include TUN devices, shared and master/slave
mounts and alternative signal stack (sigaltstack) support.

* Memory tracking is now upstream.

* This is the last release, that is tied to kernel release. The next
one will happen as soon as we decide it's worth doing so, not after
the linux-3.12.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-09-03 15:32:52 +04:00
Cyrill Gorcunov
dfdac2cf3a make: Use generic build engine for libcriu.so
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-29 14:48:13 +04:00
Cyrill Gorcunov
c75c92db1d pie: Move send_fds/recv_fds helpers into separate pie/util-fd.c
We will need to reuse this code in criu library, where libc calls
are present thus we will be compiling it in shared mode.

Because internal syscalls library won't be needed we wrap them
with __sys macro which would hide the details of invocation depending
on CR_NOGLIBC preprocessor variable passed from command line.

Original-patch-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-29 14:48:10 +04:00
Pavel Emelyanov
84737e2796 build: Generate most of the pb-desc automatically
These contain linkage between number, data type and routines
for pb messages we write/read to/from image files. Most of them
have simple number-type-routines mapping, so introduce a generating
script for that.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-23 21:47:31 +04:00
Pavel Emelyanov
72ec39f10c util: Rename pie's util-net.c into util.c
Will put more things there.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-29 12:43:30 +04:00
Ruslan Kupreev Руслан
27f9b0335d v2 criu: Initial skeleton for criu library
Add target lib to Makefile for criu library.
Created directory lib and add there Makefile and criu.c - skelettons for criu library.

Signed-off-by: Ruslan Kupreev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-18 21:47:11 +04:00
Alexander Kartashov
3a94986310 cr: determine the version of the ARM architecture of the target machine
This patch modifies the build system to analyze the version
of the target ARM architecture and setup the compiler flags
accordingly. This makes it possible to support the ARM
architectures prior to ARMv7.

Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-10 15:56:57 +04:00