[CRIU] [PATCH 0/4]posix-timer: Add posix timers to criu

Andrew Vagin avagin at parallels.com
Mon May 20 06:56:03 EDT 2013


On Mon, May 20, 2013 at 02:09:46PM +0400, Pavel Tikhomirov wrote:
> 2013/5/20 Andrew Vagin <avagin at parallels.com>
> 
>     On Mon, May 20, 2013 at 02:24:23AM +0400, Pavel Tikhomirov wrote:
>     > Hello,
>     >
>     > In this patch I want to add posix timers dump/restore to criu.
>     >
>     > In first patch I add little function which can replace timeval_valid,
>     > because it is not universal enough to take both timeval and timespec.
>     >
>     > Second patch stands for syscalls needed to opperate with timers.
>     >
>     > In third patch there are parasite function to get time from timers, and
>     > proc parsing one to parse /proc/<pid>/timers, and structures to save all
>     > info so also have saving functionality.
>     >
>     > In forth patch restore: read info from image, place it in allocated mem
>     > and remap it in region which will be shared. And when injected, restore
>     > timers and set them.
>     >
>     > problem: don't have functionality to set overrun when restoring, so it
>     > won't pass existing test in zdtm, time displacement fail will occure.
> 
>     Which operation fails in this case?
> 
> 
> In zdtm/live/static/posix_timers.c in the end of test (64-70 lines) it
> is checked that time passed on clock is equal to time passed on timer.
> But time on timer is based on overruns which don't restore good.

crtools must not corrupt a process state. Can we detect the situation,
which cannot be restored properly? crtools dump should return an error
in this case.

> 
> 
>     > (This test multiplies timer interval by overruns.)
> 
>     so you should add a new test case to test these patches.
> 
> 
> OK.
>  
> 
>     >
>     > Thanks, Pavel
>     >
>     > Pavel Tikhomirov (4):
>     >   posix-timer: Add time_valid() function
>     >   posix-timer: Add proper syscalls definition.
>     >   posix-timer: Add dump functionality and structures.
>     >   posix-timer: Add restore functionality and structures.
>     >
>     >  arch/x86/syscall-x86-64.def |    5 ++
>     >  cr-dump.c                   |   13 +++++
>     >  cr-restore.c                |  126
>     ++++++++++++++++++++++++++++++++++++++++++-
>     >  cr-show.c                   |    6 +++
>     >  image.c                     |    1 +
>     >  include/crtools.h           |    2 +
>     >  include/magic.h             |    1 +
>     >  include/parasite-syscall.h  |    2 +
>     >  include/parasite.h          |   16 ++++++
>     >  include/proc_parse.h        |   22 ++++++++
>     >  include/protobuf.h          |    1 +
>     >  include/restorer.h          |   21 ++++++++
>     >  include/syscall-types.h     |    2 +
>     >  include/util.h              |    8 +++
>     >  parasite-syscall.c          |   65 ++++++++++++++++++++++
>     >  pie/parasite.c              |   27 ++++++++++
>     >  pie/restorer.c              |   35 ++++++++++++
>     >  proc_parse.c                |  121
>     +++++++++++++++++++++++++++++++++++++++++
>     >  protobuf.c                  |    2 +
>     >  protobuf/Makefile           |    1 +
>     >  protobuf/posix-timer.proto  |   15 ++++++
>     >  21 files changed, 490 insertions(+), 2 deletions(-)
>     >  create mode 100644 protobuf/posix-timer.proto
>     >
>     > --
>     > 1.7.9.5
>     >
>     > _______________________________________________
>     > CRIU mailing list
>     > CRIU at openvz.org
>     > https://lists.openvz.org/mailman/listinfo/criu
> 
> 


More information about the CRIU mailing list