- 27 May, 2016 26 commits
-
-
Pavel Tikhomirov authored
Signed-off-by:
Pavel Tikhomirov <ptikhomirov@virtuozzo.com> Reviewed-by:
Andrew Vagin <avagin@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Pavel Tikhomirov authored
use new SysctlEntry, leave old ipv4_conf_op as ipv4_conf_op_old for forward compatibility v4: use CTL_FLAGS_HAS instead of req[].has v5: use CTL_TYPE in sysctl_entries_equal v6: fix net_conf_op for string sysctls, add rconf to have requests conf at hand Signed-off-by:
Pavel Tikhomirov <ptikhomirov@virtuozzo.com> Reviewed-by:
Andrew Vagin <avagin@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Pavel Tikhomirov authored
int32 with boolean value in protobuf has the same size with bool, many sysctls are boolean but we don't lose anything by storing them in int32, so add only int32 and string fields will need string field for stable_secret ipv6 sysctl also such fromat allows us to easily handle non-present int sysctls we can check if we have it using has_*arg v3: rebase images/Makefile to criu-dev branch v4: use enum for type Signed-off-by:
Pavel Tikhomirov <ptikhomirov@virtuozzo.com> Reviewed-by:
Andrew Vagin <avagin@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Pavel Tikhomirov authored
v4: replace separate has pointer to CTL_FLAGS_HAS flag, second part in patch "net/ipv4: add net_conf_op to reuse for ipv6" v6: define CTL_FLAGS_HAS v7: also allow EIO on do_sysctl_op for optional sysctls like stable_secret and fix sysctl file to close in error path v9: add CTL_FLAGS_READ_EIO_SKIP to skip dumping stable_secret on EIO Signed-off-by:
Pavel Tikhomirov <ptikhomirov@virtuozzo.com> Reviewed-by:
Andrew Vagin <avagin@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Kirill Tkhai authored
MAP_FAILED is retval of lib'c mmap(). Direct syscall returns IS_ERR() in case of error. Signed-off-by:
Kirill Tkhai <ktkhai@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Andrew Vagin authored
criu dump should return an error in this case Signed-off-by:
Andrew Vagin <avagin@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Andrew Vagin authored
Here we try to enumerate all mount points and try to find one, which allows us to dump content of a file system. It's should be a root mount and its mount point should not be overmounted. We don't have a separate call-back to dump content of a file system. fstype->dump() isn't always requires access to a mount point (e.g. autofs), so we check overmounts in open_mountpoint(). $ cat /proc/61693/root/etc/redhat-release Fedora release 23 (Twenty Three) $ cat /proc/61692/mountinfo | grep '\s/tmp' 234 199 0:57 / /tmp rw shared:97 master:76 - tmpfs tmpfs rw,size=131072k,nr_inodes=32768 235 234 0:57 /systemd-private-dd74de99e1104383aa7cd6e27d3d0b8a-httpd.service-uFqNHk/tmp /tmp rw,relatime shared:98 master:76 - tmpfs tmpfs rw,size=131072k,nr_inodes=32768 v2: return an error if we can't dump a file system v3: try to find a mount point which allows to dump a file system v4: check that children are not overmounted a target mount instead of getting a mnt_id for a file descriptor. v5: add a special error code for unreachable mount points Signed-off-by:
Andrew Vagin <avagin@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Pavel Emelyanov authored
Next patch will put non-root task's PID into it, so this one is preparatory. But, as a bonus, we remove the need to unlink ths pid file in case of error :) Risk -- scripts might want to have pidfile, but we already have CRTOOLS_ROOT_PID environment in them for such cases. Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Andrew Vagin authored
Signed-off-by:
Andrew Vagin <avagin@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Tycho Andersen authored
Signed-off-by:
Tycho Andersen <tycho.andersen@canonical.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Tycho Andersen authored
Signed-off-by:
Tycho Andersen <tycho.andersen@canonical.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Andrew Vagin authored
gcc v6.0 and clang think that &next->pid.node can't be null. Here is an explanation from a kernel log (v3.12-5097-g1310a5a): """ the result of this expression is not defined by a C standard and some gcc versions (e.g. 4.3.4) assume the above expression can never be equal to NULL. The net result is an oops because the iteration is not properly terminated. """ $ gcc -v gcc version 6.0.0 20160406 (Red Hat 6.0.0-0.20) (GCC) $ python test/zdtm.py run -t zdtm/static/session00 ... $ gdb -c /tmp/core.61 criu/criu Program terminated with signal SIGSEGV, Segmentation fault. 598 if (&next->pid.node == NULL || next->pid.virt > pid) $ make CC=clang pstree.c:598:18: error: comparison of address of 'next->pid.node' equal to a null pointer is always false [-Werror,-Wtautological-pointer-compare] if (&next->pid.node == NULL || next->pid.virt > pid) Signed-off-by:
Andrew Vagin <avagin@virtuozzo.com> Acked-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Andrew Vagin authored
Signed-off-by:
Andrew Vagin <avagin@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Andrew Vagin authored
All task are collected in rbtree what allows us to search any task by a virtual pid for O(n log(n)). Signed-off-by:
Andrew Vagin <avagin@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Andrew Vagin authored
We already do this on restore to be able to search tasks by their virtual PID-s. Signed-off-by:
Andrew Vagin <avagin@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Andrew Vagin authored
Signed-off-by:
Andrew Vagin <avagin@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Andrew Vagin authored
Signed-off-by:
Andrew Vagin <avagin@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Andrew Vagin authored
The idea is to allow to dump and restore mounts of a specified block device. Options: dump: --external dev[MAJOR:MINOR]:VAL restore: --external dev[VAL]:DEVPATH If we find a mount with a specified block device, we set its type into FSTYPE__AUTO and write VAL into the "source" field. VAL is replaced on DEVPATH on restore. v2: use --ext-mount-map instead of --external on dump v3: clean up v4: use --external on dump and on restore v5: VAL:DEVPATH -> dev[VAL]:DEVPATH on restore Signed-off-by:
Andrew Vagin <avagin@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Cyrill Gorcunov authored
It never worked properly before because the pages might simply be not present in memory at all, so trying to fetch their contents via splice simply return the number of bytes successfully fetched which of course different from completed vma size. Thus correct implementation requires interactions with parasite page pulling: just read as much as kernel allows us and that's all. Util it's implemented -- zap it. Reported-by:
Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Cyrill Gorcunov authored
Reported-by:
Andrew Vagin <avagin@openvz.org> Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Acked-by:
Andrew Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Andrew Vagin authored
CID 159478 (#2 of 2): Resource leak (RESOURCE_LEAK) 8. leaked_handle: Handle variable sk going out of scope leaks the handle. Signed-off-by:
Andrew Vagin <avagin@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Andrew Vagin authored
Currently our pid allocator returns max_pid++ and it can return a pid which is bigger than kernel.max_pid. (00.821430) 5506: Error (cr-restore.c:1540): Pid 300 do not match expected 32768 v2: handle error code from insert_item() Signed-off-by:
Andrew Vagin <avagin@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Andrew Vagin authored
Currently we enumirate all children of the init task and if a task isn't a session leader, we create a helper, collect all children with this sid to the children list of this helper. When all children of the init task has been enumirated, we try to find a session leader for each helper. We use this way to enumirate all tasks only once. Now we are going to collect all tasks in rbtree, so we can find a sessial leader when we need it. It will not affect performance, because without searching a session leader, we can't add a helper to the tree. v2: rename lookup_pid to pstree_pid_by_virt use pstree_pid_by_virt in pstree_item_by_virt v3: handle session leaders in this patch too Signed-off-by:
Andrew Vagin <avagin@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Andrew Vagin authored
It will allow us to find a free pid and will speed up searching an item by pid. The current algorithm to searching a free pid may return a value bigger that kernel.max_pid. v2: add a coment before insert_pid() rename root_rb to pid_root_rb and make it "static" v3: rename insert_{pid,item} into lookup_create_{pid,item} Signed-off-by:
Andrew Vagin <avagin@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Andrew Vagin authored
Signed-off-by:
Andrew Vagin <avagin@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Andrew Vagin authored
I'm going to collect all pids in rbtree, but threads doesn't have pstree-entries, so we need a field to distinguish pstree_item-s from threads. Signed-off-by:
Andrew Vagin <avagin@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
- 16 May, 2016 2 commits
-
-
Pavel Emelyanov authored
This is bugfix mostly release again. Also did some tunes for better integration with OpenVZ (action scripts), updated to support newer kernels improvements and removed pagemap greedy mode and --namespaces option. Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Pavel Emelyanov authored
This thing was used in the ancient days when we didn't have /proc/pid/ns files as links. The only used of it (images w/o the ids.img file) has been already removed in 2.1, so probably it's time to drop the option itself. Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
- 13 May, 2016 3 commits
-
-
Cyrill Gorcunov authored
Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Cyrill Gorcunov authored
Being miss in first place. For tty-major we either should understand the driver we're handling, in the code above it's VT driver, so if minor is pointing somewhere else -- it's unknown tty. We need to look into every serial device we're going to support if we can c/r it without problem. Thus 'break' prevent us from potential problems. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Reviewed-by:
Dmitry Safonov <dsafonov@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Cyrill Gorcunov authored
We use test_msg helper inside alternative stack which in turn allocates TEST_MSG_BUFFER_SIZE by its own, so we increased the stack storage in @stack_thread and @stack_main but miss to inform the kernel about bigger stack size. Thus in worst scenario we can screwup the stack so provide proper size here. Reported-by:
Vasily Averin <vvs@virtuozzo.com> Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
- 10 May, 2016 9 commits
-
-
Andrew Vagin authored
if mountpoints of ct and t are equal we can't build absolute path in ct_mpnt_rpath, so let's skip the first "/" in m_root_rpath v2: add a comment Signed-off-by:
Andrew Vagin <avagin@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Andrew Vagin authored
Two mounts can be equal even it they are mounted in directories with different names. Signed-off-by:
Andrew Vagin <avagin@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Andrew Vagin authored
It isn't required and we will not have a limit for enabled file systems. v2: clean up v3: add a shortcut to get a mount file system v4: fix comments from Pavel Cc: Oleg Nesterov <oleg@redhat.com> Signed-off-by:
Andrew Vagin <avagin@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Wang Long authored
The commit dae14ddf does not drop the CLONE_NEWCGROUP correctly. Thsi patch fix it. Signed-off-by:
Wang Long <long.wanglong@huawei.com> Acked-by:
Tycho Andersen <tycho.andersen@canonical.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Cyrill Gorcunov authored
https://github.com/xemul/criu/issues/155Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Reviewed-by:
Dmitry Safonov <dsafonov@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Cyrill Gorcunov authored
Suitable for profiling. We've had this before 2.0. As earlier, pie code is not profiled as well as syscalls library. So simply build as "make GMON=1". Signed-off-by:
Cyrill Gorcunov <gorcunov@virtuozzo.com> Reviewed-by:
Dmitry Safonov <dsafonov@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Andrew Vagin authored
zero_page_pfn should be invalid if it isn't set to a real value. zero is bad, because pagemap returns zero pfn-s for non-root users. $ python test/zdtm.py run -t zdtm/static/env00 -k always -f h --user --norst ========================== Run zdtm/static/env00 in h ========================== Start test ./env00 --pidfile=env00.pid --outfile=env00.out --envname=ENV_00_TEST Run criu dump Wait for zdtm/static/env00 to die for 0.100000 ========================= Test zdtm/static/env00 PASS ========================== $ ./crit/crit show test/dump/zdtm/static/env00/24/1/pagemap-24.img { "magic": "PAGEMAP", "entries": [ { "pages_id": 1 }, { "vaddr": "0x7ffcfd5ed000", "nr_pages": 2 } ] } Signed-off-by:
Andrew Vagin <avagin@virtuozzo.com> Acked-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Dmitry Safonov authored
Fixes restoring on AMBA serial line. That is /dev/ttyAMA0, which is the default serial port to use on qemu-system-aarch64. (at least in those articles, which I meet it's in boot cmdline) Also should add support for C/R /dev/ttyUSB* One may check major numbers on https://www.kernel.org/doc/Documentation/devices.txt Also by grepping on kernel repository. Cc: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Dmitry Safonov <dsafonov@virtuozzo.com> Acked-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Dmitry Safonov authored
Seems like, device with TTY_MAJOR major and minor MIN_NR_CONSOLES is pointing to /dev/tty1 (first vitual console) and MAX_NR_CONSOLES is /dev/tty63. Cc: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Dmitry Safonov <dsafonov@virtuozzo.com> Acked-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-