[CRIU] [PATCH 09/17] action-scripts: ACT_POST_NET_LOCK stage added

Stanislav Kinsburskiy skinsbursky at virtuozzo.com
Wed May 18 09:28:34 PDT 2016


This stage is required for NFS migration to add additional iptables rules
to allow NFS ports. Without this any request to a file, located on NFS, will
stuck.
This stage is executed right _after_ network lock.

Signed-off-by: Stanislav Kinsburskiy <skinsbursky at virtuozzo.com>
---
 criu/action-scripts.c         |    1 +
 criu/include/action-scripts.h |    1 +
 criu/net.c                    |    4 +++-
 3 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/criu/action-scripts.c b/criu/action-scripts.c
index 7afc191..457dc16 100644
--- a/criu/action-scripts.c
+++ b/criu/action-scripts.c
@@ -23,6 +23,7 @@ static const char *action_names[ACT_MAX] = {
 	[ ACT_SETUP_NS ]	= "setup-namespaces",
 	[ ACT_POST_SETUP_NS ]	= "post-setup-namespaces",
 	[ ACT_POST_RESUME ]	= "post-resume",
+	[ ACT_POST_NET_LOCK ]	= "post-network-lock",
 };
 
 int run_scripts(enum script_actions act)
diff --git a/criu/include/action-scripts.h b/criu/include/action-scripts.h
index 4ab5d6d..072dfd3 100644
--- a/criu/include/action-scripts.h
+++ b/criu/include/action-scripts.h
@@ -19,6 +19,7 @@ enum script_actions {
 	ACT_SETUP_NS		= 6,
 	ACT_POST_SETUP_NS	= 7,
 	ACT_POST_RESUME		= 8,
+	ACT_POST_NET_LOCK	= 9,
 
 	ACT_MAX
 };
diff --git a/criu/net.c b/criu/net.c
index 6a1c404..ca5595d 100644
--- a/criu/net.c
+++ b/criu/net.c
@@ -1280,7 +1280,9 @@ int network_lock(void)
 	if (run_scripts(ACT_NET_LOCK))
 		return -1;
 
-	return network_lock_internal();
+	if (network_lock_internal())
+		return -1;
+	return run_scripts(ACT_POST_NET_LOCK);
 }
 
 void network_unlock(void)



More information about the CRIU mailing list