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
9b3189fe
Commit
9b3189fe
authored
Sep 22, 2015
by
Pavel Emelyanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
util: Add make_yard helper
Signed-off-by:
Pavel Emelyanov
<
xemul@parallels.com
>
parent
c5054f95
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
14 deletions
+20
-14
cgroup.c
cgroup.c
+1
-8
util.h
include/util.h
+2
-0
mount.c
mount.c
+1
-5
util.c
util.c
+16
-1
No files found.
cgroup.c
View file @
9b3189fe
...
@@ -1157,15 +1157,8 @@ static int prepare_cgroup_sfd(CgroupEntry *ce)
...
@@ -1157,15 +1157,8 @@ static int prepare_cgroup_sfd(CgroupEntry *ce)
return
-
1
;
return
-
1
;
}
}
if
(
mount
(
"none"
,
cg_yard
,
"tmpfs"
,
0
,
NULL
))
{
if
(
make_yard
(
cg_yard
))
pr_perror
(
"Can't mount tmpfs in cgyard"
);
goto
err
;
goto
err
;
}
if
(
mount
(
"none"
,
cg_yard
,
NULL
,
MS_PRIVATE
,
NULL
))
{
pr_perror
(
"Can't make cgyard private"
);
goto
err
;
}
pr_debug
(
"Opening %s as cg yard
\n
"
,
cg_yard
);
pr_debug
(
"Opening %s as cg yard
\n
"
,
cg_yard
);
i
=
open
(
cg_yard
,
O_DIRECTORY
);
i
=
open
(
cg_yard
,
O_DIRECTORY
);
...
...
include/util.h
View file @
9b3189fe
...
@@ -261,4 +261,6 @@ void split(char *str, char token, char ***out, int *n);
...
@@ -261,4 +261,6 @@ void split(char *str, char token, char ***out, int *n);
int
fd_has_data
(
int
lfd
);
int
fd_has_data
(
int
lfd
);
int
make_yard
(
char
*
path
);
#endif
/* __CR_UTIL_H__ */
#endif
/* __CR_UTIL_H__ */
mount.c
View file @
9b3189fe
...
@@ -2647,11 +2647,7 @@ static int prepare_roots_yard(void)
...
@@ -2647,11 +2647,7 @@ static int prepare_roots_yard(void)
if
(
mnt_roots
==
NULL
)
if
(
mnt_roots
==
NULL
)
return
0
;
return
0
;
if
(
mount
(
"none"
,
mnt_roots
,
"tmpfs"
,
0
,
NULL
))
{
if
(
make_yard
(
mnt_roots
))
pr_perror
(
"Unable to mount tmpfs in %s"
,
mnt_roots
);
return
-
1
;
}
if
(
mount
(
"none"
,
mnt_roots
,
NULL
,
MS_PRIVATE
,
NULL
))
return
-
1
;
return
-
1
;
for
(
nsid
=
ns_ids
;
nsid
!=
NULL
;
nsid
=
nsid
->
next
)
{
for
(
nsid
=
ns_ids
;
nsid
!=
NULL
;
nsid
=
nsid
->
next
)
{
...
...
util.c
View file @
9b3189fe
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
#include <sys/sendfile.h>
#include <sys/sendfile.h>
#include <fcntl.h>
#include <fcntl.h>
#include <poll.h>
#include <poll.h>
#include <sys/mount.h>
#include <sys/param.h>
#include <sys/param.h>
#include <sys/types.h>
#include <sys/types.h>
#include <sys/ptrace.h>
#include <sys/ptrace.h>
...
@@ -845,3 +845,18 @@ int fd_has_data(int lfd)
...
@@ -845,3 +845,18 @@ int fd_has_data(int lfd)
return
ret
;
return
ret
;
}
}
int
make_yard
(
char
*
path
)
{
if
(
mount
(
"none"
,
path
,
"tmpfs"
,
0
,
NULL
))
{
pr_perror
(
"Unable to mount tmpfs in %s"
,
path
);
return
-
1
;
}
if
(
mount
(
"none"
,
path
,
NULL
,
MS_PRIVATE
,
NULL
))
{
pr_perror
(
"Unable to mark yard as private"
);
return
-
1
;
}
return
0
;
}
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