Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
criu
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhul
criu
Commits
c1a25fc1
Commit
c1a25fc1
authored
Sep 18, 2015
by
Pavel Emelyanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mnt: Add mi->root resolving helper
Signed-off-by:
Pavel Emelyanov
<
xemul@parallels.com
>
parent
259374f6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
45 deletions
+52
-45
mount.c
mount.c
+52
-45
No files found.
mount.c
View file @
c1a25fc1
...
@@ -2363,6 +2363,56 @@ static int rst_collect_local_mntns(void)
...
@@ -2363,6 +2363,56 @@ static int rst_collect_local_mntns(void)
return
0
;
return
0
;
}
}
static
int
get_mp_root
(
MntEntry
*
me
,
struct
mount_info
*
mi
)
{
struct
ext_mount
*
em
=
NULL
;
if
(
!
me
->
ext_mount
)
{
mi
->
root
=
xstrdup
(
me
->
root
);
if
(
!
mi
->
root
)
return
-
1
;
goto
out
;
}
/*
* External mount point -- get the reverse mapping
* from the command line and put into root's place
*/
em
=
ext_mount_lookup
(
me
->
root
);
if
(
!
em
)
{
if
(
!
opts
.
autodetect_ext_mounts
)
{
pr_err
(
"No mapping for %s mountpoint
\n
"
,
me
->
mountpoint
);
return
-
1
;
}
/*
* Make up an external mount entry for this
* mount point, since we couldn't find a user
* supplied one.
*/
em
=
xmalloc
(
sizeof
(
struct
ext_mount
));
if
(
!
em
)
return
-
1
;
/*
* Put a : in here since those are invalid on
* the cli, so we know it's autogenerated in
* debugging.
*/
em
->
key
=
AUTODETECTED_MOUNT
;
em
->
val
=
mi
->
source
;
}
mi
->
external
=
em
;
mi
->
root
=
em
->
val
;
out:
pr_debug
(
"
\t\t
Will mount %d from %s%s
\n
"
,
mi
->
mnt_id
,
mi
->
root
,
em
?
" (E)"
:
""
);
return
0
;
}
static
int
get_mp_mountpoint
(
MntEntry
*
me
,
struct
mount_info
*
mi
,
char
*
root
,
int
root_len
)
static
int
get_mp_mountpoint
(
MntEntry
*
me
,
struct
mount_info
*
mi
,
char
*
root
,
int
root_len
)
{
{
int
len
;
int
len
;
...
@@ -2455,51 +2505,8 @@ static int collect_mnt_from_image(struct mount_info **pms, struct ns_id *nsid)
...
@@ -2455,51 +2505,8 @@ static int collect_mnt_from_image(struct mount_info **pms, struct ns_id *nsid)
/* FIXME: abort unsupported early */
/* FIXME: abort unsupported early */
pm
->
fstype
=
decode_fstype
(
me
->
fstype
,
me
->
fsname
);
pm
->
fstype
=
decode_fstype
(
me
->
fstype
,
me
->
fsname
);
if
(
me
->
ext_mount
)
{
if
(
get_mp_root
(
me
,
pm
))
struct
ext_mount
*
em
;
goto
err
;
/*
* External mount point -- get the reverse mapping
* from the command line and put into root's place
*/
em
=
ext_mount_lookup
(
me
->
root
);
if
(
!
em
)
{
if
(
!
opts
.
autodetect_ext_mounts
)
{
pr_err
(
"No mapping for %s mountpoint
\n
"
,
me
->
mountpoint
);
goto
err
;
}
/*
* Make up an external mount entry for this
* mount point, since we couldn't find a user
* supplied one.
*/
em
=
xmalloc
(
sizeof
(
struct
ext_mount
));
if
(
!
em
)
goto
err
;
em
->
val
=
pm
->
source
;
/*
* Put a : in here since those are invalid on
* the cli, so we know it's autogenerated in
* debugging.
*/
em
->
key
=
AUTODETECTED_MOUNT
;
}
pm
->
external
=
em
;
pm
->
root
=
em
->
val
;
pr_debug
(
"Mountpoint %s will have root from %s
\n
"
,
me
->
mountpoint
,
pm
->
root
);
}
else
{
pr_debug
(
"
\t\t
Getting root for %d
\n
"
,
pm
->
mnt_id
);
pm
->
root
=
xstrdup
(
me
->
root
);
if
(
!
pm
->
root
)
goto
err
;
}
if
(
get_mp_mountpoint
(
me
,
pm
,
root
,
root_len
))
if
(
get_mp_mountpoint
(
me
,
pm
,
root
,
root_len
))
goto
err
;
goto
err
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment