Commit 9eec8b03 authored by Saied Kazemi's avatar Saied Kazemi Committed by Pavel Emelyanov

Use --root instead of --aufs-root

When dumping Docker containers using the AUFS graph driver, we can
use the --root option instead of --aufs-root for specifying the
container's root.  This patch obviates the need for --aufs-root
and makes dump CLI more consistent with restore CLI.
Signed-off-by: 's avatarSaied Kazemi <saied@google.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 457a70da
...@@ -172,7 +172,6 @@ int main(int argc, char *argv[]) ...@@ -172,7 +172,6 @@ int main(int argc, char *argv[])
{ "exec-cmd", no_argument, 0, 1059}, { "exec-cmd", no_argument, 0, 1059},
{ "manage-cgroups", no_argument, 0, 1060}, { "manage-cgroups", no_argument, 0, 1060},
{ "cgroup-root", required_argument, 0, 1061}, { "cgroup-root", required_argument, 0, 1061},
{ "aufs-root", required_argument, 0, 1062},
{ }, { },
}; };
...@@ -401,9 +400,6 @@ int main(int argc, char *argv[]) ...@@ -401,9 +400,6 @@ int main(int argc, char *argv[])
case 'h': case 'h':
usage_error = false; usage_error = false;
goto usage; goto usage;
case 1062:
opts.aufs_root = optarg;
break;
default: default:
goto usage; goto usage;
} }
...@@ -556,9 +552,6 @@ usage: ...@@ -556,9 +552,6 @@ usage:
" --exec-cmd execute the command specified after '--' on successful\n" " --exec-cmd execute the command specified after '--' on successful\n"
" restore making it the parent of the restored process\n" " restore making it the parent of the restored process\n"
"\n" "\n"
"* AUFS support (applicable to dump only):\n"
" --aufs-root root pathname of the AUFS filesystem\n"
"\n"
"* Special resources support:\n" "* Special resources support:\n"
" -x|--" USK_EXT_PARAM " allow external unix connections\n" " -x|--" USK_EXT_PARAM " allow external unix connections\n"
" --" SK_EST_PARAM " checkpoint/restore established TCP connections\n" " --" SK_EST_PARAM " checkpoint/restore established TCP connections\n"
......
...@@ -61,7 +61,6 @@ struct cr_options { ...@@ -61,7 +61,6 @@ struct cr_options {
char *new_global_cg_root; char *new_global_cg_root;
struct list_head new_cgroup_roots; struct list_head new_cgroup_roots;
bool aufs; /* auto-deteced, not via cli */ bool aufs; /* auto-deteced, not via cli */
char *aufs_root;
}; };
extern struct cr_options opts; extern struct cr_options opts;
......
...@@ -1742,25 +1742,12 @@ out: ...@@ -1742,25 +1742,12 @@ out:
*/ */
int aufs_parse(struct mount_info *new) int aufs_parse(struct mount_info *new)
{ {
char *cp; int ret = 0;
if (!strcmp(new->mountpoint, "./")) {
opts.aufs = true; opts.aufs = true;
ret = parse_aufs_branches(new);
if (!opts.aufs_root || strcmp(new->mountpoint, "./"))
return 0;
cp = malloc(strlen(opts.aufs_root) + 1);
if (!cp) {
pr_err("Cannot allocate memory for %s\n", opts.aufs_root);
return -1;
} }
strcpy(cp, opts.aufs_root);
pr_debug("Replacing %s with %s\n", new->root, opts.aufs_root); return ret;
free(new->root);
new->root = cp;
parse_aufs_branches(new);
return 0;
} }
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
* 90 61 0:33 / / rw,relatime - aufs none rw,si=4476a910a24617e6 * 90 61 0:33 / / rw,relatime - aufs none rw,si=4476a910a24617e6
* *
* To handle this issue, the user has to specify the root of the AUFS * To handle this issue, the user has to specify the root of the AUFS
* filesystem with the --aufs-root command line option. * filesystem with the --root command line option.
* *
* 2) /proc/<pid>/map_files: The symlinks are absolute pathnames of the * 2) /proc/<pid>/map_files: The symlinks are absolute pathnames of the
* corresponding *physical* files in the branch they exist. For example, * corresponding *physical* files in the branch they exist. For example,
...@@ -287,12 +287,12 @@ int fixup_aufs_vma_fd(struct vma_area *vma) ...@@ -287,12 +287,12 @@ int fixup_aufs_vma_fd(struct vma_area *vma)
if (!vma->aufs_rpath) if (!vma->aufs_rpath)
return -1; return -1;
strcpy(vma->aufs_rpath, path); strcpy(vma->aufs_rpath, path);
if (opts.aufs_root) { if (opts.root) {
vma->aufs_fpath = xmalloc(strlen(opts.aufs_root) + 1 + len + 1); vma->aufs_fpath = xmalloc(strlen(opts.root) + 1 + len + 1);
if (!vma->aufs_fpath) if (!vma->aufs_fpath)
return -1; return -1;
/* skip ./ in path */ /* skip ./ in path */
sprintf(vma->aufs_fpath, "%s/%s", opts.aufs_root, &path[2]); sprintf(vma->aufs_fpath, "%s/%s", opts.root, &path[2]);
} }
pr_debug("Saved AUFS paths %s and %s\n", vma->aufs_rpath, vma->aufs_fpath); pr_debug("Saved AUFS paths %s and %s\n", vma->aufs_rpath, vma->aufs_fpath);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment