Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
lcr
提交
cc6ed74c
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看板
提交
cc6ed74c
编写于
3月 06, 2020
作者:
Z
zhangsong34
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
lcr: remove unused code for syscontainer
Signed-off-by:
N
zhangsong34
<
zhangsong34@huawei.com
>
上级
b8cc45a5
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
0 addition
and
78 deletion
+0
-78
src/lcrcontainer_extend.c
src/lcrcontainer_extend.c
+0
-78
未找到文件。
src/lcrcontainer_extend.c
浏览文件 @
cc6ed74c
...
@@ -976,79 +976,6 @@ out_free:
...
@@ -976,79 +976,6 @@ out_free:
return
bret
;
return
bret
;
}
}
/*
*Get the file path that needs to be mount
*/
static
bool
mount_get_bundle_file
(
char
**
bundle
,
const
char
*
container_name
,
const
char
*
lcrpath
,
const
char
*
filename
)
{
const
char
*
path
=
lcrpath
?
lcrpath
:
LCRPATH
;
int
nret
=
0
;
size_t
len
=
0
;
if
(
strlen
(
container_name
)
>
(((
SIZE_MAX
-
strlen
(
path
))
-
strlen
(
filename
))
-
3
))
{
return
false
;
}
/* bundle = lcrpath + '/' + container_name + '/' + filename + '\0' */
len
=
strlen
(
path
)
+
strlen
(
container_name
)
+
strlen
(
filename
)
+
3
;
*
bundle
=
util_common_calloc_s
(
len
);
if
(
*
bundle
==
NULL
)
{
return
false
;
}
nret
=
snprintf
(
*
bundle
,
len
,
"%s/%s/%s"
,
path
,
container_name
,
filename
);
if
(
nret
<
0
||
(
size_t
)
nret
>=
len
)
{
return
false
;
}
return
true
;
}
static
bool
copy_host_file_to_bundle
(
const
struct
lxc_container
*
c
,
const
char
*
rootfs
,
const
char
*
filename
)
{
char
*
bundle
=
NULL
;
char
full_path
[
PATH_MAX
]
=
{
0
};
bool
ret
=
true
;
int
nret
;
nret
=
snprintf
(
full_path
,
sizeof
(
full_path
),
"%s%s%s"
,
rootfs
,
"/etc/"
,
filename
);
if
(
nret
<
0
||
(
size_t
)
nret
>=
sizeof
(
full_path
))
{
goto
out_free
;
}
ret
=
mount_get_bundle_file
(
&
bundle
,
c
->
name
,
c
->
config_path
,
filename
);
if
(
!
ret
)
{
goto
out_free
;
}
ret
=
util_copy_file
(
full_path
,
bundle
,
NETWORK_MOUNT_FILE_MODE
);
if
(
!
ret
)
{
goto
out_free
;
}
out_free:
free
(
bundle
);
return
ret
;
}
static
bool
init_system_container_network
(
const
struct
lxc_container
*
c
,
const
char
*
rootfs
)
{
if
(
!
copy_host_file_to_bundle
(
c
,
rootfs
,
"hostname"
))
{
ERROR
(
"Failed to copy hostname from rootfs to container bundle"
);
return
false
;
}
if
(
!
copy_host_file_to_bundle
(
c
,
rootfs
,
"hosts"
))
{
ERROR
(
"Failed to copy hosts from rootfs to container bundle"
);
return
false
;
}
if
(
!
copy_host_file_to_bundle
(
c
,
rootfs
,
"resolv.conf"
))
{
ERROR
(
"Failed to copy resolv.conf from rootfs to container bundle"
);
return
false
;
}
return
true
;
}
bool
translate_spec
(
const
struct
lxc_container
*
c
,
oci_runtime_spec
*
container
)
bool
translate_spec
(
const
struct
lxc_container
*
c
,
oci_runtime_spec
*
container
)
{
{
bool
ret
=
false
;
bool
ret
=
false
;
...
@@ -1056,11 +983,6 @@ bool translate_spec(const struct lxc_container *c, oci_runtime_spec *container)
...
@@ -1056,11 +983,6 @@ bool translate_spec(const struct lxc_container *c, oci_runtime_spec *container)
char
*
seccomp_conf
=
NULL
;
char
*
seccomp_conf
=
NULL
;
INFO
(
"Translate new specification file"
);
INFO
(
"Translate new specification file"
);
if
(
is_system_container
(
container
))
{
if
(
!
init_system_container_network
(
c
,
container
->
root
->
path
))
{
goto
out_free_conf
;
}
}
lcr_conf
=
lcr_oci2lcr
(
c
,
container
,
&
seccomp_conf
);
lcr_conf
=
lcr_oci2lcr
(
c
,
container
,
&
seccomp_conf
);
if
(
lcr_conf
==
NULL
)
{
if
(
lcr_conf
==
NULL
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录