- 27 May, 2016 18 commits
-
-
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 10 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>
-
Pavel Emelyanov authored
This removes double declaration of CLONE_NEWCGROUP. Also -- removes re-declaration of the CLONE_ALLNS in pstree.c. Tycho, the two CLONE_ALLNS-s we had differ from each other :) The one in pstree.c doesn't have CLONE_NEWCGROUP. I believe this was just a misprint :) tests seem to pass. Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com> Acked-by:
Cyrill Gorcunov <gorcunov@openvz.org> Acked-by:
Tycho Andersen <tycho.andersen@canonical.com>
-
- 06 May, 2016 7 commits
-
-
Andrei Vagin authored
00:24:30.269: 44: ERR: test.c:208: Test exited on unexpected signal It's a correct name for this function. For example, we use this name here criu/arch/ppc64/include/asm/atomic.h And you can find the same set of functions here: test/zdtm/lib/arch/aarch64/include/asm/atomic.h I think this code is more readable (understandable) than just return t - 1. Signed-off-by:
Andrew Vagin <avagin@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Andrew Vagin authored
=[log]=> dump/zdtm/static/unlink_fstat00/39/1/restore.log ------------------------ grep Error ------------------------ (00.097701) 4: Error (files-reg.c:1231): Can't link zdtm/static/unlink_fstat00.test/test\file' (00.097707) 4: Error (files-reg.c:1431): Can't link zdtm/static/unlink_fstat00.test/test\file' (00.097952) 1: Error (cr-restore.c:1404): 4 exited, status=1 (00.108085) Error (cr-restore.c:1407): 64 killed by signal 9: Killed (00.114341) Error (cr-restore.c:2246): Restoring FAILED. ------------------------ ERROR OVER ------------------------ v2: add a new test instead of changing the existing one. Signed-off-by:
Andrew Vagin <avagin@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Pavel Emelyanov authored
We expect: - all 9 scripts are called - there's always images dir variable - for 7 of those scripts there's root-pid variable Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com> Acked-by:
Andrew Vagin <avagin@virtuozzo.com>
-
Pavel Emelyanov authored
On restore root_item may exist, but its real pid is not yet resolved Fixes e5e8f791. Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com> Acked-by:
Andrew Vagin <avagin@virtuozzo.com>
-
Ruslan Kuprieiev authored
--record option allows us to keep track of files that are being installed by writing them to specified file. We can than use that file to do proper cleanup on uninstall. v2, drop -r, as we shouldn't really care about dirs, because setup.py doesn't report them to us. Signed-off-by:
Ruslan Kuprieiev <kupruser@gmail.com> Reviewed-by:
Dmitry Safonov <dsafonov@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Andrew Vagin authored
qemu-static from ubuntu/xenial contains a required fix and now we can execute compilation for ppc64le in travis. v2: rebase on criu-dev v3: set QEMU_CPU=POWER8 to avoid segfaults of qemu-ppc64le-static > > By default, both qemu and gcc5 produce code on ppc64el which will run on > > POWER7 platform. However, in debian gcc build instruction, gcc is explicitly > > built to produce code for POWER8 platform, which, obviously has additional > > instructions. v4: use ubuntu:trusty. xenial and wily has a bug: Processing triggers for libc-bin (2.21-0ubuntu4.1) ... /sbin/ldconfig.real: 5: /sbin/ldconfig.real: Syntax error: ")" unexpected /sbin/ldconfig.real: 5: /sbin/ldconfig.real: Syntax error: ")" unexpected v5: arm, x86, aarch64 were removed by mistake Signed-off-by:
Andrew Vagin <avagin@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Pavel Emelyanov authored
v2: Don't clear_breakpoints too. Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-