• Andrey Vagin's avatar
    crtools: rework freeze of processes (v2) · bf678790
    Andrey Vagin authored
    Before this patch crtools freezes processes and if something is changed,
    it unfreezes all processes and starts again from the beginning.
    
    If if are going to dump fork-bomb, this method doesn't work. Because a
    big tree is always changed.
    
    We don't need unfreeze processes, which have been frozen and this patch
    does that.
    
    This patch uses depth-first search (DFS) for traversing a process tree.
    
    A root task is frozen at first turn, than a child is frozen, than a
    child of child and so on.
    
    When all children of one process are frozen, criu reads the list of
    children again and check that nothing changed. This processes continues
    until all of them will not be frozen. Afte that a new child can not be
    appeared, because all children for children are frozen too.
    
    v2: add comments in code
    Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
    Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
    bf678790
cr-dump.c 37 KB