]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
criu: hide more stuff in criu.c
authorTycho Andersen <tycho.andersen@canonical.com>
Sat, 12 Mar 2016 02:01:43 +0000 (19:01 -0700)
committerTycho Andersen <tycho.andersen@canonical.com>
Sat, 12 Mar 2016 02:15:32 +0000 (19:15 -0700)
Various other functions/structures are now only used in criu.c, so let's
hide stuff there so as not to pollute headers.

This commit also bumps the required CRIU versions to 2.0. While we don't
*require* any features that aren't in 1.8 patchlevel 21 or above, 2.0 is a
vast improvement, and so we should use that instead.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
src/lxc/criu.c
src/lxc/criu.h

index a683130f84a0d245d28609f904ab9b8503b774c8..db5f72acf5b4682aa0589137cc67c570642cd077 100644 (file)
 #include "network.h"
 #include "utils.h"
 
+#define CRIU_VERSION           "2.0"
+
+#define CRIU_GITID_VERSION     "2.0"
+#define CRIU_GITID_PATCHLEVEL  0
+
 lxc_log_define(lxc_criu, lxc);
 
+struct criu_opts {
+       /* The type of criu invocation, one of "dump" or "restore" */
+       char *action;
+
+       /* The directory to pass to criu */
+       char *directory;
+
+       /* The container to dump */
+       struct lxc_container *c;
+
+       /* Enable criu verbose mode? */
+       bool verbose;
+
+       /* (pre-)dump: a directory for the previous dump's images */
+       char *predump_dir;
+
+       /* dump: stop the container or not after dumping? */
+       bool stop;
+
+       /* restore: the file to write the init process' pid into */
+       char *pidfile;
+       const char *cgroup_path;
+};
+
 static void exec_criu(struct criu_opts *opts)
 {
        char **argv, log[PATH_MAX];
@@ -352,7 +381,7 @@ version_error:
 
 /* Check and make sure the container has a configuration that we know CRIU can
  * dump. */
-bool criu_ok(struct lxc_container *c)
+static bool criu_ok(struct lxc_container *c)
 {
        struct lxc_list *it;
        bool found_deny_rule = false;
index ed6dc8141cd45f28fb644f958e5f1e09ce51cb5d..d5491a69eb2b489ee9f3fbe63ac3df46a379d2e8 100644 (file)
 
 #include <lxc/lxccontainer.h>
 
-// We require either the criu major/minor version, or the criu GITID if criu
-// was built from git.
-#define CRIU_VERSION           "1.9"
-
-#define CRIU_GITID_VERSION     "1.8"
-#define CRIU_GITID_PATCHLEVEL  21
-
-struct criu_opts {
-       /* The type of criu invocation, one of "dump" or "restore" */
-       char *action;
-
-       /* The directory to pass to criu */
-       char *directory;
-
-       /* The container to dump */
-       struct lxc_container *c;
-
-       /* Enable criu verbose mode? */
-       bool verbose;
-
-       /* (pre-)dump: a directory for the previous dump's images */
-       char *predump_dir;
-
-       /* dump: stop the container or not after dumping? */
-       bool stop;
-
-       /* restore: the file to write the init process' pid into */
-       char *pidfile;
-       const char *cgroup_path;
-};
-
-/* Check and make sure the container has a configuration that we know CRIU can
- * dump. */
-bool criu_ok(struct lxc_container *c);
-
 bool pre_dump(struct lxc_container *c, char *directory, bool verbose, char *predump_dir);
 bool dump(struct lxc_container *c, char *directory, bool stop, bool verbose, char *predump_dir);
 bool restore(struct lxc_container *c, char *directory, bool verbose);