]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
c/r: add support for CRIU's --action-script 1075/head
authorTycho Andersen <tycho.andersen@canonical.com>
Wed, 6 Jul 2016 23:45:15 +0000 (23:45 +0000)
committerTycho Andersen <tycho.andersen@canonical.com>
Wed, 6 Jul 2016 23:45:15 +0000 (23:45 +0000)
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
src/lxc/criu.c
src/lxc/lxccontainer.h

index a1b7d407bce91a7a0f9506eddceafa6642777415..94b9ce4855b4b66be9bc189344317578f5ff48a2 100644 (file)
@@ -185,6 +185,9 @@ static void exec_criu(struct criu_opts *opts)
        if (opts->user->verbose)
                static_args++;
 
+       if (opts->user->action_script)
+               static_args += 2;
+
        ret = snprintf(log, PATH_MAX, "%s/%s.log", opts->user->directory, opts->action);
        if (ret < 0 || ret >= PATH_MAX) {
                ERROR("logfile name too long\n");
@@ -235,6 +238,11 @@ static void exec_criu(struct criu_opts *opts)
        if (opts->user->verbose)
                DECLARE_ARG("-vvvvvv");
 
+       if (opts->user->action_script) {
+               DECLARE_ARG("--action-script");
+               DECLARE_ARG(opts->user->action_script);
+       }
+
        if (strcmp(opts->action, "dump") == 0 || strcmp(opts->action, "pre-dump") == 0) {
                char pid[32], *freezer_relative;
 
index ecc66e226052868dd9caafd3287f7aa70dfc3f6b..bde4912bdce3a4e65888edd6ec19fe0b0964fea5 100644 (file)
@@ -891,6 +891,11 @@ struct migrate_opts {
         * won't if e.g. you rsync the filesystems between two machines.
         */
        bool preserves_inodes;
+
+       /* Path to an executable script that will be registered as a criu
+        * "action script"
+        */
+       char *action_script;
 };
 
 /*!