Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
lcr
提交
7cbade1b
L
lcr
项目概览
openeuler
/
lcr
通知
3
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
lcr
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
7cbade1b
编写于
3月 07, 2020
作者:
Z
zhangsong34
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
lcr: ignore dev mount point if system container and external rootfs enabled
Signed-off-by:
N
zhangsong34
<
zhangsong34@huawei.com
>
上级
941fa75f
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
15 addition
and
3 deletion
+15
-3
src/conf.c
src/conf.c
+15
-3
未找到文件。
src/conf.c
浏览文件 @
7cbade1b
...
...
@@ -1011,6 +1011,17 @@ bool is_system_container(const oci_runtime_spec *container)
return
false
;
}
static
bool
is_external_rootfs
(
const
oci_runtime_spec
*
container
)
{
size_t
i
=
0
;
for
(
i
=
0
;
container
->
annotations
!=
NULL
&&
i
<
container
->
annotations
->
len
;
i
++
)
{
if
(
strcmp
(
container
->
annotations
->
keys
[
i
],
"external.rootfs"
)
==
0
)
{
return
true
;
}
}
return
false
;
}
static
struct
lcr_list
*
trans_oci_mounts_normal
(
const
defs_mount
*
tmp
)
{
struct
lcr_list
*
node
=
NULL
;
...
...
@@ -1054,9 +1065,9 @@ static inline bool is_mount_destination_dev(const char *destination)
return
destination
!=
NULL
&&
strcmp
(
destination
,
"/dev"
)
==
0
;
}
static
inline
bool
should_ignore_dev_mount
(
const
defs_mount
*
tmp
,
bool
system_container
)
static
inline
bool
should_ignore_dev_mount
(
const
defs_mount
*
tmp
,
bool
system_container
,
bool
external_rootfs
)
{
return
system_container
&&
is_mount_destination_dev
(
tmp
->
destination
);
return
system_container
&&
external_rootfs
&&
is_mount_destination_dev
(
tmp
->
destination
);
}
/* trans oci mounts */
...
...
@@ -1067,6 +1078,7 @@ struct lcr_list *trans_oci_mounts(const oci_runtime_spec *c)
defs_mount
*
tmp
=
NULL
;
size_t
i
;
bool
system_container
=
is_system_container
(
c
);
bool
external_rootfs
=
is_external_rootfs
(
c
);
conf
=
util_common_calloc_s
(
sizeof
(
*
conf
));
if
(
conf
==
NULL
)
{
...
...
@@ -1080,7 +1092,7 @@ struct lcr_list *trans_oci_mounts(const oci_runtime_spec *c)
goto
out_free
;
}
if
(
should_ignore_dev_mount
(
tmp
,
system_container
))
{
if
(
should_ignore_dev_mount
(
tmp
,
system_container
,
external_rootfs
))
{
continue
;
}
node
=
trans_oci_mounts_node
(
c
,
tmp
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录