- 19 Apr, 2012 3 commits
-
-
Cyrill Gorcunov authored
No need to duplicate variable for pie.lds.S. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
Should be -fpie (actually it's not a problem at moment since asm files have simple code and work even without -fpie passed, but better to fix it anyaway). Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
In case if dgram socket peer is not connected back we can try to resolve peer by name. For security reason this happens only if '-x' option is passed at checkpoint and restore time. In particular this is needed for programs which do use dgram socket to send messages to /dev/log. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 18 Apr, 2012 19 commits
-
-
Pavel Emelyanov authored
It's unused, but makes show command show 0, not trash. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
At early days we've been using only a few syscalls which together with debug compiler options always produce relative addresses for memory variables used in parasite and restorer blobs. Thus it came in unnoticed that there is something worng with syscalls declarations we use. Basically all our syscalls are just a wrappers over inline assembly code in form of static long syscall2(int nr, long arg0, long arg1) { long ret; asm volatile( "movl %1, %%eax \t\n" "movq %2, %%rdi \t\n" "movq %3, %%rsi \t\n" "syscall \t\n" "movq %%rax, %0 \t\n" : "=r"(ret) : "g" ((int)nr), "g" (arg0), "g" (arg1) : "rax", "rdi", "rsi", "memory"); return ret; } so every argument treated to be plain long (even if the call sematics implies it's a memory address passed but not some integer direct value) and transferred via general purpose register. As being mentioned it caused no problems when debug options specified at compile time, the compiler do not tries to optimize addressing but generates code which always compute them. The situation is changed if one is building crtools with optimization enabled -- the compiler finds that arguments are rather plain long numbers and might pass direct addresses of variables, instead of generating relative addresses (because function declarations have no pointers and 'g' in cope with 'mov' is used, which is of course wrong). To fix all this -- now syscalls declarations are generated from syscall.def file and function arguments are passed in conform with x86-64 ABI. This shrinks amount of source code needed to declare syscalls and opens a way to use optimization. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
Inline assembly is very convenient if a couple of instructions is used but when it grows better to move it out of wrapper C code and write in plain assembly, after all we need a very precise control in bootstrap code. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
Since the blob files are generated a different way in compare with plain compiling we use for regular *.c files -- add own Makefile.pie for this target. This increases readability of general Makefile and Makefile.pie itself. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
Instead of generating offsets from early compiled object files (one day the offsets obtained from there might be changed during linkage stage) better to get them from a final stage where all object files involved are linked into complete binary blob. That happened that at early stage we indeed were using only single file per parasite and restorer but at present there a couple of file involved (and will be more in future) so we need a safe approach. Also note the symbols being exported are prefixed as "__export_". This is easier approach for now. Putting such symbols into separate section requires a way more efforts to handle. The main reason of having two files (Elf object and binary blob) is to get 1:1 mapping between symbols definition and their position in binary target. The exported symbols name addresses are obtained from object file and used as offsets in binary target. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
Build one "section for all" only. This reflects what we really do runtime with generated parasite and restorer blobs. Signle section is named as ".crblob". Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Don't re-read fdinfo image 4 times on restore, just use those collected on me pstree_entry instance. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Later we'll be able to restore them without re-reading the fdinfo file again. 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>
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
The plan is to put collected resources on this to avoid seeking the image. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
To follow convention as declared in kernel. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
First argument is void pointer Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
This brings hardness into syscall trasition to asm code, pass this constants in callers. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
Will need it for syscalls design transition. 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
Since we're generating blobs for execution better to use -fpie which serves for such things. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
They are identical, no need to carry two copies. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 17 Apr, 2012 1 commit
-
-
Cyrill Gorcunov authored
The task name may include spaces so %s scanning format will fail (in particular dumping rsyslogd fails since thread has name "rs:main Q:Reg"). Fix it. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 16 Apr, 2012 8 commits
-
-
Konstantin Khlebnikov authored
On some systems PAGE_SIZE is declared as sysconf(_SC_PAGESIZE) in <sys/user.h> this is non-constant expression, so it cannot be used in type declarations. This breaks compilation with a very non-obvious error message: CC parasite-syscall.o In file included from parasite-syscall.c:30:0: ./include/parasite.h:90:8: error: variably modified ‘fds’ at file scope crtools doesn't uses anything from <sys/user.h>, so we can drop its usage. Signed-off-by:
Konstantin Khlebnikov <khlebnikov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
By now equip all the short options with respective long one. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
This avoids two duplicate lines. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
The message "Got fd for %d" is non-informative, change it to "Restoring fd %d" since that is what function does. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
Our loggin engine prints file:line only at invoke point, so it's unable to see where exactly reopen_fd_as_safe is failed. With this patch the output is more human readable | Error (util.c:96): fd 7 already in use (called at files.c:359) Ideally we need full backtrace here, but it's different task. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Kinsbursky Stanislav authored
Signed-off-by:
Stanislav Kinsbursky <skinsbursky@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Kinsbursky Stanislav authored
Command below was executed several times: sed 's/\(pr_.*[^%,x,X]\)\(\%[0-9,l,L]*x\)/\10x\2/g' -i *.c Signed-off-by:
Stanislav Kinsbursky <skinsbursky@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
Make sense in multiline cases only. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 13 Apr, 2012 8 commits
-
-
Cyrill Gorcunov authored
When set up mm::code/data addresses the kernel expects the correspond VMAs to have predefined protection, but task might have dropped or mprotected those VMAs at moment of checkpoint. So just setup fake VMAs, call prctl and munmap them immediately. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
Util we have kernel support. [ xemul: MySQL uses runaway pgid and sid and we cannot restore it gracefully with exiting API :( Byt MySQL seem not to care about pgid and sid change after restore, so ignore this for a while ] Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
To line the constants up. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
Some ino/peers are printed with %d, some with %x, get rid of it and print all in %x. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
This includes existing test and a new one, checking that unlinked hardlinks are handled properly. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Completely unlinked file is the one with n_link count being zero. Such files only allow to read their contents and carry with us. In order to dump this thing I introduce the "path remap" technology. For reg file a remapping entry is dumped which describes, that at restore stage before opening a regfile->path this path should be linked to some other name and then (after open) unlinked. For completely unlinked files the remap path would be a path to a "ghost" file, i.e. a file which is created only at the time of restore and which is removed completely at the end of it. Partially unlinked files (i.e. those having n_link != 0, but a path by which we see them in someone's fd is not accessible) should be handled in another way. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Will be required to dump completely unlinked files. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
This is trivial. Just copy-n-paste pieces from the udp dumping and restoring code. The zdtm test is also a compy of the _udp test with respecitve changes. Reuired for httpd, this one uses udplite sockets. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 12 Apr, 2012 1 commit
-
-
Cyrill Gorcunov authored
In case if unix socket was not found don't call for container_of. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-