criu [PATCH] post-setup-namespaces

Introduce post-setup-namespaces action script

It needed to have possibility to run cutom script after mount
namespace is configured

Signed-off-by: Igor Sukhih <igor@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This commit is contained in:
Igor Sukhih 2016-01-19 15:10:00 +03:00 committed by Pavel Emelyanov
parent ef8d4cf285
commit eec66f3d30
3 changed files with 6 additions and 0 deletions

View file

@ -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)

View file

@ -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;

View file

@ -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
};