[CRIU] [PATCH 3/3] fsnotify: Implement @force_inotify_path option handling in lib and service

Cyrill Gorcunov gorcunov at openvz.org
Fri Oct 30 06:16:29 PDT 2015


Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 cr-service.c |  3 +++
 lib/criu.c   | 11 +++++++++++
 lib/criu.h   |  2 ++
 3 files changed, 16 insertions(+)

diff --git a/cr-service.c b/cr-service.c
index 7fe0e4846d1d..bf5d9aced8ac 100644
--- a/cr-service.c
+++ b/cr-service.c
@@ -332,6 +332,9 @@ static int setup_opts_from_req(int sk, CriuOpts *req)
 	if (req->has_force_irmap)
 		opts.force_irmap = req->force_irmap;
 
+	if (req->force_inotify_path)
+		opts.force_inotify_path = req->force_inotify_path;
+
 	if (req->n_exec_cmd > 0) {
 		opts.exec_cmd = xmalloc((req->n_exec_cmd + 1) * sizeof(char *));
 		memcpy(opts.exec_cmd, req->exec_cmd, req->n_exec_cmd * sizeof(char *));
diff --git a/lib/criu.c b/lib/criu.c
index 9c00a0f5c760..ca156242718a 100644
--- a/lib/criu.c
+++ b/lib/criu.c
@@ -208,6 +208,17 @@ void criu_set_force_irmap(bool force_irmap)
 	criu_local_set_force_irmap(global_opts, force_irmap);
 }
 
+void criu_local_set_force_inotify_path(criu_opts *opts, bool force_inotify_path)
+{
+	opts->rpc->has_force_inotify_path = true;
+	opts->rpc->force_inotify_path = force_inotify_path;
+}
+
+void criu_set_force_inotify_path(bool force_inotify_path)
+{
+	criu_local_set_force_inotify_path(global_opts, force_inotify_path);
+}
+
 void criu_local_set_link_remap(criu_opts *opts, bool link_remap)
 {
 	opts->rpc->has_link_remap = true;
diff --git a/lib/criu.h b/lib/criu.h
index 0898be024f63..440bf5b95012 100644
--- a/lib/criu.h
+++ b/lib/criu.h
@@ -71,6 +71,7 @@ void criu_set_file_locks(bool file_locks);
 void criu_set_track_mem(bool track_mem);
 void criu_set_auto_dedup(bool auto_dedup);
 void criu_set_force_irmap(bool force_irmap);
+void criu_set_force_inotify_path(bool force_inotify_path);
 void criu_set_link_remap(bool link_remap);
 void criu_set_log_level(int log_level);
 void criu_set_log_file(char *log_file);
@@ -173,6 +174,7 @@ void criu_local_set_file_locks(criu_opts *opts, bool file_locks);
 void criu_local_set_track_mem(criu_opts *opts, bool track_mem);
 void criu_local_set_auto_dedup(criu_opts *opts, bool auto_dedup);
 void criu_local_set_force_irmap(criu_opts *opts, bool force_irmap);
+void criu_local_set_force_inotify_path(criu_opts *opts, bool force_inotify_path);
 void criu_local_set_link_remap(criu_opts *opts, bool link_remap);
 void criu_local_set_log_level(criu_opts *opts, int log_level);
 void criu_local_set_log_file(criu_opts *opts, char *log_file);
-- 
2.4.3



More information about the CRIU mailing list