1. 26 Aug, 2014 4 commits
    • Andrey Vagin's avatar
      zdtm: fix compile errors of zdtm_ct · 6eab073c
      Andrey Vagin authored
      When "make test" is executed, CFLAGS is exported from the root Makefile.
      These flags define _GNU_SOURCE, so we don't need to define it in the
      souce file.
      
      In addition unistd.h isn't included, so a few functions are shown as undeclared.
      
      make zdtm_ns
      make[3]: Entering directory `/root/criu/test'
      gcc  -O2 -Wall -Werror -DCONFIG_X86_64 -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE    zdtm_ct.c   -o zdtm_ct
      zdtm_ct.c:1:0: error: "_GNU_SOURCE" redefined [-Werror]
       #define _GNU_SOURCE
       ^
      <command-line>:0:0: note: this is the location of the previous definition
      zdtm_ct.c: In function ‘main’:
      zdtm_ct.c:21:2: error: implicit declaration of function ‘fork’ [-Werror=implicit-function-declaration]
        pid = fork();
        ^
      zdtm_ct.c:23:3: error: implicit declaration of function ‘setsid’ [-Werror=implicit-function-declaration]
         if (setsid() == -1) {
         ^
      zdtm_ct.c:49:3: error: implicit declaration of function ‘execv’ [-Werror=implicit-function-declaration]
         execv(argv[1], argv + 1);
         ^
      zdtm_ct.c:62:3: error: implicit declaration of function ‘getpid’ [-Werror=implicit-function-declaration]
         kill(getpid(), WTERMSIG(status));
         ^
      cc1: all warnings being treated as errors
      Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
      Tested-by: 's avatarRuslan Kuprieiev <kupruser@gmail.com>
      Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
      6eab073c
    • Andrew Vagin's avatar
      cgroup: call fin_cgroup() on error paths · 28b0e16d
      Andrew Vagin authored
      fini_cgroup umounts a cgyard directory, which is mounted
      in prepare_cgroup().
      
      Reported-by: Mr Jenkins
      Signed-off-by: 's avatarAndrew Vagin <avagin@openvz.org>
      Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
      28b0e16d
    • Andrew Vagin's avatar
      cgroups: don't take into account a leading / for the "/" parent · c5c7272c
      Andrew Vagin authored
      Without this patch, we dump somethin like this:
      {
      	cnames: "hugetlb"
      	dirs: 	{
      		dir_name: ""
      		children: 		{
      			dir_name: "ewroot"
      			children: <empty>
      			properties: <empty>
      		}
      
      		properties: <empty>
      	}
      
      }
      
      It's obvious, that dir_name should be newroot.
      
      The problem is reproduced, if a task leaves in "/" and has a subgroup.
      This issue was caught by a chance. The cgroup02 test doesn't clean up
      controllers and leaves the "newroot" there. So when we executed a cgroup
      test after cgroup02, we could find many directories like "ewroot",
      "wroot", etc. This patch fixes this issue.
      Signed-off-by: 's avatarAndrew Vagin <avagin@openvz.org>
      Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
      c5c7272c
    • Filipe Brandenburger's avatar
      crtools: bump up the getopt return values to outside the ascii range · 601e5bb4
      Filipe Brandenburger authored
      The return values were getting dangerously close to the range of meaningful
      values, in particular the next candidate 63 is equal to '?' which is the
      typical return value in case of error.
      
      The return values for long options may be any integer, so bump them up to
      outside the ascii range, start above 1000. For ease of review this patch, keep
      the existing range (41-62) and increment each value by 1000.
      
      Tested:
      - Ran "criu --help", works fine.
      - Manual dump and restore with some of the options, worked fine.
      - Ran the zdtm test suite, tests passed.
      Signed-off-by: 's avatarFilipe Brandenburger <filbranden@google.com>
      Acked-by: 's avatarAndrew Vagin <avagin@parallels.com>
      Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
      601e5bb4
  2. 22 Aug, 2014 8 commits
  3. 21 Aug, 2014 1 commit
    • Saied Kazemi's avatar
      Added AUFS support. · d8b41b65
      Saied Kazemi authored
      The AUFS support code handles the "bad" information that we get from
      the kernel in /proc/<pid>/map_files and /proc/<pid>/mountinfo files.
      For details see comments in sysfs_parse.c.
      
      The main motivation for this work was dumping and restoring Docker
      containers which by default use the AUFS graph driver.  For dump,
      --aufs-root <container_root> should be added to the command line options.
      For restore, there is no need for AUFS-specific command line options
      but the container's AUFS filesystem should already be set up before
      calling criu restore.
      
      [ xemul: With AUFS files sometimes, in particular -- in case of a
        mapping of an executable file (likekely the one created at elf load),
        in the /proc/pid/map_files/xxx link target we see not the path
        by which the file is seen in AUFS, but the path by which AUFS
        accesses this file from one of its "branches". In order to fix
        the path we get the info about branches from sysfs and when we
        meet such a file, we cut the branch part of the path. ]
      Signed-off-by: 's avatarSaied Kazemi <saied@google.com>
      Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
      d8b41b65
  4. 20 Aug, 2014 2 commits
  5. 19 Aug, 2014 20 commits
  6. 18 Aug, 2014 1 commit
  7. 15 Aug, 2014 4 commits