- 27 Oct, 2014 8 commits
-
-
Andrey Vagin authored
Currently we fill as much as posible data in a socket and then use half of these data to make a flow in the connection. These data is send and recv buffers. When a connection is dumped and restored, it needs time to go back to the normal work. In this time we can reliably fill only send buffers. So at the result the sockets may contain less data than required for heartbeating and the test will block. The test with this patch will monitor actuall size of data in a test socket. Cc: Konstantin Neumoin <kneumoin@parallels.com> Reported-by:
Konstantin Neumoin <kneumoin@parallels.com> Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
@action_names is rather a const array, so make sure we never access some data outside of it defining its size. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
In addition it checks that criu closes all its descriptors Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
strstr is a really heavy one, lets use already defined and filled @file_path variable instead. Reported-by:
Pavel Emelyanov <xemul@parallels.com> Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Acked-by:
Andrew Vagin <avagin@parallels.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
In criu we carry SysV memory via @VMA_AREA_SYSVIPC attribute but to the test must have a live reference to real memory area to check that shmem address was restored correctly. Add it. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Acked-by:
Andrew Vagin <avagin@parallels.com> 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
This would allow to restore parameters with user namespaces enabled. 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>
-
- 23 Oct, 2014 21 commits
-
-
Cyrill Gorcunov authored
Need to compare the /pts/ part in the former path, otherwise it will produce bogus /dev/pts/pts/index form. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
We need this only once -- while calling the mmap from remote context -- so it's enough to have on-stack variable. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com> Acked-by:
Andrew Vagin <avagin@parallels.com> Acked-by:
Cyrill Gorcunov <gorcunov@openvz.org>
-
Cyrill Gorcunov authored
Because directories are opened via direct mkdir call with name taken from ghost path don't postfix it with cr.%x.ghost, otherwise that's the name directory will have after restore complete causing cwd01 test to fail. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
Users don't like errors even if criu returns zero. So I suggest to start looking at them. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
In this case we have another chance to not skip errors. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
We don't support posix mqueues at the moment but in case if this fs is simply mounted and not used lets proceed without errors. In case if someone is using it we detect it because fs won't be empty and refuse to dump. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Konstantin Neumoin authored
This timeout is too small for tcp test cases. This timeout should be bigger than TCP_RTO_MAX 120 seconds Signed-off-by:
Konstantin Neumoin <kneumoin@parallels.com> Acked-by:
Andrew Vagin <avagin@parallels.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
v2: typo fix Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
It's bad idea to have only one target object. In addition I add a shared region to the second process, which is not mapped in the first. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
/proc/PID/map_files are protected by the global CAP_SYS_ADMIN, so we need to avoid using them to support user namespaces. We are going to use memfd_create() to get the first file descriptor and then all others processes will able to open it via /proc/PID/fd/X. In this patch memfd_create() is used to get a file descriptor, which is associated with a shared memory region. If memfd_create() isn't supported, the old scheme will be used. v2: don't set a name for memfd. It isn't required. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
/proc/PID/map_files are protected by the global CAP_SYS_ADMIN, so we need to avoid using them to support user namespaces. We are going to use memfd_create() to get the first file descriptor and then all others processes will able to open it via /proc/PID/fd/X. This patch reworks slave processes to not use map_files. v2: add more comments Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
v2: Follow the kerndat style that "features" are described just by global boolean variables. v3: give NULL as a name to get EFAULT if memfd_create is supported Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
Currently we're using predefined format for master/slave pty peers: masters are always /dev/ptmx, while slaves are /dev/pts/$index, where $index is the peer number. While fitting most of distros this is not always correct and slave peers might be mounted to an arbitrary place, so that we need to somehow carry paths with ourself in image. Instead of bloating current tty image lets use regular file engine instead and on checkpoint stage save a path to the link in regfiles set, then on restore simply fetch it from the image. Such approach will help in future when we need to support multiple instances of devpts filesystem. To support backward compatibility with images where no regfile records are present we generate new one on the fly in pty_alloc_reg() helper. Because of the need to restore dead slave peers and restore of the controlling terminal we need to generate that named "fake inverted" pty_alloc_fake_reg() helper: in particular if we need to open dead slave peer we generate fake master peer, open it and the close out. Almost the same situation in restoring contolling terminal -- we get master peer, generate appropriate fake slave object, open it, manipulate, then close it out and free. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Acked-by:
Tycho Andersen <tycho.andersen@canonical.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
The idea is to be able to lookup for special id which might be not present and we should not yield the error. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Acked-by:
Tycho Andersen <tycho.andersen@canonical.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
We will use reg-files engine for tty c/r so lets prepare scaffolds here preventing the engine to generate ghost files for PTY peers (mostly because one can't create slave peers without opening master peers first which is a sole part of tty engine itself). Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Acked-by:
Tycho Andersen <tycho.andersen@canonical.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
Otherwise this postfix will be accumulated on subsequent checkpoints. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Acked-by:
Tycho Andersen <tycho.andersen@canonical.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
We will need it for tty restore. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Acked-by:
Tycho Andersen <tycho.andersen@canonical.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
To use it in tty code even when file descriptor is not added into files chain. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Acked-by:
Tycho Andersen <tycho.andersen@canonical.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
We will use this path in reg-files engine anyway so simply switch to this ability now. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Acked-by:
Tycho Andersen <tycho.andersen@canonical.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
We will have to support more tty types in future so make calls depending on type of ttys. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Acked-by:
Tycho Andersen <tycho.andersen@canonical.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
Instead of calling case() with majors all over the places lets introduce own enum for tty types and use it instead. Because we're using not @major numbers now but taking @minors into account as well, this brings more strict check of which kind of terminals we can dump now thus it's potentially should fix the cases when we're trying to c/r terminals which we don't understand yet (in particular /dev/console [5:1]). Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Acked-by:
Tycho Andersen <tycho.andersen@canonical.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 17 Oct, 2014 1 commit
-
-
Andrey Vagin authored
We should not have a chance to exit with a wrong code on error paths. Now dump_one_task() returs zero, if allocation of dfds failed: ret = collect_mappings(pid, &vmas); if (ret) { pr_err("Collect mappings (pid: %d) failed with %d\n", pid, ret); goto err; } if (!shared_fdtable(item)) { dfds = xmalloc(sizeof(*dfds)); if (!dfds) goto err; ... err: return -1; Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 14 Oct, 2014 9 commits
-
-
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
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>
-
Andrey Vagin authored
Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Tycho Andersen authored
See the comment below for an explanation of what is going on. We will ultimately need to handle dumping the netlink data, but I think it is good to prevent injecting events into the stream during a dump. So we pre-load the modules, even though it isn't very pretty. Signed-off-by:
Tycho Andersen <tycho.andersen@canonical.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
They are not used outside. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
We don't set breakpoints for zombies. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 09 Oct, 2014 1 commit
-
-
Andrey Vagin authored
I found this solution in the LXC code. We can open the old root, call pivot_root(".", "."), call fchdir to the old root and call umount("."). Now restore will not fail, if the root is read-only. In addition it's a bit faster. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-