- 27 Mar, 2012 2 commits
-
-
Cyrill Gorcunov authored
Instead of open-coded u32 variables poking lets use futex_t type and appropriate helpers where needed. This should increase readability. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Acked-by:
Andrey Vagin <avagin@parallels.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
After we removed the pid from pstree image file the -t or -p option for show command no longer makes sense. Make 'show' mode rely on -D option to find out where to find the root (i.e. pstree.img) file. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 26 Mar, 2012 15 commits
-
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
This contains reg-files and sk-queues images, as they contain data which is potentially generated by every task, so keep it open all the time dump goes. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Current fdsets are ugly, limited (bitmask will exhaust in several months) and suffer from unknown problems with fdsets reuse :( With new approach (this set) the images management is simple. The basic function is open_image, which gives you an fd for an image. If you want to pre-open several images at once instead of calling open_image every single time, you can use the new fdsets. Images CR_FD_ descriptors should be grouped like _CR_FD_FOO_FROM, CR_FD_FOO_ITEM1, CR_FD_FOO_ITEM2, .. CR_FD_FOO_ITEMN, _CR_FD_FOO_TO, After this you can call cr_fd_open() specifying ranges -- _FROM and _TO macros, it will give you an cr_fdset object. Then the fdset_fd(set, type) will give you the descriptor of the open "set" group corresponding to the "type" type. 3 groups are introduced in this set -- tasks, ns and global. That's it. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Move pstree and sk-queues below, they are not per-task/-ns and will be global soon. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Write two helpers for opening an fdset for task and one for ns. This probably can be done with some "generic" macro(s), but this time it's simpler not to produce more code of that type. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
This patch does s/$fdset->fds[$nr]/fdset_fd($fdset, $nr)/ over the code. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Just use the open_image_ro for this. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
It's not required any longer. Now fdsets are allocated one-by-one only when required and there's no need in adding new fds to existing sets. Thus just remove the last arg from cr_fdset_open. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Move the fdset allocation inside dump_one_task and do it only for non-zombies. This makes sure we don't need to re-use an fdset, since we do allocate it only when required. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
This fd is global, so make it such. It will stop being just a global variable soon. Plus, remove the pid arg from format. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Don't allocate fdset to show sk queues and don't fail on pstree fd opening :) Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
This routine is used for dumping tasks, threads and zombies. For the last two the whole fdset is not allocated thus it will be better to use single fd in this case. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
It doesn't need the whole fdset actually. Plus, this makes new fdset implementation simpler. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Stanislav Kinsbursky authored
Pid number is redundant - this file is one for the whole tree. Signed-off-by:
Stanislav Kinsbursky <skinsbursky@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Stanislav Kinsbursky authored
Signed-off-by:
Stanislav Kinsbursky <skinsbursky@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 25 Mar, 2012 10 commits
-
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
This makes the code look cleaner and prepares the ground for better fmaps dumping Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Since now on the fdinfo image only contains plain fdinfo_entry-es. The tpye == FDINFO_REG files are described by regfiles.img entries and are matched by te ID in both. At dump stage each new ID generated results in a new entry in the regfiles.img. At restore stage open_fe_fd should open a regfile by the fdinfo's ID. Now this is done in suboptimal way, need to improve. Show shows both images separately. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
No colon at the end and handle empty ... set properly. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
This will be required to determine whether we should dump the respective file, or it was already dumped and we just re-use its id in fdinfo_entry. For special fd-s the ID is always new. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Make fdinfo_entry carry only the minimal info describing a file descriptor -- the fd value itself, the fd type (regular file, exe link, cwd, filemap and it will be pipes, sockets, inotifies, etc.) and the describing file ID. The mentioned ID will identify the type-d object, e.g. for regfiles this ID is already generated with file-ids.c code. The other part of this structure describes a regfile (i.e. a file opened with open syscall). I put this new entry at the end of the fdinfo_entry just to make the patching simpler. Soon this entry will be dumped into its own file. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
The namelen is u16, to cover the PATH_MAX u8 is not enough. The pos is u64, since file offset is that long indeed. The id is u32 as per previous patch. Fix printf-s respectively. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Don't print namelen (it's useless) and type (the code being patched works with FDINFO_REG only). Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
The unique id is 32 bit and consists only of the subid value. This is _really_ enough. The genid part is just a hint for the tree-search algirythm to avoid unneeded sys_kcmp calls. Plus, generate IDs for special files. This will make it easier to move the regfiles into into separate files (see the respective patch for details). Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 24 Mar, 2012 11 commits
-
-
Pavel Emelyanov authored
Use the open_fe_fd everywhere to obtain an fd from image. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
It is u32 and that is it :\ Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Just for debugging. Useful to know how the tree was built Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
The subtree node should be linked with common rbtree procedure. Otherwise the very first subtree insertion results in an infinite loop in the rb linking and balancing code. Plus, mark the root as static and add the subroot node initialization check. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Check for files with equal paths are handled" Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
It's actually useless for user, this field is for crtools only to find out when one fdinfo entry ends and the new one starts. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Open the exec link at fd restore stage as yet another service fd, then pass it to restover via args and just call prctl on it. This is good for several reasons -- the amount of code required for this is less and opening files should better happen before we switch to restorer (opening will be complex and it's MUCH easier to open all we need in one place). Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 23 Mar, 2012 2 commits
-
-
Stanislav Kinsbursky authored
Hide the structure - it's not required. [ xemul: Ranem long id into u32 id and adopt to current tree ] Signed-off-by:
Stanislav Kinsbursky <skinsbursky@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Stanislav Kinsbursky authored
This is a precursor patch. Macro for max possible fd type will be required. And it's easier to use enum in this case. Signed-off-by:
Stanislav Kinsbursky <skinsbursky@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-