Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
iSulad
提交
f46dd18e
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,发现更多精彩内容 >>
提交
f46dd18e
编写于
6月 29, 2020
作者:
L
lifeng68
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
image: use isulad_daemon_config as module init args
Signed-off-by:
N
lifeng68
<
lifeng68@huawei.com
>
上级
f8e6cb02
变更
9
显示空白变更内容
内联
并排
Showing
9 changed file
with
22 addition
and
29 deletion
+22
-29
src/cmd/isulad/main.c
src/cmd/isulad/main.c
+1
-1
src/daemon/image/embedded/embedded_image.c
src/daemon/image/embedded/embedded_image.c
+5
-10
src/daemon/image/embedded/embedded_image.h
src/daemon/image/embedded/embedded_image.h
+1
-2
src/daemon/image/external/ext_image.c
src/daemon/image/external/ext_image.c
+1
-1
src/daemon/image/external/ext_image.h
src/daemon/image/external/ext_image.h
+1
-2
src/daemon/image/image.c
src/daemon/image/image.c
+2
-2
src/daemon/image/image.h
src/daemon/image/image.h
+3
-3
src/daemon/image/oci/oci_image.c
src/daemon/image/oci/oci_image.c
+7
-7
src/daemon/image/oci/oci_image.h
src/daemon/image/oci/oci_image.h
+1
-1
未找到文件。
src/cmd/isulad/main.c
浏览文件 @
f46dd18e
...
...
@@ -1063,7 +1063,7 @@ static int isulad_server_init_common()
goto
out
;
}
if
(
image_module_init
(
args
)
)
{
if
(
image_module_init
(
args
->
json_confs
)
!=
0
)
{
ERROR
(
"Failed to init image manager"
);
goto
out
;
}
...
...
src/daemon/image/embedded/embedded_image.c
浏览文件 @
f46dd18e
...
...
@@ -129,7 +129,6 @@ out:
return
ret
;
}
int
embedded_merge_conf
(
const
char
*
img_name
,
container_config
*
container_spec
)
{
int
ret
=
0
;
...
...
@@ -155,11 +154,10 @@ int embedded_get_user_conf(const char *basefs, host_config *hc, const char *user
ERROR
(
"Empty basefs or puser"
);
return
-
1
;
}
return
get_user
(
"/"
,
hc
,
userstr
,
puser
);
;
return
get_user
(
"/"
,
hc
,
userstr
,
puser
);
}
static
int
embedded_images_to_imagetool_images
(
struct
db_all_images
*
all_images
,
imagetool_images_list
*
list
)
static
int
embedded_images_to_imagetool_images
(
struct
db_all_images
*
all_images
,
imagetool_images_list
*
list
)
{
int
ret
=
0
;
size_t
images_num
=
0
;
...
...
@@ -314,8 +312,7 @@ int embedded_remove_image(const im_rmi_request *request)
}
if
(
strcmp
(
conts
[
i
]
->
common_config
->
image
,
image_ref
)
==
0
)
{
ERROR
(
"unable to remove image %s, container %s is using it"
,
image_ref
,
conts
[
i
]
->
common_config
->
id
);
ERROR
(
"unable to remove image %s, container %s is using it"
,
image_ref
,
conts
[
i
]
->
common_config
->
id
);
isulad_set_error_message
(
"Image is in use"
);
ret
=
EIMAGEBUSY
;
goto
unref_continue
;
...
...
@@ -351,19 +348,17 @@ int embedded_inspect_image(const im_inspect_request *request, char **inspected_j
return
lim_query_image_data
(
image_ref
,
IMAGE_DATA_TYPE_CONFIG
,
inspected_json
,
NULL
);
}
int
embedded_init
(
const
struct
service_argument
s
*
args
)
int
embedded_init
(
const
isulad_daemon_config
s
*
args
)
{
if
(
args
==
NULL
)
{
ERROR
(
"Invalid image configs"
);
return
-
1
;
}
return
lim_init
(
args
->
json_confs
->
graph
);
return
lim_init
(
args
->
graph
);
}
void
embedded_exit
()
{
db_common_finish
();
}
src/daemon/image/embedded/embedded_image.h
浏览文件 @
f46dd18e
...
...
@@ -44,9 +44,8 @@ int embedded_inspect_image(const im_inspect_request *request, char **inspected_j
int
embedded_load_image
(
const
im_load_request
*
request
);
int
embedded_init
(
const
struct
service_argument
s
*
args
);
int
embedded_init
(
const
isulad_daemon_config
s
*
args
);
void
embedded_exit
();
#endif
src/daemon/image/external/ext_image.c
浏览文件 @
f46dd18e
...
...
@@ -175,7 +175,7 @@ int ext_logout(const im_logout_request *request)
return
0
;
}
int
ext_init
(
const
struct
service_argument
s
*
args
)
int
ext_init
(
const
isulad_daemon_config
s
*
args
)
{
return
0
;
}
src/daemon/image/external/ext_image.h
浏览文件 @
f46dd18e
...
...
@@ -36,7 +36,6 @@ int ext_load_image(const im_load_request *request);
int
ext_login
(
const
im_login_request
*
request
);
int
ext_logout
(
const
im_logout_request
*
request
);
int
ext_init
(
const
struct
service_argument
s
*
args
);
int
ext_init
(
const
isulad_daemon_config
s
*
args
);
#endif
src/daemon/image/image.c
浏览文件 @
f46dd18e
...
...
@@ -1745,7 +1745,7 @@ void free_im_export_request(im_export_request *ptr)
free
(
ptr
);
}
static
int
bims_init
(
const
struct
service_argument
s
*
args
)
static
int
bims_init
(
const
isulad_daemon_config
s
*
args
)
{
int
ret
=
0
;
size_t
i
;
...
...
@@ -1765,7 +1765,7 @@ static int bims_init(const struct service_arguments *args)
return
ret
;
}
int
image_module_init
(
const
struct
service_argument
s
*
args
)
int
image_module_init
(
const
isulad_daemon_config
s
*
args
)
{
if
(
args
==
NULL
)
{
ERROR
(
"Invalid input arguments"
);
...
...
src/daemon/image/image.h
浏览文件 @
f46dd18e
...
...
@@ -24,7 +24,7 @@
#include "isula_libutils/host_config.h"
#include "isula_libutils/container_config.h"
#include "libisulad.h"
#include "
daemon_argument
s.h"
#include "
isula_libutils/isulad_daemon_config
s.h"
#include "isula_libutils/container_inspect.h"
#include "isula_libutils/imagetool_images_list.h"
#include "isula_libutils/imagetool_fs_info.h"
...
...
@@ -204,7 +204,7 @@ struct graphdriver_status {
};
struct
bim_ops
{
int
(
*
init
)(
const
struct
service_argument
s
*
args
);
int
(
*
init
)(
const
isulad_daemon_config
s
*
args
);
void
(
*
clean_resource
)(
void
);
/* detect whether image is of this bim type */
...
...
@@ -276,7 +276,7 @@ struct bim_type {
const
struct
bim_ops
*
ops
;
};
int
image_module_init
(
const
struct
service_argument
s
*
args
);
int
image_module_init
(
const
isulad_daemon_config
s
*
args
);
void
image_module_exit
();
...
...
src/daemon/image/oci/oci_image.c
浏览文件 @
f46dd18e
...
...
@@ -46,7 +46,7 @@ static char *format_driver_name(const char *driver)
}
}
static
int
storage_module_init_helper
(
const
struct
service_argument
s
*
args
)
static
int
storage_module_init_helper
(
const
isulad_daemon_config
s
*
args
)
{
int
ret
=
0
;
struct
storage_module_init_options
*
storage_opts
=
NULL
;
...
...
@@ -58,29 +58,29 @@ static int storage_module_init_helper(const struct service_arguments *args)
goto
out
;
}
storage_opts
->
driver_name
=
format_driver_name
(
args
->
json_confs
->
storage_driver
);
storage_opts
->
driver_name
=
format_driver_name
(
args
->
storage_driver
);
if
(
storage_opts
->
driver_name
==
NULL
)
{
ERROR
(
"Failed to get storage driver name"
);
ret
=
-
1
;
goto
out
;
}
storage_opts
->
storage_root
=
util_path_join
(
args
->
json_confs
->
graph
,
GRAPH_ROOTPATH_NAME
);
storage_opts
->
storage_root
=
util_path_join
(
args
->
graph
,
GRAPH_ROOTPATH_NAME
);
if
(
storage_opts
->
storage_root
==
NULL
)
{
ERROR
(
"Failed to get storage root dir"
);
ret
=
-
1
;
goto
out
;
}
storage_opts
->
storage_run_root
=
util_path_join
(
args
->
json_confs
->
state
,
GRAPH_ROOTPATH_NAME
);
storage_opts
->
storage_run_root
=
util_path_join
(
args
->
state
,
GRAPH_ROOTPATH_NAME
);
if
(
storage_opts
->
storage_run_root
==
NULL
)
{
ERROR
(
"Failed to get storage run root dir"
);
ret
=
-
1
;
goto
out
;
}
if
(
dup_array_of_strings
((
const
char
**
)
args
->
json_confs
->
storage_opts
,
args
->
json_confs
->
storage_opts_len
,
&
storage_opts
->
driver_opts
,
&
storage_opts
->
driver_opts
_len
)
!=
0
)
{
if
(
dup_array_of_strings
((
const
char
**
)
args
->
storage_opts
,
args
->
storage_opts_len
,
&
storage_opts
->
driver_opts
,
&
storage_opts
->
driver_opts_len
)
!=
0
)
{
ERROR
(
"Failed to get storage storage opts"
);
ret
=
-
1
;
goto
out
;
...
...
@@ -110,7 +110,7 @@ static void cleanup_image_tmpdir()
return
;
}
int
oci_init
(
const
struct
service_argument
s
*
args
)
int
oci_init
(
const
isulad_daemon_config
s
*
args
)
{
int
ret
=
0
;
...
...
src/daemon/image/oci/oci_image.h
浏览文件 @
f46dd18e
...
...
@@ -23,7 +23,7 @@
extern
"C"
{
#endif
int
oci_init
(
const
struct
service_argument
s
*
args
);
int
oci_init
(
const
isulad_daemon_config
s
*
args
);
void
oci_exit
();
int
oci_pull_rf
(
const
im_pull_request
*
request
,
im_pull_response
*
response
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录