- 06 Apr, 2015 4 commits
-
-
Tycho Andersen authored
Signed-off-by:
Tycho Andersen <tycho.andersen@canonical.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
They both are using 'd' option in different context though, lets give them two names. 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>
-
Cyrill Gorcunov authored
Man, it was almost unreadable. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 03 Apr, 2015 3 commits
-
-
Andrey Vagin authored
setns(fd, CLONE_NEWNS) resets cwd and root, so we need to restore them back. Without this patch stats-dump isn't saved in the work dir: -rw-r--r-- 1 root root 32 Apr 2 14:21 /stats-dump Signed-off-by:
Andrey Vagin <avagin@openvz.org> Acked-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Oleg Nesterov authored
Which obviously can be used to "ignore" the mounts we do not want or need to dump. The user should know what he does. Note: this patch changes parse_mountinfo() to check should_skip_mount(). This is because imo we want to filter out the unwanted mounts asap, af if they do not exist. This increases the chances the dumping will fail if something else depends on this mount. Say, another mountpoint or an opened file. Perhaps it makes sense to teach should_skip_mount() to use fnmatch() and/or look at the optional "(fs|mnt)=" prefix to skip by fsname too. To me it would be better to force the user of this option to understand what it does. Say, if "dump" fails because the child mount can't find the skipped parent, he should add another --skip-mnt option or do not dump. Otherwise, if we do this automagically the user can probably be surpised, he might even miss the fact that we skip more than he asked. Signed-off-by:
Oleg Nesterov <oleg@redhat.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Oleg Nesterov authored
Preparation. 1. Add the new "bool for_dump" arg to collect/parse_mntinfo(). 2. Introduce "struct collect_mntns_arg" to pass the additional "bool for_dump" field to collect_mntinfo() and change it to pass this boolean to collect_mntinfo()->parse_mountinfo() path. 3. Change other callers of collect_mntinfo() to pass "false". Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 02 Apr, 2015 7 commits
-
-
Cyrill Gorcunov authored
They are confusing code readers. Lets save these @subtypes for Unix98 pty peers where they are really important. 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>
-
Cyrill Gorcunov authored
We will need it for tty testing. Based-on-patch-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
Opening current tty is tricky: first slave peer should be opened and session restored, and only then we can open /dev/tty. So that I made rst_info to carry additional list @tty_ctty where all current ttys get gathered and opened after slave peers were brought to live. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
pty_open_unpaired_slave must be called for pty peers only and it caused no problems so far but better to be sure it's pty peer we're restoring (there gonna be more drivers with time). Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
This is not pty specific routine but rather a common one. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
- rename @t to @type and use protobuf constants here instead - for special features use @subtype just like kernel does - get rid of TTY_TYPE_ constants, we don't need them - drop @flags, we don't need it anymore Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 01 Apr, 2015 3 commits
-
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@parallels.com> Acked-by:
Andrew Vagin <avagin@odin.com>
-
Cyrill Gorcunov authored
We have them in vma_entry_is_private() already. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
We have two helpers for VMA type testing: privately_dump_vma() and vma_priv(). They work with different types but basically do the same: check if we should dump VMA into the image and restore it back then. Lets unify they both into common vma_entry_is_private() helper and vma_area_is_private() for working with vma_area type. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 31 Mar, 2015 4 commits
-
-
Tycho Andersen authored
For some undiagnosed reason, this test hangs for me when using SIGINT. Since we always want to kill this process anyway, use SIGKILL instead. Signed-off-by:
Tycho Andersen <tycho.andersen@canonical.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Tycho Andersen authored
*can* reads that it might fail but won't. Instead, this comment means that any code added below it should not fail, because the network is unlocked and so the restored process is exposed to the world. 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>
-
Andrey Vagin authored
libcontainer saves PID in a state file. Signed-off-by:
Andrew Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 30 Mar, 2015 6 commits
-
-
Oleg Nesterov authored
This is pure theoretical, especially in this particular case when we actually want to (likely) free the unused memory. Still the code which ignores potential error doesn't look good. Signed-off-by:
Oleg Nesterov <oleg@redhat.com> Reviewed-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Oleg Nesterov authored
1. parse_mountinfo_ent() mixes "return -1" and "goto err" on failure, this looks confusing and inconsistent. 2. And buggy. It forgets to free(opt) if parse_mnt_flags() fails. Signed-off-by:
Oleg Nesterov <oleg@redhat.com> Reviewed-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Oleg Nesterov authored
The caller will do this on failure too. So this is unnecessary and wrong because we do not nullify ->mountpoint. Signed-off-by:
Oleg Nesterov <oleg@redhat.com> Reviewed-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Oleg Nesterov authored
1. parse_mountinfo() forgets to free(fst) if parse_mountinfo_ent() succeeds. 2. The usage of fst/r_fstype is ovecomplicated for no reason. Just change the parse_mountinfo() paths to populate/use/free this fsname unconditionally, and move the ownership to the caller. There is no reason to check FSTYPE__UNSUPPORTED and/or fallback to ->name. Better yet, we could even turn fsname into the local "char []" and avoid %ms and free(), but then we would need to pass the length of this buffer to parse_mountinfo_ent(). Signed-off-by:
Oleg Nesterov <oleg@redhat.com> Reviewed-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Oleg Nesterov authored
Preparation to simplify the review. parse_mountinfo() assumes that: 1. The "err:" block does all the necessary cleanups on failure. This is wrong, see the next patch. 2. We can never skip the mountpoint. This is true, but we are going to change this. s/goto err/goto end/ in the main loop, add the "end:" label which inserts the new mount_info into the list and then checks ret != 0 to figure out whether we need to abort. Signed-off-by:
Oleg Nesterov <oleg@redhat.com> Reviewed-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
This is required to use criu swrk in libcontainer. v2: remove useless function declaration allow to set inherit_fd only for swrk v3: check swrk out of loop Cc: Saied Kazemi <saied@google.com> Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Andrew Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 27 Mar, 2015 8 commits
-
-
Andrey Vagin authored
Use the format specifier PRIx64 instead of %lx to print uint64. integer. Reported-by: Mr Travis CI Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
This is logging routine, lets it not affect the global @errno. 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
The __print_on_level routine may modify global @errno variable which is inacceptable: this is logging routine which must be transparent to the rest of the program code. Thus save @errno in local @__errno variable and restore it on return. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Acked-by:
Andrew Vagin <avagin@parallels.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
Here is a real example how it's used. Cc: Tycho Andersen <tycho.andersen@canonical.com> Signed-off-by:
Andrey Vagin <avagin@openvz.org> Tested-by:
Tycho Andersen <tycho.andersen@canonical.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Oleg Nesterov authored
validate_mounts() prints ->mnt_id in hex when it reports the failure. This complicates the understanding because this ->mnt_id is printed as decimal elsewhere, including /proc/$pid/mountinfo. parse_mountinfo() adds "0x" at least and this is just pr_info(), but lets change it too. Signed-off-by:
Oleg Nesterov <oleg@redhat.com> Acked-by:
Andrew Vagin <avagin@openvz.org> Acked-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
mkdir: cannot create directory ‘zdtm.mpAWGL/holder’: File exists Reported-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
parse_smaps() is too big for easy reading. In addition, we are creating a new interface to get information about processes, which is called taskdiag, so parse_smaps() will do only what it should do accoding with the name. All other should be moved in a separate functions which will be reused to work with task_diag. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
parse_smaps() is too big for easy reading. In addition, we are creating a new interface to get information about processes, which is called taskdiag, so parse_smaps() will do only what it should do accoding with the name. All other should be moved in a separate functions which will be reused to work with task_diag. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 26 Mar, 2015 4 commits
-
-
Cyrill Gorcunov authored
For some reason it returns ENOENT sometime when run in namespace. Need to figure out why. Disable it for a while to continue testing the rest. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
inotify_irmap creates files in /etc so it should be able to do this from userns. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
Currenlty if criu fails before prepare_cgroup_properties(), cgyard isn't umounted. I think it's déjà vu, but it isn't :) commit 28b0e16d Author: Andrew Vagin <avagin@openvz.org> Date: Mon Aug 25 14:29:00 2014 +0400 cgroup: call fin_cgroup() on error paths Cc: Tycho Andersen <tycho.andersen@canonical.com> Cc: Saied Kazemi <saied@google.com> Signed-off-by:
Andrey Vagin <avagin@openvz.org> Acked-by:
Tycho Andersen <tycho.andersen@canonical.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Oleg Nesterov authored
1. The -ERESTART_RESTARTBLOCK case in get_task_regs() depends on kernel internals too much, and for no reason. We shouldn't rely on fact that a) we are going to do sigreturn() and b) restore_sigcontext() always sets restart_block->fn = do_no_restart_syscall which returns -EINTR. Just change this code to enforce -EINTR after restore, this is what we actually want until we teach criu to handle ERESTART_RESTARTBLOCK. 2. Add pr_warn() to make the potential bug-reports more understandable, a sane application should handle -EINTR correctly but this is not always the case. Signed-off-by:
Oleg Nesterov <oleg@redhat.com> Acked-by:
Cyrill Gorcunov <gorcunov@openvz.org> Acked-by:
Andrew Vagin <avagin@parallels.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 25 Mar, 2015 1 commit
-
-
Andrey Vagin authored
/proc/pid/pagemap is protected by the global CAP_SYS_ADMIN, so it can't be opened in a non-root userns. 00:34:48.260 Execute ns/user/static/cow01 ... 00:34:48.260 12:37:03.951: 4: ERR: cow01.c:87: Unable to open child pagemap file /proc/5/pagemap (errno = 1 (Operation not permitted)) Reported-by: Mr Jenkins Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-