Commit 6f45c38c authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

mount: parse devpts options

The newinstance options isn't shown in mountinfo. Currently it is
detected in devpts_dump. It is added only for root mounts and it
isn't added for bind-mounts. So mounts_equal(a, b, true) returns false
for such mounts and criu doesn't understand that they should be
bind-mounted.
Reported-by: 's avatarTycho Andersen <tycho.andersen@canonical.com>
Cc: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Acked-by: 's avatarSerge E. Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 44356b37
...@@ -672,7 +672,7 @@ static int attach_option(struct mount_info *pm, char *opt) ...@@ -672,7 +672,7 @@ static int attach_option(struct mount_info *pm, char *opt)
} }
/* Is it mounted w or w/o the newinstance option */ /* Is it mounted w or w/o the newinstance option */
static int devpts_dump(struct mount_info *pm) static int devpts_parse(struct mount_info *pm)
{ {
struct stat *host_st; struct stat *host_st;
...@@ -839,7 +839,7 @@ static struct fstype fstypes[] = { ...@@ -839,7 +839,7 @@ static struct fstype fstypes[] = {
.restore = tmpfs_restore, .restore = tmpfs_restore,
}, { }, {
.name = "devpts", .name = "devpts",
.dump = devpts_dump, .parse = devpts_parse,
.code = FSTYPE__DEVPTS, .code = FSTYPE__DEVPTS,
}, { }, {
.name = "simfs", .name = "simfs",
......
...@@ -81,6 +81,10 @@ static int prepare_mntns() ...@@ -81,6 +81,10 @@ static int prepare_mntns()
fprintf(stderr, "mount(/dev/pts) failed: %m\n"); fprintf(stderr, "mount(/dev/pts) failed: %m\n");
return -1; return -1;
} }
if (mount("/dev/pts/ptmx", "/dev/ptmx", NULL, MS_BIND, NULL)) {
fprintf(stderr, "mount(/dev/pts) failed: %m\n");
return -1;
}
if (fchdir(dfd)) { if (fchdir(dfd)) {
fprintf(stderr, "fchdir() failed: %m\n"); fprintf(stderr, "fchdir() failed: %m\n");
return -1; return -1;
......
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