cg: Remove unused id field from controllers message

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Acked-by: Tycho Andersen <tycho.andersen@canonical.com>
cg: Rename controllers field

We have to many controllers names in cgroup.c file.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Acked-by: Tycho Andersen <tycho.andersen@canonical.com>
show: Sanitze repeated fields showing routine

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
show: Always print tabs before braces

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
show: Don't continue showing messages with the descriptor of nested one

When we dive into showing nested message, the call to it will
overwrite the ctl->Arg field with the descriptor of the nested
one. As a result, after the call returns we continue showing
old message with new descriptor.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
cg: don't save cgroup directories twice

The path in cc->path here always has a "/" prefix since it comes from
/proc/$pid/cgroup. The additional / confuses the string slinging because ftw()
normalizes paths to have one "/" when we start traversing a subdirectory.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
ZDTM build fixes

Errors building natively for x86_64 on Ubuntu 12.04:

session02.c:142:13: error: ‘PR_SET_CHILD_SUBREAPER’ undeclared

session03.c:175:13: error: ‘PR_SET_CHILD_SUBREAPER’ undeclared

vdso01.c:300: undefined reference to `clock_gettime'

Error cross compiling for arm using Linaro 14.01 toolchain:

gcc: warning: ‘-mcpu=’ is deprecated; use ‘-mtune=’ or ‘-march=’ instead
cc1: error: unrecognized command line option ‘-mfpu=neon’
cc1: error: unrecognized command line option ‘-marm’
criu-rtc.c:1:0: error: bad value (cortex-a15) for -mtune= switch
cc1: error: unrecognized command line option ‘-mfpu=neon’
cc1: error: unrecognized command line option ‘-marm’
criu-rtc.pb-c.c:1:0: error: bad value (cortex-a15) for -mtune= switch

Errors cross compiling for aarch64 using Linaro 14.01 toolchain:

maps007.c: In function ‘main’:
maps007.c:88:4: error: passing argument 1 of ‘atomic_read’ from incompatible pointer type [-Werror]
    if (futex_get(&shm->stop) && atomic_get(&shm->delta) == MAX_DELTA)
    ^
In file included from ../../lib/lock.h:10:0,
                 from maps007.c:13:
../../lib/arch/aarch64/include/asm/atomic.h:14:19: note: expected ‘const atomic_t *’ but argument is of type ‘struct f
utex_t *’
 static inline int atomic_read(const atomic_t *v)
                   ^

ptrace.c: In function ‘main’:
ptrace.c:97:15: error: ‘PTRACE_GETREGS’ undeclared (first use in this function)
    if (ptrace(PTRACE_GETREGS, stopped, NULL, regs)) {
               ^

Signed-off-by: Christopher Covington <cov@codeaurora.org>
Reviewed-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
show: Merge fsize and show-fn getting switches

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
show: Initialize field->count early

This just makes ctl->cur initialized all in one place,
but not scattered all over the code.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
show: Rename loop index 'counter' into 'i'

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
show: Fix inet6 addresses showing

Was broken by d57be38c -- this one pretty show does return 1.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
protobuf: Cleanup typedefs a bit

No need to pollute typedef out of structure
statement since we don't use it in that form.
Simply typedef in place. And align members
while we're at it.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
cg: correctly detect co-mounted controller mount point

Before we would not detect the mount point for co-mounted controllers. Things
still worked because we'd just re-mount them ourselves and traverse our own
mount point, but this saves an extra mount().

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>