make: cleanup the whole infrastructure a bit

Main things:
1) Variables are defined properly (":=" or ":=" instead of "+"). Otherwise,
because we call nested makefiles, and such variables like CFLAGS are
inheriting it's previous state.
2) SYS-OBJ renamed to SYSCALL-LIB.
3) Inlcude of Makefile.inc removed from protobuf/Makefile

Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Looks-good-to: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
make: move syscalls files and build to separated directory

This patch set moves all syscalls data to "arch/$(ARCH)" directory ("arch/x86"
in this particular case).
It does also some cleanup to syscalls-x86-64.sh.

Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Looks-good-to: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
make: move pie files and build to separated directory

Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Looks-good-to: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
make: cleanup pie build

This patch simplifies pie build. Main change is replaces explicit rules by
implicit which reduces Makefile size and makes it more readable.

Notes:
1) intermediate build files are preserved.
2) Both blobs are linked with util-net.o. Restorer blob doesn't require it,
but this allows to avoid explicit rule for it.

v3:
1) Fixed parasite build.
2) Fixed blobs deps - %.bin and %.bin.o can now be build in parallel.
3) Updated restorer link: restorer is not linked with util-net.o anymore.

Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Looks-good-to: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
make: insert Makefile.inc into Makefile

Makefile.inc is included only into Makefile now. So let's insert it's content
into Makefile itself.

Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Looks-good-to: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
test/app-emu: dump/restore of VNC server

* Execute VNC server and glxgears
* Dump/restore
* Check, that VNC server accepts connections

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
tty: Don't flush tty data on checkpoint stage

In case if we're dumping the peer which another
end belongs not to us but some other application
the attempts to flush data may lead to endless
SIGTTOU storm:

 | 1158  ioctl(53, TCFLSH, 0x2)            = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
 | 1158  --- SIGTTOU {si_signo=SIGTTOU, si_code=SI_KERNEL, si_value={int=5, ptr=0x5}} ---
 | 1158  --- stopped by SIGTTOU ---
 | 1158  ioctl(53, TCFLSH, 0x2)            = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
 | 1158  --- SIGTTOU {si_signo=SIGTTOU, si_code=SI_KERNEL, si_value={int=5, ptr=0x5}} ---
 | 1158  --- stopped by SIGTTOU ---

so simply don't flush data, the initial attempt to use
TCIOFLUSH was rather "hey, we don't have a way to
say the kernel to freeze tty link for a while, lets
try to workaround this limitation" but without proper
kernel help this won't work anyway as Andrey has discovered.

Reported-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
test/app-emu: add options --shell-job

[xemul: s/-j/--shell-job/g]

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
test/app-emu: wait while tasks are dying before starting restore

Otherwise some PID-s may be busy.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
test: add a script for executing all app-emu test cases

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>