Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
iSulad
提交
1e621b03
I
iSulad
项目概览
openeuler
/
iSulad
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
I
iSulad
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
1e621b03
编写于
6月 23, 2020
作者:
L
lifeng68
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refact: move engines to runtime directory
Signed-off-by:
N
lifeng68
<
lifeng68@huawei.com
>
上级
5e61c22c
变更
18
隐藏空白更改
内联
并排
Showing
18 changed file
with
43 addition
and
43 deletion
+43
-43
CMakeLists.txt
CMakeLists.txt
+1
-1
iSulad.spec
iSulad.spec
+1
-1
src/cmd/isulad/main.c
src/cmd/isulad/main.c
+2
-31
src/daemon/CMakeLists.txt
src/daemon/CMakeLists.txt
+0
-3
src/daemon/events/collector.c
src/daemon/events/collector.c
+0
-1
src/daemon/events/monitord.c
src/daemon/events/monitord.c
+0
-0
src/daemon/events/monitord.h
src/daemon/events/monitord.h
+0
-0
src/daemon/runtime/CMakeLists.txt
src/daemon/runtime/CMakeLists.txt
+3
-3
src/daemon/runtime/engines/CMakeLists.txt
src/daemon/runtime/engines/CMakeLists.txt
+4
-0
src/daemon/runtime/engines/engine.c
src/daemon/runtime/engines/engine.c
+0
-0
src/daemon/runtime/engines/engine.h
src/daemon/runtime/engines/engine.h
+0
-0
src/daemon/runtime/engines/lcr/CMakeLists.txt
src/daemon/runtime/engines/lcr/CMakeLists.txt
+0
-0
src/daemon/runtime/engines/lcr/lcr_engine.c
src/daemon/runtime/engines/lcr/lcr_engine.c
+0
-0
src/daemon/runtime/engines/lcr/lcr_engine.h
src/daemon/runtime/engines/lcr/lcr_engine.h
+0
-0
src/daemon/runtime/engines/lcr/lcr_rt_ops.c
src/daemon/runtime/engines/lcr/lcr_rt_ops.c
+0
-0
src/daemon/runtime/engines/lcr/lcr_rt_ops.h
src/daemon/runtime/engines/lcr/lcr_rt_ops.h
+0
-0
src/daemon/runtime/runtime.c
src/daemon/runtime/runtime.c
+30
-3
src/daemon/runtime/runtime.h
src/daemon/runtime/runtime.h
+2
-0
未找到文件。
CMakeLists.txt
浏览文件 @
1e621b03
...
...
@@ -89,7 +89,7 @@ install(FILES src/cutils/utils_timestamp.h
DESTINATION include/isulad
)
install
(
FILES src/cutils/error.h
DESTINATION include/isulad
)
install
(
FILES src/daemon/engines/engine.h
install
(
FILES src/daemon/
runtime/
engines/engine.h
DESTINATION include/isulad
)
# install config files
...
...
iSulad.spec
浏览文件 @
1e621b03
...
...
@@ -76,7 +76,7 @@ install -m 0644 ../src/client/libisula.h %{buildroot}/%{_includedir}/isulad/li
install -m 0644 ../src/client/connect/isula_connect.h %{buildroot}/%{_includedir}/isulad/isula_connect.h
install -m 0644 ../src/cutils/utils_timestamp.h %{buildroot}/%{_includedir}/isulad/utils_timestamp.h
install -m 0644 ../src/cutils/error.h %{buildroot}/%{_includedir}/isulad/error.h
install -m 0644 ../src/daemon/engines/engine.h %{buildroot}/%{_includedir}/isulad/engine.h
install -m 0644 ../src/daemon/
runtime/
engines/engine.h %{buildroot}/%{_includedir}/isulad/engine.h
install -d $RPM_BUILD_ROOT/%{_sysconfdir}/isulad
install -m 0640 ../src/contrib/config/daemon.json %{buildroot}/%{_sysconfdir}/isulad/daemon.json
...
...
src/cmd/isulad/main.c
浏览文件 @
1e621b03
...
...
@@ -58,7 +58,6 @@
#include "plugin.h"
#include "selinux_label.h"
#include "http.h"
#include "engine.h"
#ifdef GRPC_CONNECTOR
#include "clibcni/api.h"
...
...
@@ -1208,34 +1207,6 @@ out:
return
ret
;
}
static
int
isulad_server_init_engines
()
{
int
ret
=
0
;
char
*
engine
=
NULL
;
engine
=
conf_get_isulad_engine
();
if
(
engine
==
NULL
)
{
ret
=
-
1
;
goto
out
;
}
if
(
engines_global_init
())
{
ERROR
(
"Init engines global failed"
);
ret
=
-
1
;
goto
out
;
}
/* Init default engine, now is lcr */
if
(
engines_discovery
(
engine
))
{
ERROR
(
"Failed to discovery default engine:%s"
,
engine
);
ret
=
-
1
;
}
out:
free
(
engine
);
return
ret
;
}
static
void
set_mallopt
()
{
if
(
mallopt
(
M_ARENA_TEST
,
8
)
==
0
)
{
...
...
@@ -1402,8 +1373,8 @@ static int pre_init_daemon(int argc, char **argv, char **msg)
goto
out
;
}
if
(
isulad_server_init_engines
()
)
{
*
msg
=
"Failed to init
engines
"
;
if
(
runtime_init
()
!=
0
)
{
*
msg
=
"Failed to init
runtime
"
;
goto
out
;
}
...
...
src/daemon/CMakeLists.txt
浏览文件 @
1e621b03
...
...
@@ -10,7 +10,6 @@ add_subdirectory(container)
add_subdirectory
(
connect
)
add_subdirectory
(
log
)
add_subdirectory
(
events
)
add_subdirectory
(
engines
)
set
(
local_daemon_srcs
${
daemon_top_srcs
}
...
...
@@ -23,7 +22,6 @@ set(local_daemon_srcs
${
SERVER_CONNECT_SRCS
}
${
LOG_GATHER_SRCS
}
${
EVENTS_SRCS
}
${
ENGINES_SRCS
}
)
set
(
local_daemon_incs
...
...
@@ -37,7 +35,6 @@ set(local_daemon_incs
${
SERVER_CONNECT_INCS
}
${
LOG_GATHER_INCS
}
${
EVENTS_INCS
}
${
ENGINES_INCS
}
)
if
(
GRPC_CONNECTOR
)
...
...
src/daemon/events/collector.c
浏览文件 @
1e621b03
...
...
@@ -33,7 +33,6 @@
#include "libisulad.h"
#include "containers_store.h"
#include "container_unix.h"
#include "image.h"
static
struct
context_lists
g_context_lists
;
...
...
src/daemon/
container
/monitord.c
→
src/daemon/
events
/monitord.c
浏览文件 @
1e621b03
文件已移动
src/daemon/
container
/monitord.h
→
src/daemon/
events
/monitord.h
浏览文件 @
1e621b03
文件已移动
src/daemon/runtime/CMakeLists.txt
浏览文件 @
1e621b03
# get current directory sources files
aux_source_directory
(
${
CMAKE_CURRENT_SOURCE_DIR
}
runtime_top_srcs
)
add_subdirectory
(
lcr
)
add_subdirectory
(
engines
)
add_subdirectory
(
isula
)
set
(
local_runtime_srcs
${
runtime_top_srcs
}
${
LCR
_SRCS
}
${
ENGINES
_SRCS
}
${
ISULA_SRCS
}
)
set
(
local_runtime_incs
${
CMAKE_CURRENT_SOURCE_DIR
}
${
LCR
_INCS
}
${
ENGINES
_INCS
}
${
CMAKE_CURRENT_SOURCE_DIR
}
/isula
)
...
...
src/daemon/engines/CMakeLists.txt
→
src/daemon/
runtime/
engines/CMakeLists.txt
浏览文件 @
1e621b03
# get current directory sources files
aux_source_directory
(
${
CMAKE_CURRENT_SOURCE_DIR
}
engines_top_srcs
)
add_subdirectory
(
lcr
)
set
(
ENGINES_SRCS
${
engines_top_srcs
}
${
LCR_SRCS
}
PARENT_SCOPE
)
set
(
ENGINES_INCS
${
CMAKE_CURRENT_SOURCE_DIR
}
${
LCR_INCS
}
PARENT_SCOPE
)
src/daemon/engines/engine.c
→
src/daemon/
runtime/
engines/engine.c
浏览文件 @
1e621b03
文件已移动
src/daemon/engines/engine.h
→
src/daemon/
runtime/
engines/engine.h
浏览文件 @
1e621b03
文件已移动
src/daemon/runtime/lcr/CMakeLists.txt
→
src/daemon/runtime/
engines/
lcr/CMakeLists.txt
浏览文件 @
1e621b03
文件已移动
src/daemon/runtime/lcr/lcr_engine.c
→
src/daemon/runtime/
engines/
lcr/lcr_engine.c
浏览文件 @
1e621b03
文件已移动
src/daemon/runtime/lcr/lcr_engine.h
→
src/daemon/runtime/
engines/
lcr/lcr_engine.h
浏览文件 @
1e621b03
文件已移动
src/daemon/runtime/lcr/lcr_rt_ops.c
→
src/daemon/runtime/
engines/
lcr/lcr_rt_ops.c
浏览文件 @
1e621b03
文件已移动
src/daemon/runtime/lcr/lcr_rt_ops.h
→
src/daemon/runtime/
engines/
lcr/lcr_rt_ops.h
浏览文件 @
1e621b03
文件已移动
src/daemon/runtime/runtime.c
浏览文件 @
1e621b03
...
...
@@ -22,6 +22,7 @@
#include <ctype.h>
#include "runtime.h"
#include "isulad_config.h"
#include "isula_libutils/log.h"
#include "utils.h"
#include "lcr_rt_ops.h"
...
...
@@ -161,7 +162,6 @@ out:
return
ret
;
}
int
runtime_clean_resource
(
const
char
*
name
,
const
char
*
runtime
,
const
rt_clean_params_t
*
params
)
{
int
ret
=
0
;
...
...
@@ -260,8 +260,7 @@ out:
return
ret
;
}
int
runtime_exec
(
const
char
*
name
,
const
char
*
runtime
,
const
rt_exec_params_t
*
params
,
int
*
exit_code
)
int
runtime_exec
(
const
char
*
name
,
const
char
*
runtime
,
const
rt_exec_params_t
*
params
,
int
*
exit_code
)
{
int
ret
=
0
;
const
struct
rt_ops
*
ops
=
NULL
;
...
...
@@ -463,3 +462,31 @@ int runtime_exec_resize(const char *name, const char *runtime, const rt_exec_res
out:
return
ret
;
}
int
runtime_init
()
{
int
ret
=
0
;
char
*
engine
=
NULL
;
engine
=
conf_get_isulad_engine
();
if
(
engine
==
NULL
)
{
ret
=
-
1
;
goto
out
;
}
if
(
engines_global_init
())
{
ERROR
(
"Init engines global failed"
);
ret
=
-
1
;
goto
out
;
}
/* Init default engine, now is lcr */
if
(
engines_discovery
(
engine
))
{
ERROR
(
"Failed to discovery default engine:%s"
,
engine
);
ret
=
-
1
;
}
out:
free
(
engine
);
return
ret
;
}
src/daemon/runtime/runtime.h
浏览文件 @
1e621b03
...
...
@@ -197,6 +197,8 @@ int runtime_listpids(const char *name, const char *runtime, const rt_listpids_pa
void
free_rt_listpids_out_t
(
rt_listpids_out_t
*
out
);
int
runtime_resize
(
const
char
*
name
,
const
char
*
runtime
,
const
rt_resize_params_t
*
params
);
int
runtime_exec_resize
(
const
char
*
name
,
const
char
*
runtime
,
const
rt_exec_resize_params_t
*
params
);
int
runtime_init
();
#ifdef __cplusplus
}
#endif
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录