static void exec_criu(struct criu_opts *opts)
{
char **argv, log[PATH_MAX];
- int static_args = 24, argc = 0, i, ret;
+ int static_args = 23, argc = 0, i, ret;
int netnr = 0;
struct lxc_list *it;
}
/* The command line always looks like:
- * criu $(action) --tcp-established --file-locks --link-remap --force-irmap \
+ * criu $(action) --tcp-established --file-locks --link-remap \
* --manage-cgroups action-script foo.sh -D $(directory) \
* -o $(directory)/$(action).log --ext-mount-map auto
* --enable-external-sharing --enable-external-masters
/* --external tty[88,4] */
if (opts->tty_id[0])
static_args += 2;
+
+ /* --force-irmap */
+ if (!opts->user->preserves_inodes)
+ static_args++;
} else if (strcmp(opts->action, "restore") == 0) {
/* --root $(lxc_mount_point) --restore-detached
* --restore-sibling --pidfile $foo --cgroup-root $foo
DECLARE_ARG("--tcp-established");
DECLARE_ARG("--file-locks");
DECLARE_ARG("--link-remap");
- DECLARE_ARG("--force-irmap");
DECLARE_ARG("--manage-cgroups");
DECLARE_ARG("--ext-mount-map");
DECLARE_ARG("auto");
DECLARE_ARG(opts->user->pageserver_port);
}
+ if (!opts->user->preserves_inodes)
+ DECLARE_ARG("--force-irmap");
+
/* only for final dump */
if (strcmp(opts->action, "dump") == 0 && !opts->user->stop)
DECLARE_ARG("--leave-running");
char *predump_dir; /* relative to directory above */
char *pageserver_address; /* where should memory pages be send? */
char *pageserver_port;
+
+ /* This flag indicates whether or not the container's rootfs will have
+ * the same inodes on checkpoint and restore. In the case of e.g. zfs
+ * send or btrfs send, or an LVM snapshot, this will be true, but it
+ * won't if e.g. you rsync the filesystems between two machines.
+ */
+ bool preserves_inodes;
};
/*!