1. 30 Oct, 2018 37 commits
  2. 27 Oct, 2018 3 commits
    • Rodrigo Bruno's avatar
      img: Introduce O_FORCE_LOCAL flag for images · d3ecc80e
      Rodrigo Bruno authored
       criu/image-desc.c    | 4 ++--
       criu/image.c         | 4 ++--
       criu/include/image.h | 1 +
       3 files changed, 5 insertions(+), 4 deletions(-)
      
      In order to prepare for remote snapshots (possible with Image Proxy and Image
      Cache) the O_FORCE_LOCAL flag is added to force some images not to be remote
      and stay as local files in the file system.
      Signed-off-by: 's avatarRodrigo Bruno <rbruno@gsd.inesc-id.pt>
      Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
      Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
      d3ecc80e
    • Pavel Emelyanov's avatar
      lib: Add simple Go wrappers for swrk mode · 3f994bcf
      Pavel Emelyanov authored
      We'll need some docs :) bu the API is
      
      criu := MakeCriu()
      
      criu.Dump(opts, notify)
      criu.Restore(opts, notify)
      criu.PreDump(opts, notify)
      criu.StartPageServer(opts)
      
      where opts is the object from rpc.proto, Go has almost native support
      for those, so caller should
      
      - compile .proto file
      - export it and golang/protobuf/proto
      - create and initialize the CriuOpts struct
      
      and notify is an interface with callbacks that correspond to criu
      notification messages.
      
      A stupid dump/restore tool in src/test/main.go demonstrates the above.
      
      Changes since v1:
      
      * Added keep_open mode for pre-dumps. Do use it one needs
        to call criu.Prepare() right after creation and criu.Cleanup()
        right after .Dump()
      
      * Report resp.cr_errmsg string on request error.
      
      Further TODO:
      
      - docs
      - code comments
      
      travis-ci: success for libphaul (rev2)
      Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
      Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
      3f994bcf
    • Pavel Emelyanov's avatar
      test, pipes: Exhaustive test of shared pipes · e51960ea
      Pavel Emelyanov authored
      So, here's the next test that just enumerates all possible states and checks
      that CRIU C/R-s it well. This time -- pipes. The goal of the test is to load
      the fd-sharing engine, so pipes are chosen, as they not only generate shared
      struct files, but also produce 2 descriptors in CRIU's fdesc->open callback
      which is handled separately.
      
      It's implemented slightly differently from the unix test, since we don't want
      to check sequences of syscalls on objects, we need to check the task to pipe
      relations in all possible ways.
      
      The 'state' is several tasks, several pipes and each generated test includes
      pipe ends sitting in all possible combinations in the tasks' FDTs.
      
      Also note, that states, that seem to be equal to each other, e.g. pipe between
      tasks A->B and pipe B->A, are really different as CRIU picks the pipe-restorer
      based in task PIDs. So whether the picked task has read end or write end at
      his FDT makes a difference on restore.
      
      Number of tasks is limited with --tasks option, number of pipes with the
      --pipes one. Test just runs all -- generates states, makes them and C/R-s
      them. To check the restored result the /proc/pid/fd/ and /proc/pid/fdinfo/
      for all restored tasks is analyzed.
      
      Right now CRIU works OK for --tasks 2 --pipes 2 (for more -- didn't check).
      Kirill, please, check that your patches pass this test.
      
      TODO:
      
       - Randomize FDs under which tasks see the pipes. Now all tasks if they have
         some pipe, all see it under the same set of FDs.
      Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
      Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
      e51960ea