[CRIU] [PATCH v3 07/17] action scripts: set spfs environment in run_scripts
Stanislav Kinsburskiy
skinsbursky at virtuozzo.com
Thu May 19 03:57:50 PDT 2016
This environment is required to switch spfs mount points into Stub mode, once
files reopen is completed.
Signed-off-by: Stanislav Kinsburskiy <skinsbursky at virtuozzo.com>
---
criu/action-scripts.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/criu/action-scripts.c b/criu/action-scripts.c
index ee59210..500e239 100644
--- a/criu/action-scripts.c
+++ b/criu/action-scripts.c
@@ -11,6 +11,7 @@
#include "cr-service.h"
#include "action-scripts.h"
#include "pstree.h"
+#include "spfs.h"
static const char *action_names[ACT_MAX] = {
[ ACT_PRE_DUMP ] = "pre-dump",
@@ -48,6 +49,7 @@ static int run_shell_scripts(const char *action)
#define ENV_IMGDIR 0x1
#define ENV_ROOTPID 0x2
+#define ENV_SPFS 0x3
if (setenv("CRTOOLS_SCRIPT_ACTION", action, 1)) {
pr_perror("Can't set CRTOOLS_SCRIPT_ACTION=%s", action);
@@ -78,6 +80,11 @@ static int run_shell_scripts(const char *action)
}
}
+ if (!(env_set & ENV_IMGDIR)) {
+ if (spfs_set_env())
+ return -1;
+ }
+
list_for_each_entry(script, &scripts, node) {
pr_debug("\t[%s]\n", script->path);
ret |= system(script->path);
More information about the CRIU
mailing list