[CRIU] [PATCH 1/3] cr-restore: "post-resume" hook introduced

Andrew Vagin avagin at virtuozzo.com
Wed Apr 6 09:57:47 PDT 2016


On Wed, Apr 06, 2016 at 04:39:39PM +0200, Stanislav Kinsburskiy wrote:
> 
> 
> 06.04.2016 16:36, Andrew Vagin пишет:
> >On Wed, Apr 06, 2016 at 12:01:48PM +0300, Stanislav Kinsburskiy wrote:
> >>This hook is called at the very end, when everything is restored and processes
> >>were resumed.
> >>Can be used for some actions, which require operation container, like
> >>restarting of systemd autofs services.
> >>
> >>Signed-off-by: Stanislav Kinsburskiy <skinsbursky at virtuozzo.com>
> >>---
> >>  criu/action-scripts.c         |    1 +
> >>  criu/cr-restore.c             |    4 ++++
> >>  criu/include/action-scripts.h |    1 +
> >>  criu/mount.c                  |    1 +
> >>  4 files changed, 7 insertions(+)
> >>
> >>diff --git a/criu/action-scripts.c b/criu/action-scripts.c
> >>index 05aa9d0..b1f7952 100644
> >>--- a/criu/action-scripts.c
> >>+++ b/criu/action-scripts.c
> >>@@ -20,6 +20,7 @@ static const char *action_names[ACT_MAX] = {
> >>  	[ ACT_NET_UNLOCK ]	= "network-unlock",
> >>  	[ ACT_SETUP_NS ]	= "setup-namespaces",
> >>  	[ ACT_POST_SETUP_NS ]	= "post-setup-namespaces",
> >>+	[ ACT_POST_RESUME ]	= "post-resume",
> >>  };
> >>  int run_scripts(enum script_actions act)
> >>diff --git a/criu/cr-restore.c b/criu/cr-restore.c
> >>index 0720c07..2b11b71 100644
> >>--- a/criu/cr-restore.c
> >>+++ b/criu/cr-restore.c
> >>@@ -2198,6 +2198,10 @@ static int restore_root_task(struct pstree_item *init)
> >>  	if (!opts.restore_detach && !opts.exec_cmd)
> >>  		wait(NULL);
> >Here we are waiting when the root if opts.restore_detach isn't set. If
> >we passed this code, this means that the root task completed.
> >
> >ACT_POST_RESUME should be called before waiting the root task.
> 
> Sorry, I don't understand. Could you elaborate? "When the root" what? And
> what does "root task completed" means?

when the root will exit


More information about the CRIU mailing list