2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 14:25:49 +00:00
Commit Graph

3672 Commits

Author SHA1 Message Date
Ruslan Kuprieiev
0b5b2f9906 service: Add support for check request
Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-20 14:16:44 +04:00
Ruslan Kuprieiev
9ccbf1bcc8 v2 crtools: init log after changing directory to work_dir
After set of patches which add --work-dir option we have an issue: logs are created relatively
to current dir and not relatively to images dir(which is work dir, when --work-dir is not given).
To solve this lets init log after chdir(work_dir)

Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-19 22:50:20 +04:00
Ruslan Kuprieiev
486cad37cc image: Open parent image dir with -at calls
After fixes with -W option we've changed the cwd at the
time parent images are opened. Use the -at syscall to
proerly access ones.

[ Cleanup and comment from xemul@ ]

Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-18 13:22:10 +04:00
Ruslan Kuprieiev
80559828d6 v2 stats: write stats at work directory
Stats must be in work dir, as logfiles and pidfiles.

Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-16 00:05:53 +04:00
Pavel Emelyanov
5d4824fff0 crtools: Fix help text according to new -W option
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-15 21:51:19 +04:00
Ruslan Kuprieiev
b1a197f0b8 page-server/service: do not chdir / when going daemon
Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-15 21:38:44 +04:00
Ruslan Kuprieiev
482b30666f crtools: chdir to work directory
Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-15 21:38:42 +04:00
Ruslan Kuprieiev
dc80d6f125 log: get rid of LOG_DIR_FD_OFF and opening cwd in log_init()
Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-15 21:38:41 +04:00
Ruslan Kuprieiev
127637bc49 image: add dir parameter to open_image_dir()
Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-15 21:38:40 +04:00
Ruslan Kuprieiev
555c8acd4d crtools: add --work-dir(-W) option
Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-15 21:38:39 +04:00
Cyrill Gorcunov
291aa3f6d6 headers: Add extern specificator to functions
We really have a mess of extern/non-extern declaration
of functions in our headers. Always use extern for
unification purpose.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-15 17:00:58 +04:00
Cyrill Gorcunov
39752a1465 headers: ptrace.h -- Reflect name change in ifdef/endif
The file name was changed but ifdef/endif hadn't been
updated. Fix it.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-15 17:00:28 +04:00
Cyrill Gorcunov
3456e56134 headers: Add \Newline-s for readability sake
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-15 17:00:14 +04:00
Cyrill Gorcunov
3f03d139d3 headers: Add missing __CR_ at last endif
For big #ifdef/#endif chunks we do a comment /* */
at #endif. Add missing ones.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-15 16:59:57 +04:00
Cyrill Gorcunov
ada7322a9c headers: Drop _LINUX_CAPABILITY
Use one provided in linux/capability.h

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-15 16:59:40 +04:00
Andrey Vagin
ec91abf0a8 zdtm/selfexe00: append a null byte to paths
readlink() does not append a null byte to buf.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-15 16:32:00 +04:00
Pavel Emelyanov
9a8475ae03 image: Stopped tasks are supported, fix comments
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-15 00:27:45 +04:00
Pavel Emelyanov
e42a486f39 files: Extend comment about "overlinked" files dump and restore
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-15 00:26:54 +04:00
Cyrill Gorcunov
ce3b4aaafa headers: Move MADV definitions to own mman.h
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-14 22:48:30 +04:00
Cyrill Gorcunov
8c7a62c4e6 headers: Move ERESTART codes to errno.h
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-14 22:22:21 +04:00
Cyrill Gorcunov
f508c0f2dd headers: Drop never used CLONE_VFORK
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-14 22:22:00 +04:00
Cyrill Gorcunov
8cca9ca7df headers: Drop never used CLONE_CHILD_USEPID
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-14 22:21:53 +04:00
Cyrill Gorcunov
35ab2de917 x86: headers -- Drop unused FS/GS_TLS
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-14 22:21:36 +04:00
Cyrill Gorcunov
d9731a92b8 headers: Drop SECURE_NO_SETUID_FIXUP definition
Take it from linux/securebits.h

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-14 22:21:21 +04:00
Cyrill Gorcunov
ed20cef6a0 headers: Move prctl constants to prctl.h
Move prctl constants into own header. They are
arch independent.

The x86 specific ARCH_SET_GS should be fetched from <asm/prctl.h>
(instead of defining own ones).

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-14 22:19:43 +04:00
Cyrill Gorcunov
f8ddc74283 headers: Move kcmp_type to kcmp.h
It's arch independent data.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-14 22:13:59 +04:00
Cyrill Gorcunov
3f3439cd42 headers: Move fh_t to fsnotify.c
We really don't need it spread over all headers. The file
handlers are used in fsnotify only, declare it there.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-14 22:13:43 +04:00
Cyrill Gorcunov
3c8a8326af headers: Drop SCM_MAX_FD internal variable
This limit is not exported by a kernel, so no need
to "explicitly" define it pretending that it's immutable.

Still I kept this name in comment just to give reader
a tip where CR_SCM_MAX_FD came from.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-14 22:13:32 +04:00
Cyrill Gorcunov
8f64a14a03 headers: Move fcntl related data to include/fcntl.h
fcntl data is arch independent, so move it out of include/asm/type.h

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-14 22:13:10 +04:00
Andrey Vagin
98efb3c904 tcp: restore the boundary between sent and unsent data
All data in a write buffer can be divided on two parts sent but not yet
acknowledged data and unsent data.

