- 22 Aug, 2014 2 commits
-
-
Tycho Andersen authored
In particular, cpuset.cpus and cpuset.mems can both be "lists" (strings), as well as hex integers. We don't use the result of this parse, so it is fine to delete it. Signed-off-by:
Tycho Andersen <tycho.andersen@canonical.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Tycho Andersen authored
Signed-off-by:
Tycho Andersen <tycho.andersen@canonical.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 21 Aug, 2014 1 commit
-
-
Saied Kazemi authored
The AUFS support code handles the "bad" information that we get from the kernel in /proc/<pid>/map_files and /proc/<pid>/mountinfo files. For details see comments in sysfs_parse.c. The main motivation for this work was dumping and restoring Docker containers which by default use the AUFS graph driver. For dump, --aufs-root <container_root> should be added to the command line options. For restore, there is no need for AUFS-specific command line options but the container's AUFS filesystem should already be set up before calling criu restore. [ xemul: With AUFS files sometimes, in particular -- in case of a mapping of an executable file (likekely the one created at elf load), in the /proc/pid/map_files/xxx link target we see not the path by which the file is seen in AUFS, but the path by which AUFS accesses this file from one of its "branches". In order to fix the path we get the info about branches from sysfs and when we meet such a file, we cut the branch part of the path. ] Signed-off-by:
Saied Kazemi <saied@google.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 20 Aug, 2014 2 commits
-
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
Look at this strace output: 107 linkat(45, "", 1017, "./root/git/orig/criu/test/zdtm/live/static/unlink_fstat03.test (deleted)/link_remap.4", AT_EMPTY_PATH) = -1 ENOENT (No such file or director It's obvious, that we didn't cat the file name. Here is an error in calculation of offset for the last symbol. The current version of code sets this offset in strlen(), but it's actually strlen() - 1. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 19 Aug, 2014 20 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
We've moved signinfos on core entry, thus the bits with siginfo-s themselves cannot sit on stack any longer. Otherwise we would overwritem them with next batch and will feed stack pointer to the caller, thus causing a data and garbage on the stack to be written into image instead of siginfo data. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
The se variable is just an array of pointers on these objects. Need to allocate the objects themselves. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
And sanitize its usage a little bit. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
No need in extra variable for that. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
It fails on moving tasks into cpuset due to empty masks. Temporary disable the test. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Ruslan Kuprieiev authored
After this patch, signal-s*.img won't be created. v2: just move them to the end of array Signed-off-by:
Ruslan Kuprieiev <kupruser@gmail.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Ruslan Kuprieiev authored
Every thread has it's own private signals stored at thread_core->signals_p and leader thread has also shared signals stored at tc->signals_s. Signed-off-by:
Ruslan Kuprieiev <kupruser@gmail.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Ruslan Kuprieiev authored
We need it to be able to dump signals into cores before calling parasite_infect_seized(). Signed-off-by:
Ruslan Kuprieiev <kupruser@gmail.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Ruslan Kuprieiev authored
In order to save backward compatibility, criu will try to open signal*.img, if no signals_* are found. Signed-off-by:
Ruslan Kuprieiev <kupruser@gmail.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Ruslan Kuprieiev authored
We need to open cores for each thread early, because we'll need them to prepare signals later. Signed-off-by:
Ruslan Kuprieiev <kupruser@gmail.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Ruslan Kuprieiev authored
Add signal_queue_entry signals_s for shared signals to task_core_entry and signals_p for private signals to thread_core_entry. Signed-off-by:
Ruslan Kuprieiev <kupruser@gmail.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
The task_entries is a small structure used to coordinate the processes restore stages. Currentl we allocate one page for it and handle one separately. No need in this complexity, actually. The rst_mem engine is already capable to controll this small object. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
This is a position in the RM_SHREMAP memory. Since shmems are currently the only user of it, this is validly equals zero, but it will change soon. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Tycho Andersen authored
Signed-off-by:
Tycho Andersen <tycho.andersen@canonical.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Tycho Andersen authored
The motivation for this is to be able to restore containers into cgroups other than what they were dumped in (if, e.g. they might conflict with an existing container). Suppose you have a container in: memory:/mycontainer cpuacct,cpu:/mycontainer blkio:/mycontainer name=systemd:/mycontainer You could then restore them to /mycontainer2 via --cgroup-root /mycontainer2. If you want to restore different controllers to different paths, you can provide multiple arguments, for example, passing: --cgroup-root /mycontainer2 --cgroup-root cpuacct,cpu:/specialcpu \ --cgroup-root name=systemd:/specialsystemd Would result in things being restored to: memory:/mycontainer2 cpuacct,cpu:/specialcpu blkio:/mycontainer2 name=systemd:/specialsystemd i.e. a --cgroup-root without a controller prefix specifies the new default root for all cgroups. Signed-off-by:
Tycho Andersen <tycho.andersen@canonical.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
Transition and streaming tests can create many processes which are using cpu. CPU should be divided between tests fairly. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 18 Aug, 2014 1 commit
-
-
Garrison Bellack authored
When writing the system default for memory.limit_in_bytes (which is a LLONG_MAX) the write fails. The number is equivalent to -1 (unlimited). So during dump, store the number -1 instead. Change-Id: Iafccc96bf5dbade763d7addaeda24194616e4d5f Signed-off-by:
Garrison Bellack <gbellack@google.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 15 Aug, 2014 11 commits
-
-
Sophie Blee-Goldman authored
Needed for future user namespace support. Capabilities will have to be dumped from the parasite, ie from inside the namespace since there is no obvious way to 'translate' capabilities from the global namespace (unlike with uids and gids, where the id mappings can be used for translation). [ additional explanation from Andrew Vagin: "capabilities" are not translated between namespaces. They can exist only in one userns, where a process lives. If a process is created in a new userns, it gets a full set of capabilities in this userns, and loses all caps in a parent userns. So if capabilities are not shown in /proc/pid/stat, we have no way to get it except of using parasite code. ] Signed-off-by:
Sophie Blee-Goldman <ableegoldman@google.com> Acked-by:
Andrew Vagin <avagin@parallels.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Sophie Blee-Goldman authored
Moves the definition of kerndat_init() to below the definition of get_last_cap(). Needed for reading capabilities in a future patch. Signed-off-by:
Sophie Blee-Goldman <ableegoldman@google.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
Just to make sure we're not loosing signals after restore. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Acked-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Tycho Andersen authored
Signed-off-by:
Tycho Andersen <tycho.andersen@canonical.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Garrison Bellack authored
Because different kernel versions have different cgroup properties, criu shouldn't crash just because the properties statically listed aren't exact. Instead, during dump, ignore properties the kernel doesn't have and continue. Change-Id: I5a8b93d6a8a3a9664914f10cf8e2110340dd8b31 Signed-off-by:
Garrison Bellack <gbellack@google.com> Acked-by:
Tycho Andersen <tycho.andersen@canonical.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrew Vagin authored
We run tests concurrently and they can race for equal resources v2: fix hooks too Signed-off-by:
Andrew Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrew Vagin authored
We found a bug, when a second cgroup is restored incorrectly, so let's create one more empty cgroup. Signed-off-by:
Andrew Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrew Vagin authored
prepare_cgroup_dirs() gets a path and an offset. Then we add substrings to the source string and handle them. v2: fix one more place in prepare_cgroup_dir_properties() Cc: Tycho Andersen <tycho.andersen@canonical.com> Signed-off-by:
Andrew Vagin <avagin@openvz.org> Acked-by:
Tycho Andersen <tycho.andersen@canonical.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>
-
Andrey Vagin authored
When we open tty, we don't want to set it as controlling terminal. [xemul: We do it in all the other places, this one is forgotten. The "controlling tty" feature is setup explicitly later with the ioctl (TIOCSCTTY) call. ] This bug was caught by pty04. Where we get unexpected SIGCONT, which is sent after closing a controlling terminal. ./pty04 --pidfile=pty04.pid --outfile=pty04.out Dump 9578 Restore Test: zdtm/live/static/pty04, Result: FAIL ==================================== ERROR ==================================== Test: zdtm/live/static/pty04, Namespace: Dump log : /home/jenkins/workspace/Rpi-CRIU/test/dump/static/pty04/9578/1/dump.log --------------------------------- grep Error --------------------------------- ------------------------------------- END ------------------------------------- Restore log: /home/jenkins/workspace/Rpi-CRIU/test/dump/static/pty04/9578/1/restore.log --------------------------------- grep Error --------------------------------- (00.083420) Error (cr-restore.c:1092): 9578 killed by signal 0 (00.083708) Error (cr-restore.c:1713): Restoring FAILED. ------------------------------------- END ------------------------------------- ================================= ERROR OVER ================================= Reported-by: Mr Jenkins Signed-off-by:
Andrey Vagin <avagin@openvz.org> Acked-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
It's been discovered that on 3.11 we might fail on restore if pass @CLONE_PARENT flag into clone() call due to kernel limitations. Because we're treating 3.11 as a base working kernel lets do a trick instead - setup this flag iif pdeath_sig is present - if CLONE_NEWPID is passed warn a user about potential consequences. - because we need to carry the condition in attach_to_tasks call, introduce @root_as_sibling variable for this. CC: Tycho Andersen <tycho.andersen@canonical.com> CC: Pavel Emelyanov <xemul@parallels.com> CC: Andrey Vagin <avagin@openvz.org> Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Acked-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 14 Aug, 2014 3 commits
-
-
Andrey Vagin authored
I didn't find a way how to do that with help "unshare". It's simpler to write this program. It looks better than tricks in zdtm.sh. v2: proxify exit status Signed-off-by:
Andrey Vagin <avagin@openvz.org> Acked-by:
Serge E. Hallyn <serge.hallyn@ubuntu.com> Acked-by:
Ruslan Kuprieiev <kupruser@gmail.com> Acked-by:
Christopher Covington <cov@codeaurora.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
If criu process attaches to the root task (it happens for opts.swrk_restore and opts.restore_detach) with ptrace, then any signal delivered to the root would be also delivered to criu. The latter woult treat the former to die due to this delivery and would abort the restore. Fix it by checking that criu (current == NULL) gets ptrace notification (si_code == CLD_TRAPPED) about signal delivered (si_status = SIGCHLD, no other signals are allowed by the restoring tasks). This patch fixes the following error of static/zombie00: Execute zdtm/live/static/zombie00 ./zombie00 --pidfile=zombie00.pid --outfile=zombie00.out Dump 2207 Restore Test: zdtm/live/static/zombie00, Result: FAIL ==================================== ERROR ==================================== Restore log: /root/git/orig/criu/test/dump/static/zombie00/2207/1/restore.log (00.026826) Error (cr-restore.c:1085): 2207 killed by signal 17 (00.026985) Error (cr-restore.c:1706): Restoring FAILED. ================================= ERROR OVER ================================= Reported-by: Mr Jenkins Cc: Pavel Emelyanov <xemul@parallels.com> Cc: Tycho Andersen <tycho.andersen@canonical.com> Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Before the patch cg tree section from cgroup00 test looked like this { cnames: "name=zdtmtst" dirs: { path: "/subcg" children: { path: "/subcg/subsubcg" children: <empty> properties: <empty> } properties: <empty> } } this /subsg in the children is excessive. Turn this into directory names. Now the section looks like { cnames: "name=zdtmtst" dirs: { dir_name: "subcg" children: { dir_name: "subsubcg" children: <empty> properties: <empty> } properties: <empty> } } Signed-off-by:
Pavel Emelyanov <xemul@parallels.com> Acked-by:
Tycho Andersen <tycho.andersen@canonical.com>
-