Commit graph

3590 commits

Author SHA1 Message Date
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
Andrey Vagin
08abebd29c crtools: remove extra headers from headers
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-06 18:17:45 +04:00
Andrey Vagin
2082e8faf0 crtools: don't include crtools.h in other headers
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-06 18:17:38 +04:00
Andrey Vagin
a5cb58817d crtools: include sys/time.h in parasite.h
This patch fixes an error:
In file included from mem.c:10:0:
include/parasite.h:116:19: error: field ‘real’ has incomplete type
include/parasite.h:117:19: error: field ‘virt’ has incomplete type
include/parasite.h:118:19: error: field ‘prof’ has incomplete type

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-06 16:41:45 +04:00
Pavel Emelyanov
c6fab95e85 hdrs: Don't include protobuf headers into crtools.h
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-06 15:44:32 +04:00
Andrey Vagin
0ef2128309 crtools: don't include cr-show.h in crtools.h
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-06 15:42:14 +04:00
Andrey Vagin
1cb945cafe crtools: don't include util.h in crtools.h
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-06 15:42:12 +04:00
Andrey Vagin
f41255f00b crtools: don't include lock.h in crtools.h
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-06 15:42:10 +04:00
Andrey Vagin
07fc6cf394 crtools: don't include image.h in crtools.h
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-06 15:42:09 +04:00
Andrey Vagin
4cb211c094 don't include crtools.h in pstree.h
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-06 15:42:07 +04:00
Andrey Vagin
a6c422f6e3 crtools: include list.h in vma.h
This patch fixes compilation error on arm:
In file included from arch/arm/vdso-pie.c:4:0:
include/vma.h:5:19: error: field ‘h’ has incomplete type
include/vma.h:14:19: error: field ‘list’ has incomplete type

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-06 15:33:40 +04:00
Andrey Vagin
1300cf4915 crtools: move all stuff about fdset in a separate header
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-06 15:24:48 +04:00
Andrey Vagin
e85e5fdb86 crtools: don't include pstree.h in parasite-syscall.h
pstree and parasite are two different subsystems, so it "should" not
depend on each other.

parasite-syscall uses the pid struct, so this patch moves it in a
separate header.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-06 15:24:17 +04:00
Andrey Vagin
96cc00767b crtools: move CR_PARENT_LINK to image.h
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-06 12:44:19 +04:00
Andrey Vagin
0d1dfc2e08 crtools: move all stuff about vma together
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-06 12:43:49 +04:00
Andrey Vagin
824403a009 crtools: create new header for servicefd stuff (v2)
v2: generate patch relative to the official git.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-06 12:43:02 +04:00
Andrey Vagin
9826d2dd04 crtools: don't include pstree.h in namespaces.h
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-06 12:39:50 +04:00
Andrey Vagin
82cd9e2c66 parasite: don't include restorer.h in parasite-syscall.c
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-06 12:39:36 +04:00
Andrey Vagin
924acd8450 shmem: don't include restorer.h in shmem.c
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-06 12:38:43 +04:00
Andrey Vagin
a6edbcf669 crtools: don't include restorer.h in proc_parse.h
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-06 12:37:55 +04:00
Andrey Vagin
565eb01346 sigframe: don't include restorer.h
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-06 12:37:38 +04:00
Andrey Vagin
7c8e987e5d paraiste: don't include vdso.h in parasite-syscall.c
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-06 12:37:24 +04:00
Andrey Vagin
7dfea8a767 parasite: stack must be initialized by highest address
Stack grows down on x86 and ARM

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Alexander Kartashov <alekskartashov@parallels.com>:
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-06 12:33:47 +04:00
Pavel Emelyanov
ba0527d42b restore: Remove actually unused variable from sigreturn_restore
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-04 00:16:34 +04:00
Pavel Emelyanov
32b4a26c6b restore: Comment why we need copy data on task restore args
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-04 00:16:14 +04:00
Pavel Emelyanov
ebd76f4bec restore: Move sigpending out of sigreturn_restore
The sigreturn_restore is the place when we prepare the restorer
layout and jump to it. Reading and decoding images should be done
earlier. The new rst-malloc engine allows for that.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-04 00:15:39 +04:00
Pavel Emelyanov
91f797f66f restore: Move posix-timers out of sigreturn_restore
The sigreturn_restore is the place when we prepare the restorer
layout and jump to it. Reading and decoding images should be done
earlier. The new rst-malloc engine allows for that.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-04 00:15:15 +04:00
Pavel Emelyanov
ed88f2df66 restore: Move rlimits out of sigreturn_restore
The sigreturn_restore is the place when we prepare the restorer
layout and jump to it. Reading and decoding images should be done
earlier. The new rst-malloc engine allows for that.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-04 00:14:42 +04:00
Pavel Emelyanov
4f675313cc rst-malloc: Switch to private allocations once forked
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-03 17:40:15 +04:00
Pavel Emelyanov
ca0b51bc00 rst: Close logdir earlier
Just a code sanitation.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-03 17:37:10 +04:00
Pavel Emelyanov
3e235f715e restore: Get self maps after allocating necessary memory
We're filling some rst-mem data _after_ we get the self maps
list. This is a bug, since the restorer vma get forcedly mapped
into a place we get out of self-vmas-list.

Move the self-vmas-list getting after we allocate the memory
we need.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-03 17:23:31 +04:00
Ruslan Kuprieiev
95a961b739 log: don't kill task, if unable to write pidfile
write_pidfile() was taken out from cr-restore.c, where it was supposed to kill
child if unable to create pidfile. Now we're also using it at service/page-server where kill is redundant. So lets take out kill() from write_pidfile() back to cr-restore.

Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-03 12:51:13 +04:00
Pavel Emelyanov
45f39e0415 rst: Make shmem restore to use rst-malloc
This actually fixes a bug -- memory for shmem info was
not allocated dynamically, thus we were limited in the
amount of shmems to be restored.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-02 01:06:31 +04:00