Currently the boundary between sent and unsent data is not dumped and
all the data are restored as if they have already been sent.
This methode can provoke long delays in tcp connection, because a kernel
can wait before retransmitting data.
https://bugzilla.openvz.org/show_bug.cgi?id=2808

The TCP stack must know which data have been sent, because
acknowledgment can be received for them. These data must be restored in
repair mode.

The second part of data have never been sent out, so they can be
restored without any tricks. These data can be sent into socket as
usual.

For restoring unsent data the repair mode is disabled for socket,
but it is enabled back after restoring data. It will be disabled
after unlocking network. In this case window probe is sent, which is
required for waknge the connection.

This patch fixes long delays in tcp connections after dumping and
restoring.

Thanks Pavel for the idea of disabling repair mode for restoring
unsent data.

https://bugzilla.openvz.org/show_bug.cgi?id=2808

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-14 17:15:44 +04:00
Andrey Vagin
d917ff15bb tcp: save the amount of unsent data in the socket send queue
TCP send queue contains two types of data:
* unacknowledged data, which have been sent out
* data, which have not been sent

Currently only the size of all data is save, but it's not enough for
proper restoring of TCP connections.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-14 17:14:31 +04:00
Cyrill Gorcunov
cf6d5d02a6 make: protobuf -- Escape slashes to future needs
At moment we generate protobuf dependencies having in
mind that protobuf/ directory is _always_ in the source
code root. This may change one day in future so better to
be on safe side and escape slashes immediately.

I meet this problem when been needed to build protobuf
builtin in $(root)/src/protobuf directory.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-11 16:05:23 +04:00
Ruslan Kuprieiev
401680e85b crtools: init logfile after processing all command line arguments
I see no need now to init log during processing of command line arguments.

Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-11 16:03:38 +04:00
Pavel Emelyanov
6b8f651f5f rst-mem: Grow buffer more than 2 pages if required
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-08 19:48:44 +04:00
Pavel Emelyanov
a2917ffc87 rst: Initialize task restore args after rst-mem remap
The plan is to move the args on rst-mem itself. Thus we need
to make sure it's initialized _after_ remap into restorer space.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-08 17:57:04 +04:00
Pavel Emelyanov
3e895cc2da rst: Rename task_restore_core_args
Remove the _core_ from it.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-08 17:32:07 +04:00
Pavel Emelyanov
ec7e483e8b restorer: Make task- and thread- args go one-by-one
Currently we have task args page-aligned, then there go
thread args. This is waste of memory. Let's put them in
one row.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-08 17:29:55 +04:00
Pavel Emelyanov
d52e000152 net: Don't create lo on netns restore
For devices, that are available in netns we have a special
routine, that just restored link params.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-08 16:52:20 +04:00
Andrey Vagin
cc4a922ebc pstree: don't include restorer.h in pstree.c
restorer.h includes about 20 headers. Any changes in these headers
provoke to recompilation of pstree.c.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-08 16:46:32 +04:00
Andrey Vagin
254342be4e test/rpc: fix test execution
* fix compilation from the test/rpc directory

$ make
make: *** No rule to make target `/rpc.proto', needed by `rpc.pb-c.c'. Stop.

* use absolute path for pidfile

$ bash run.sh
**************************************************
		Shutdown service server
**************************************************

cat: pidfile: No such file or directory
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ...
or kill -l [sigspec]

Cc: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-08 16:46:05 +04:00
Andrey Vagin
caacf3f0b8 zdtm: suppress the message "Nothing to be done for 'all'"
Execute zdtm/live/static/env00
make[1]: Nothing to be done for `all'.
make[1]: Nothing to be done for `all'.
./env00 --pidfile=env00.pid --outfile=env00.out --envname=ENV_00_TEST
Dump 18232
Restore
Check results 18232
14:53:59.615: 18232: PASS
Test: zdtm/live/static/env00, Result: PASS
ZDTM tests PASS.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-08 16:45:32 +04:00
Andrey Vagin
e493d3863d zdtm: improve printing of separator lines
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-08 16:45:25 +04:00
Andrey Vagin
a4118a6e82 zdtm: show logs only in verbose mode
It's may be useful for Jenkins or other auto executors, but human would
prefer to open log file in text editor rather than scroll a terminal
history.

The error message in non-verbose mode contains only critical information
such as error messages and paths to log files.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-08 16:45:19 +04:00
Andrey Vagin
b24d488dc9 zdtm: use full paths in commands and log messages
I like copy past. Currently zdtm.sh uses paths relative to the
directory test, but I work ralative to the root of the source tree.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-08 16:45:13 +04:00
Pavel Emelyanov
60af777286 lib: Don't compile-in util-fd.c
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-07 16:08:29 +04:00
Andrey Vagin
dd407dd04e hdrs: minor cleaup
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-07 15:13:50 +04:00
Andrey Vagin
6f0a7ed332 hdrs: delete extra headers from image.c
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-07 15:13:25 +04:00
Andrey Vagin
a434e7f075 crtools: move pid_rst_prio to pid.h
crtools.h is too heavy to be included in many sources

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-06 18:18:12 +04:00
Andrey Vagin
72727bb3ed log: move print_*data from crtools.h in log.h
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-06 18:17:58 +04:00
Andrey Vagin
4850fd94a8 crtools: move cr_options in a separate header
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-06 18:17:52 +04:00