- 17 Sep, 2012 16 commits
-
-
Cyrill Gorcunov authored
We're under lock anyway. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
Otherwise there is a race between files with same names: link(name -> ghost) link(name->ghost) open(name) unlink(name) open(name) -> ENOENT Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
One function is used on restoring and one is used on dumping, so each function has own prefix rst or cpt. The both functions have the same effect, so the main part of the names is same and it describes "unlock_tcp_connections". Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
network-script.sh is used for locking and unlocking network in CT. Here is an example of an LXC config: lxc.console=none lxc.utsname = test-lxc lxc.network.type = veth lxc.network.flags = up lxc.network.link = br0 lxc.network.name = eth0 lxc.mount = /root/test-lxc/etc/fstab lxc.rootfs = /root/test-lxc-root/ Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
Restore must not fail after unlocking connections. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
Early we moved prepare_shared() to a root task, because several preparation actions should be executed in a target namespace set (e.g.: ghost files). TCP sockets are a subset of init sockets, they should be unlocked before resume. It's convient to do from crtools. An image can't be read more than one time, because we want to send it via network. For this two reasons prepare_shared is spitted in two parts, one for crtools and one for a root task. 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
For another netns we don't need to lock separate connections, an external chanel can be locked. 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
because here are two types of entries Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
Scripts are executed when external actions required. CRTOOLS_SCRIPT_ACTION contains a required action. If a script doesn't know a current action, it should exit with 0. The first usecase will be lock/unlock network. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
TCP_REPAIR should be droppet when a network is unlocked. A network should be unlocked at the last moment, because after this moment restore must not failed, otherwise a state of a tcp connection can be changed and a state of one side in our image will be invalid. v2: use xremalloc instead of mmap and remmap Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
Use sys_setsockopt and declare a function in a header as "static inline" 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
Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
It shrinks code a bit. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 14 Sep, 2012 16 commits
-
-
Pavel Emelyanov authored
There are places when we have to select which fd to ->open and which to ->receive. To avoid deadlocks we sort them in an ascending order on { pid, fd } pair. Make this idea more formal by introducing an explicit function doing this check and call it where appropriate (pipe.c master selection is also simplified to fit new ... API). Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
The currently observed list entry should be examined, not the original one. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Don't do explicit switch by file type in files.c and don't export intimate knowledge of pty being master/slave. Use a file desc op for that. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
Until I figure out how to make them work in ns. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
We need to do two non-trivial things with ttys -- interconnect slaves to masters (or to each other) and setup ctl-tty restoring task. Now this is done in subsequently depending on each other steps: 1. collect ttys 2. interconnect slaves and mark ctl-tty tasks 3. collect fake fds for tty-ctl tasks 4. setup orphaned slaves We can relax this logic in two ways: 1. don't split marking ctl-tty tasks and then creating fds for them do it in one step at the end 2. don't interconnect slaves with masters and orphaned slaves in two steps -- do it in one place after fds are collected Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
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
In case if there is no master peer associated with a slave peer we have two cases - the master peer was closed before slave - we just have no master peer at all, but only slave one This patch addresses only first case -- we open fake master and hook slaves on it, then close it immediately. The second case will be addressed later. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
tty entries might have no parameters assigned if they are hanging on closed master, we should take into account when we do verify them. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
If we've met a hanging up terminal we can escape lot of work but dump a minimum information needed for restore. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
This patch squashes tty_get_sid, tty_get_pgrp into one tty_get_sid_pgrp helper (which allows to detect if dumping terminal is hanging up, the real use of this ability will be addressed in next patch). Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
The dangling slave peers might have no data associate with them if master peer is closed and link is hanging up. Thus make this parameters optional to not blow the image with data which never will be used. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
Add ability to use the same macros in restorer code. In the future we will add ability to show arguments like printf. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Instead -- mmap it once in root task and then mremap it later. No mremap of original restorer can be done, since in that case the restorer vma would be tied to crtools binary which in turn will make set-exe-file prctl to fail with EBUSY. Note -- after mremap the original vmas list becomes non relevant, but it's OK. Only new holes appear inside which is OK for munmap. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 13 Sep, 2012 1 commit
-
-
Pavel Emelyanov authored
This will avoid exec bit on restorer args and will make it possible for shared restorer eventually. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 12 Sep, 2012 6 commits
-
-
Pavel Emelyanov authored
There was a strange thing -- task args size is aligned, but when threads args ptr is get this alignment was lost. Fix this and make all the bufs page-aligned. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Put the states into in one place. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
pid == pid && fd == fd equals fle == fle :) Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 13 Sep, 2012 1 commit
-
-
Konstantin Khlebnikov authored
Testcase: fork child, chdir into /proc/$pid and kill child. test for http://bugzilla.openvz.org/show_bug.cgi?id=2315Signed-off-by:
Konstantin Khlebnikov <khlebnikov@openvz.org> Acked-by:
Andrey Wagin <avagin@gmail.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-