[CRIU] [PATCH 2/3] lib: Add helpers to setup ghost limit

Cyrill Gorcunov gorcunov at openvz.org
Mon Aug 10 07:20:50 PDT 2015


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

diff --git a/lib/criu.c b/lib/criu.c
index 3fac24ec010f..e89a861189b9 100644
--- a/lib/criu.c
+++ b/lib/criu.c
@@ -674,6 +674,17 @@ int criu_add_skip_mnt(char *mnt)
 	return criu_local_add_skip_mnt(global_opts, mnt);
 }
 
+void criu_local_set_ghost_limit(criu_opts *opts, unsigned int limit)
+{
+	opts->rpc->has_ghost_limit = true;
+	opts->rpc->ghost_limit = limit;
+}
+
+void criu_set_ghost_limit(unsigned int limit)
+{
+	criu_local_set_ghost_limit(global_opts, limit);
+}
+
 static CriuResp *recv_resp(int socket_fd)
 {
 	unsigned char *buf;
diff --git a/lib/criu.h b/lib/criu.h
index c22bad35dd09..6e4b17591d64 100644
--- a/lib/criu.h
+++ b/lib/criu.h
@@ -87,6 +87,7 @@ int criu_add_veth_pair(char *in, char *out);
 int criu_add_cg_root(char *ctrl, char *path);
 int criu_add_enable_fs(char *fs);
 int criu_add_skip_mnt(char *mnt);
+void criu_set_ghost_limit(unsigned int limit);
 
 /*
  * The criu_notify_arg_t na argument is an opaque
@@ -187,6 +188,7 @@ int criu_local_add_veth_pair(criu_opts *opts, char *in, char *out);
 int criu_local_add_cg_root(criu_opts *opts, char *ctrl, char *path);
 int criu_local_add_enable_fs(criu_opts *opts, char *fs);
 int criu_local_add_skip_mnt(criu_opts *opts, char *mnt);
+void criu_local_set_ghost_limit(criu_opts *opts, unsigned int limit);
 
 void criu_local_set_notify_cb(criu_opts *opts, int (*cb)(char *action, criu_notify_arg_t na));
 
-- 
2.4.3



More information about the CRIU mailing list