- 18 Jan, 2013 15 commits
-
-
Pavel Emelyanov authored
It's no longer required to use this option -- two currently supported cases (tasks on host and tasks in containers) can be detected automatically. Keep this option for future. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Introduce the current_ns_mask variable, that collects info about which namespaces tasks being dumped and to be restored live in. For simlicity all tasks are supposed to live in one set of spaces. This should be fixed eventually. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
It's required to know whether the root task lives in namespaces very very early (e.g. -- to lock the network properly). Thus we have to collect task IDs right at the time we collect the tasks themselves. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
On restore we'll need to know whether the root task should be cloned in new set of namespaces. It's natural to do it by comparing root ids with some "other-world" IDs. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
The recent kernels allow to get namespaces IDs by reading proc-ns links. Use this to generate IDs for tasks' namespaces (I do generate them, since IDs provided by kernel look ugly :( ). 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>
-
Alexander Kartashov authored
Signed-off-by:
Alexander Kartashov <alekskartashov@parallels.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Alexander Kartashov authored
These functions are designated to convert a native pointer to uint64_t used to store a virtual address in protobuf messages and vice versa in a machine-independent way. Signed-off-by:
Alexander Kartashov <alekskartashov@parallels.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Alexander Kartashov authored
The patch reverts the commit 58064d9b. Signed-off-by:
Alexander Kartashov <alekskartashov@parallels.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Alexander Kartashov authored
If a task executes a non-userspace code (that sometimes takes place on ARM) while being seized the subsequent infection with the syscall blob fails because ptrace fails to write to the VMA the PC is in. The patch modifies the function get_vma_by_ip() to check the PC of the task being seized is below the TASK_SIZE boundary. If the check fails the first suitable VMA is infected. Signed-off-by:
Alexander Kartashov <alekskartashov@parallels.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Alexander Kartashov authored
This patch prevents compilation warnings about shift overflow on ARM. Signed-off-by:
Alexander Kartashov <alekskartashov@parallels.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Alexander Kartashov authored
The macro specifies the size of the machine pointer explicitly. Signed-off-by:
Alexander Kartashov <alekskartashov@parallels.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Alexander Kartashov authored
Signed-off-by:
Alexander Kartashov <alekskartashov@parallels.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Alexander Kartashov authored
This patch fixes format strings in newly added code. Signed-off-by:
Alexander Kartashov <alekskartashov@parallels.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 17 Jan, 2013 15 commits
-
-
Cyrill Gorcunov authored
Reported-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Kinsbursky Stanislav authored
This part was lost after update to "sysctl" interface for IPC object ID specifying (previous, currently obsolete, interface was able to pass proper credentials with KEY change) . Signed-off-by:
Stanislav Kinsbursky <skinsbursky@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Kinsbursky Stanislav authored
Signed-off: Stanislav Kinsbursky <skinsbursky@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
Oracle has such mappings. v2: add check, that a file is a character device Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Qiang Huang authored
We check shared lock, exclusive lock and mandatory-read lock for flock file locks. After restore, by parsing /proc/locks file, we check if the process holds the same file locks as it was dumped. Signed-off-by:
Qiang Huang <h.huangqiang@huawei.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Qiang Huang authored
We check read lock and write lock for posix file locks. After restore, we use fcntl(fd, F_GETLK, &lock), to see if the file is hold the same lock as it was dumped. Signed-off-by:
Qiang Huang <h.huangqiang@huawei.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Qiang Huang authored
Signed-off-by:
Qiang Huang <h.huangqiang@huawei.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Qiang Huang authored
According to the file lock information from the image, we recall flock or fcntl with proper parameters, so we can rehold the file locks as we were dumped. We only support flock and posix file locks so far. Changelog since the initial version: a. Use prepare_file_locks instead of restore function directly. b. Fix some bugs. Originally-signed-off-by:
Zheng Gu <cengku.gu@huawei.com> Signed-off-by:
Qiang Huang <h.huangqiang@huawei.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Qiang Huang authored
Dump file locks' necessary entries to the image, we only support flock and posix file lock right now. Changelog since the initial version: We got file lock info from global list, so the dump_task_file_locks can be much simpler. Originally-signed-off-by:
Zheng Gu <cengku.gu@huawei.com> Signed-off-by:
Qiang Huang <h.huangqiang@huawei.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Qiang Huang authored
We collect all file locks to a golbal list, so we can use them easily in dump_one_task. For optimizaton, we only collect file locks hold by tasks in the pstree. Thanks to the ptrace-seize machanism, we can aviod the blocked file lock issue, makes the work simpler. Right now, the check handles only one situation: -- Dumping tasks with file locks hold without the -l option. This covers for the most part. But we still need some more work to make it perfect robust in the future. Signed-off-by:
Qiang Huang <h.huangqiang@huawei.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Qiang Huang authored
Sometimes, when we parse some global info files, we can only care about tasks which are taken into dump(such as file locks), which means their pids are in the pstree. So a function like this would be help. Signed-off-by:
Qiang Huang <h.huangqiang@huawei.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Qiang Huang authored
Some contents needed by filelock's image. Originally-signed-off-by:
Zheng Gu <cengku.gu@huawei.com> Signed-off-by:
Qiang Huang <h.huangqiang@huawei.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Qiang Huang authored
Add a callback for filelock's image show. Originally-signed-off-by:
Zheng Gu <cengku.gu@huawei.com> Signed-off-by:
Qiang Huang <h.huangqiang@huawei.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Qiang Huang authored
We need a new protobuf description for file-lock. Originally-signed-off-by:
Zheng Gu <cengku.gu@huawei.com> Signed-off-by:
Qiang Huang <h.huangqiang@huawei.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Qiang Huang authored
Add --file-locks/-l option to support handling file locks, for safety, only used for container. Originally-signed-off-by:
Zheng Gu <cengku.gu@huawei.com> Signed-off-by:
Qiang Huang <h.huangqiang@huawei.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 16 Jan, 2013 10 commits
-
-
Alexander Kartashov authored
This workarounds a compilation warning on ARM: packet-sock.pb-c.c: In function 'packet_sock_entry__init': packet-sock.pb-c.c:98:3: error: this decimal constant is unsigned only in ISO C90 [-Werror] packet-sock.pb-c.c: At top level: packet-sock.pb-c.c:318:1: error: this decimal constant is unsigned only in ISO C90 [-Werror] Signed-off-by:
Alexander Kartashov <alekskartashov@parallels.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Alexander Kartashov authored
This patch replaces the format specifier %ld with PRIx64 in the following places: * the format string argument of the functions scanf() and printf(), * in the macros GEN_SYSCTL_*_FUNC. We need explicit specification of the integer size there. Signed-off-by:
Alexander Kartashov <alekskartashov@parallels.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Alexander Kartashov authored
The layout of the struct rlimit depends on the value of the macro FILE_OFFSET_BITS. If FILE_OFFSET_BITS is 64 the userspace and kernel definitions becomes incoherent on a 32-bit platform. The struct krlimit representing the kernel version of the struct rlimit is introduced to address the issue: the function restore_rlims() is fixed to convert between the userspace and kernel representations of the struct. Signed-off-by:
Alexander Kartashov <alekskartashov@parallels.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Alexander Kartashov authored
This makes it possible to use TASK_SIZE instead of TASK_SIZE_MAX. Signed-off-by:
Alexander Kartashov <alekskartashov@parallels.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Alexander Kartashov authored
Signed-off-by:
Alexander Kartashov <alekskartashov@parallels.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
I occasionally read FanotifyMarkEntry object as InotifyWdEntry in collect_one_fanotify_mark, this didn't trigger a bug in test since the events are still occured (and before protobuf file refine the formats were close to each other), which means the fanotify00 test-case need to be updated (which is addressed in further patch). And don't forget to init fields. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
The object is allocated with malloc. The lack of initialization is not problem at moment since we assign members in collect_inotify_mark unconditionally but it might cause problems in future so better to init it as early as possible. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
Just reading if event entry exist in buffer is not enough we rathee need to be sure that all flags and bits are recovered well. For this sake we parse fdinfo before and after the c/r sessions and compare results. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
Just missed it in first place. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
To be consistent with naming (we have collect_one_fanotify_mark helper already). Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-