v2: wrappers names become less obfuscating
This patch:
1) Updates function cr_fdset_open() to be suitable for handling fdset creation
for dump and show stages.
2) Replaces cr_fdset_open() by new wrapper function cr_fdset_dump().
3) Replaces prep_cr_fdset_for_restore() by new wrapper function cr_fdset_show().
Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
If an error happens during late restore stage, we better
exit with error than dive into endless loop.
The loop was useful at early prototype times,
but not now when we use zdtm test suite.
For example, force injected error now reports
| Restoring EXE (/home/crtools/test/zdtm/live/static/selfexe00)
| 764
| 11308
| Error (cr-restore.c:1280): 11308 exited, status=255
| Error (cr-restore.c:1412): Someone can't be restored
which is a way better than silent loop.
Reported-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
This patch removes collect stage and dumps tunables object right after
collect.
Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
In case of critical error is happened during checkpoint
procedure, the program should exit immediately.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
Unix diag and stat report dev_t-s in different formats. Cast one to
another when comparing in unix dumping.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
This patch adds ability to checkpoint/restore
/proc/pid/exe symlink, so if a process we've just
checkpointed has been say /path/to/exe, then at restore
time we bring this path back.
There some restiction from kernel side: if
existing /proc/pid/exe already mapped more than
once, the kernel will refuse to change the symlink,
so we need to restore it lately when mmaps of crtools
itself already unmapped (ie via late call in
restorer.c).
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
There's only one place with this, but the helper makes the code look
almost perfectly.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
This one reads a name from image, does preparations for bind and calls bind.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
They fully coincide now, just need to distinguish them by socket type.
Thus, add the type member on the unix_sk_listen and merge two hashes.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Structure used is the same, logic of connection is the same, and the
infrastructure is ready for this.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
The unix_dgram_peer coincides with the unix_conn_job.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
The unix_dgram_bound fully coincides with the unix_sk_listen.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
By the time we try to resolve datagram socket connection name the other
end may not yet be on the hash. Move the address resolution into the
conn job.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
The address length should be the real length, not the buffer size.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
crtools doesn't restore sockopts, so if a test is executed in
a second time bind() may return EADDRINUSE
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
v2: cleanup issues fixed
What's new:
1) cloning to new IPC ns depends on built option.
2) Check for lookup shared segment by key added.
3) Check for creation new segnent after migration added.
4) Few check for syscalls results added.
Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
Signed-off-by: Andrey Vagin <avagin@gmail.com>
Put echo to a separate line to
- keep the text within 80 columns
- visually check that the positions of semicolons are the same
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Andrey Vagin <avagin@gmail.com>
(1) We should use -w so we can't match a substring
(2) No need to use quotes
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Andrey Vagin <avagin@gmail.com>
If we use shift and $* in run_test(), there is no need to quote arguments.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Andrey Vagin <avagin@gmail.com>