- 22 Jun, 2012 5 commits
-
-
Andrey Vagin authored
* Create helpers for processes which have been reparented to init. * Insert helpers in a process tree. * Helpers will exit after constructing a process tree. v2: fix variables names and check errors v3: add comments in code Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
They will be used for restoring sid. For example, if a session group leader is absent, a helper process is created with this id and it will die after restoring all other tasks. Before this patch restore failed if anyone exited. Now we should skip helpers, which exited successfully. It's a bit tricky. All children are collected in sigchld_handler, but we have a point, where we want to wait all helpers. For that waitpit is used and ECHLD is ignored, because it signs that a helper exited and has been waited in sigchld_handler. v2: check that me isn't NULL in the sig handler v3: move code about waiting helpers in a separate function Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
It will be used for allocating PIDs for helper tasks Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
s/pid/virt/ s/real_pid/real/ Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
to require dumping pid namespace. Dump and restore will be failed if a tress doesn't contain a process init. pid namespace will be created implicitly if a process init in the tree. v2: fix comments from Pavel v3: Restore of pidns should be approved by user Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 21 Jun, 2012 12 commits
-
-
Pavel Emelyanov authored
Current if/if/else scheme is ... not so easy to understand. Here's an attempt to make it more readable. Bonus: free comments. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
When creating transport we have to find the corresponding fle. Currently this is done by desc list scan %) but this is an overkill -- the required fle is already at our hands. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
In the open_fdinfo we need to get a file_desc associated with the given fdinfo_list_entry. This is done by searching the hash of descs, but this can be speeded up by saving the desc pointer on the fdinfo at the time of collecting them. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
because now it cares about tid_addr and thread id. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
Signed-off-by:
Andrey Vagin <avagin@openvz.org> Acked-by:
Victor konyashkin <vkonyashkin@parallels.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
xmalloc'ed gf and gf->path are not freed if something failed. Not a big deal since we're ususally interrupt program execution on error and do exit, but anyway. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
This eliminates holes in structures. No func changes. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
No need to carry static per-file variable, we need it in one non-recursive function only so make it stack based instead. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
Instead of spreading regular files handling code over files.c and cr-dump.c move it to files-reg.c. This allows to extend regular file handling code in future without disturbing other source files and make code logically coupled, where files.c is mostly a place for general file handling code unrelated to file type specifics. While mostly it was code tossing there is some change I have to notice -- the structure ghost_file was previously declared in two paces cr-dump.c and files.c, in cr-dump.c it was used for dumping while in files.c it was used for restore. The structure had different members. So to resolve this conflict the ghost_file structure was renamed to ghost_file_dumpee. Nothing else is changed. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
bash returned the error : No such file or directory and doesn't add three test cases to the list. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 20 Jun, 2012 5 commits
-
-
Pavel Emelyanov authored
The socket_desc is being looked up in dump_unix/dump_inet. In the dump_socket this desc is only required to obtain a family, which in turn can be done with a getsockopt. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
It's only required for making pipe_id, but making it is better to be done in place and using the st_ino only. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
Util it's very critical for speed we should not use unsafe sprintf helper, we're root-granted program and must be as safe as possible. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Evgeny Antyshev authored
new testcase important for rebootless update testing: we query system timer CLOCK_MONOTONIC continuously and fail in case it stepped backwards Signed-off-by:
Evgeny Antyshev <eantyshev@parallels.com> Acked-by:
Andrew Vagin <avagin@parallels.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 19 Jun, 2012 18 commits
-
-
Andrey Vagin authored
Now the most part of test cases may be executed in pidns. By default all test cases are executed in current pidns, then they are executed in new pidns again. v2: remove the hard coded path to test_init Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
Add a small program, which clones a process in new PIDNS and executes a test. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
Create a tmp directory and mount proc from a target pid ns. This proc will show pid-s from the target pid ns. crtools uses map_files for restoring sharing mappings. the tmp directory is removed after restore. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
open_proc_rw knows that proc may be mounted not in /proc, it's used for restoring tasks in pid ns. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
v2: rework this by using openat() and service fds for proc root. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
Now pid is dumped from pid ns, it's gotted from parasite. v2: fail if a zombie is in PIDNS Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
It uses pid for create image file and real_pid for dumping ns-s. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
because in collect_pstree we don't know pid-s of processes inside pidns Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
because a pid in a target pid ns is got from parasite. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
A pid namespace is created if a pid of the first task is 1. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
When we dump pid ns, dump_pstree is called after dump_tasks Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
If we try to dump a process from another pid ns, we have not another way to get its pid. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
Add struct pid and use it everywhere. This struct contains two fields: pid and real_pid. real_pid is a pid outside of the target pid namespace. pid is in the target pid namespace Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
Otherwise its value might be taken from heap (it's xmalloc'ed). Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
- align members - comment with empty line No func changes. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
It's static function near the file_desc_ops, no need for a long name. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
Checkpoint and restore do use fdtype_ops and file_desc_ops intensively so reorder pipes functions, this allow us to make them static and drop additional declarations. No func changes. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-