[CRIU] criu [PATCH] post-setup-namespaces

Andrew Vagin avagin at virtuozzo.com
Mon Jan 25 13:45:36 PST 2016


On Tue, Jan 19, 2016 at 03:10:12PM +0300, Igor Sukhih wrote:
> Introduce post-setup-namespaces action script
> 
> It needed to have possibility to run cutom script after mount
> namespace is configured
> 

> Introduce post-setup-namespaces action script
>    
> It needed to have possibility to run cutom script after mount
> namespace is configured
> 

Acked-by: Andrew Vagin <avagin at virtuozzo.com>

> Signed-off-by: Igor Sukhih <igor at parallels.com>
> 
> diff --git a/action-scripts.c b/action-scripts.c
> index 3a6e801..05aa9d0 100644
> --- a/action-scripts.c
> +++ b/action-scripts.c
> @@ -19,6 +19,7 @@ static const char *action_names[ACT_MAX] = {
>  	[ ACT_NET_LOCK ]	= "network-lock",
>  	[ ACT_NET_UNLOCK ]	= "network-unlock",
>  	[ ACT_SETUP_NS ]	= "setup-namespaces",
> +	[ ACT_POST_SETUP_NS ]	= "post-setup-namespaces",
>  };
>  
>  int run_scripts(enum script_actions act)
> diff --git a/cr-restore.c b/cr-restore.c
> index f9621b6..f2e71f4 100644
> --- a/cr-restore.c
> +++ b/cr-restore.c
> @@ -1992,6 +1992,10 @@ static int restore_root_task(struct pstree_item *init)
>  	if (ret < 0)
>  		goto out_kill;
>  
> +	ret = run_scripts(ACT_POST_SETUP_NS);
> +	if (ret)
> +		goto out_kill;
> +
>  	ret = restore_switch_stage(CR_STATE_FORKING);
>  	if (ret < 0)
>  		goto out_kill;
> diff --git a/include/action-scripts.h b/include/action-scripts.h
> index 52f7531..8ffc2c5 100644
> --- a/include/action-scripts.h
> +++ b/include/action-scripts.h
> @@ -17,6 +17,7 @@ enum script_actions {
>  	ACT_NET_LOCK		= 4,
>  	ACT_NET_UNLOCK		= 5,
>  	ACT_SETUP_NS		= 6,
> +	ACT_POST_SETUP_NS	= 7,
>  
>  	ACT_MAX
>  };

> _______________________________________________
> CRIU mailing list
> CRIU at openvz.org
> https://lists.openvz.org/mailman/listinfo/criu



More information about the CRIU mailing list