- 27 Jun, 2012 11 commits
-
-
Pavel Emelyanov authored
Two walkers -- in forward and reverse directions -- are required for correct (u)mounting of subtrees. Implement them using a helper macro which walks the tree in both directions. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Namespace restore goes in two steps -- first, clean old mountpoints (except root) that are left after clone(CLONE_NEWNS) call. Next, repopulate the namespace with new mountpoints (except root) read from the image file. This patch adds the skeleton for the above -- reading the mountpoints from current proc and image and calling for mount/umount. The real action will come in further patches. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Build a tree of mountpoins that can be (u)mounted in a straight (forward or backward) order without EBUSY errors. The tree is built in two steps -- first create hierarchy based on mount iDs. Next -- resort siblings in the path depth order. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Encode it in u32 since we have to check filesystem name anyway (not everyone ie easily migratable). Dump _any_ root fs as we need the root entry on restore though do not mount it then -- it should be provided before crtools restore start. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Dumping is straightforward -- just copy all the mount_info fields into the new image file. Dump everything but fstype, this one will come in a separate patch. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
This structure will be used on restore and will be created from the image, thus the name proc_ is not suitable. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
On the restore path this structure will be used and it will be better to have them char * rather than char[64]. When scanning proc use the %ms specifier for this. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
It's not required more, because parasite_status_t was removed. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Acked-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
In olden times, when people didn't know how to write, they sent a courier with a letter. Now we can write messages from parasite, so SET_PARASITE_RET may be dropped. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Looks good to me as well. Maybe we will refine messages to be able to identify where exactly parasite failed (say line). But it better to do in another patch. Acked-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
Signed-off-by:
Andrey Vagin <avagin@openvz.org> Acked-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 25 Jun, 2012 1 commit
-
-
Cyrill Gorcunov authored
Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Acked-by:
Andrew Vagin <avagin@parallels.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 22 Jun, 2012 14 commits
-
-
Cyrill Gorcunov authored
- add argument names - align members - add extern kw - group struct decl. on top - make file_desc_ops::type being unsigned integer similar to fdtype_ops::type Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
These are declared in files-reg.h, so get rid of them and add files-reg.h inclusion where needed. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
* check, that pseudoterminals are restored * check, that a control terminal is restred Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
2 2 session00 4 4 \_ session00 # {NEWSID, }, 2 5 \_ session00 # {0, }, 8 8 \_ session00 2 9 | \_ session00 # {CHANGESID, } 10 10 \_ session00 11 11 \_ session00 2 12 \_ session00 # {DOUBLE_CHANGESID | CHANGESID, } 2 3 session00 # {DETACH, }, 6 7 session00 # {DETACH|NEWSID, }, 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> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
Don't fail if a root non-init task has another sid, because it's inherited from parent and can't be restored and it's expected behaviour, when a subtree is dumped. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
Now crtools can restore sid in all cases. A restore of pgid will be added soon and now it will fail on restore. It's prevent testing of restoring SIDs. 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> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
It's sign, that a parent has been changed sid after forking a child. We should know a sid with which a process was born, because in a processes chain, more then one process might change SID. v2: fix names of variables v3: prevent rewriting of born_sid v4: Abort the restorer with error message if a born_sid can't be determing. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
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 2 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>
-