Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
iSulad
提交
1094a074
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,发现更多精彩内容 >>
提交
1094a074
编写于
2月 20, 2020
作者:
J
jingrui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
isulad: support open_stdin in process.json
Signed-off-by:
N
jingrui
<
jingrui@huawei.com
>
上级
e13ba3b5
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
33 addition
and
23 deletion
+33
-23
src/json/schema/schema/shim/client/process-state.json
src/json/schema/schema/shim/client/process-state.json
+6
-0
src/runtime/isula/isula_rt_ops.c
src/runtime/isula/isula_rt_ops.c
+23
-23
src/runtime/runtime.h
src/runtime/runtime.h
+2
-0
src/services/execution/execute/execution.c
src/services/execution/execute/execution.c
+2
-0
未找到文件。
src/json/schema/schema/shim/client/process-state.json
浏览文件 @
1094a074
...
...
@@ -156,6 +156,12 @@
"exec"
:
{
"type"
:
"boolean"
},
"open_tty"
:
{
"type"
:
"boolean"
},
"open_stdin"
:
{
"type"
:
"boolean"
},
"isuladStdin"
:
{
"type"
:
"string"
},
...
...
src/runtime/isula/isula_rt_ops.c
浏览文件 @
1094a074
...
...
@@ -157,12 +157,8 @@ bool rt_isula_detect(const char *runtime)
return
false
;
}
static
int
create_process_json_file
(
const
char
*
workdir
,
bool
exec
,
const
char
*
exit_fifo
,
const
char
*
control_fifo
,
const
char
*
stdin
,
const
char
*
stdout
,
const
char
*
stderr
,
const
char
**
runtime_args
,
size_t
runtime_args_len
,
defs_process
*
process
)
static
int
create_process_json_file
(
const
char
*
workdir
,
const
shim_client_process_state
*
p
)
{
shim_client_process_state
*
p
=
NULL
;
struct
parser_context
ctx
=
{
OPT_GEN_SIMPLIFY
,
0
};
parser_error
perr
=
NULL
;
char
*
data
=
NULL
;
...
...
@@ -174,17 +170,6 @@ static int create_process_json_file(const char *workdir, bool exec,
return
-
1
;
}
p
=
util_common_calloc_s
(
sizeof
(
shim_client_process_state
));
p
->
exec
=
exec
;
p
->
exit_fifo
=
(
char
*
)
exit_fifo
;
p
->
control_fifo
=
(
char
*
)
control_fifo
;
p
->
isulad_stdin
=
(
char
*
)
stdin
;
p
->
isulad_stdout
=
(
char
*
)
stdout
;
p
->
isulad_stderr
=
(
char
*
)
stderr
;
p
->
runtime_args
=
(
char
**
)
runtime_args
;
p
->
runtime_args_len
=
runtime_args_len
;
copy_process
(
p
,
process
);
data
=
shim_client_process_state_generate_json
(
p
,
&
ctx
,
&
perr
);
if
(
data
==
NULL
)
{
retcode
=
-
1
;
...
...
@@ -200,7 +185,6 @@ static int create_process_json_file(const char *workdir, bool exec,
out:
UTIL_FREE_AND_SET_NULL
(
perr
);
UTIL_FREE_AND_SET_NULL
(
p
);
/* field in p shall free by caller */
UTIL_FREE_AND_SET_NULL
(
data
);
return
retcode
;
...
...
@@ -699,6 +683,7 @@ int rt_isula_create(const char *id, const char *runtime,
size_t
runtime_args_len
=
get_runtime_args
(
runtime
,
&
runtime_args
);
int
ret
=
0
;
char
workdir
[
PATH_MAX
]
=
{
0
};
shim_client_process_state
p
=
{
0
};
if
(
snprintf
(
workdir
,
sizeof
(
workdir
),
"%s/%s"
,
params
->
state
,
id
)
<
0
)
{
INFO
(
"make full workdir failed"
);
...
...
@@ -706,9 +691,17 @@ int rt_isula_create(const char *id, const char *runtime,
goto
out
;
}
ret
=
create_process_json_file
(
workdir
,
false
,
params
->
exit_fifo
,
NULL
,
params
->
stdin
,
params
->
stdout
,
params
->
stderr
,
runtime_args
,
runtime_args_len
,
config
->
process
);
p
.
exit_fifo
=
(
char
*
)
params
->
exit_fifo
;
p
.
open_tty
=
params
->
tty
;
p
.
open_stdin
=
params
->
open_stdin
;
p
.
isulad_stdin
=
(
char
*
)
params
->
stdin
;
p
.
isulad_stdout
=
(
char
*
)
params
->
stdout
;
p
.
isulad_stderr
=
(
char
*
)
params
->
stderr
;
p
.
runtime_args
=
(
char
**
)
runtime_args
;
p
.
runtime_args_len
=
runtime_args_len
;
copy_process
(
&
p
,
config
->
process
);
ret
=
create_process_json_file
(
workdir
,
&
p
);
if
(
ret
!=
0
)
{
ERROR
(
"%s: failed create json file"
,
id
);
goto
out
;
...
...
@@ -860,6 +853,7 @@ int rt_isula_exec(const char *id, const char *runtime,
int
ret
=
0
;
char
bundle
[
PATH_MAX
]
=
{
0
};
int
pid
=
0
;
shim_client_process_state
p
=
{
0
};
ret
=
snprintf
(
bundle
,
sizeof
(
bundle
),
"%s/%s"
,
params
->
rootpath
,
id
);
if
(
ret
<
0
)
{
...
...
@@ -885,9 +879,15 @@ int rt_isula_exec(const char *id, const char *runtime,
goto
out
;
}
ret
=
create_process_json_file
(
workdir
,
true
,
NULL
,
NULL
,
params
->
console_fifos
[
0
],
params
->
console_fifos
[
1
],
params
->
console_fifos
[
2
],
runtime_args
,
runtime_args_len
,
process
);
p
.
exec
=
true
;
p
.
isulad_stdin
=
(
char
*
)
params
->
console_fifos
[
0
];
p
.
isulad_stdout
=
(
char
*
)
params
->
console_fifos
[
1
];
p
.
isulad_stderr
=
(
char
*
)
params
->
console_fifos
[
2
];
p
.
runtime_args
=
(
char
**
)
runtime_args
;
p
.
runtime_args_len
=
runtime_args_len
;
copy_process
(
&
p
,
process
);
ret
=
create_process_json_file
(
workdir
,
&
p
);
if
(
ret
!=
0
)
{
ERROR
(
"%s: failed create exec json file"
);
goto
out
;
...
...
src/runtime/runtime.h
浏览文件 @
1094a074
...
...
@@ -37,6 +37,8 @@ typedef struct _rt_create_params_t {
const
char
*
stdout
;
const
char
*
stderr
;
const
char
*
exit_fifo
;
bool
tty
;
bool
open_stdin
;
}
rt_create_params_t
;
...
...
src/services/execution/execute/execution.c
浏览文件 @
1094a074
...
...
@@ -870,6 +870,8 @@ static int do_start_container(container_t *cont, const char *console_fifos[], bo
create_params
.
stdout
=
console_fifos
[
1
];
create_params
.
stderr
=
console_fifos
[
2
];
create_params
.
exit_fifo
=
exit_fifo
;
create_params
.
tty
=
tty
;
create_params
.
open_stdin
=
open_stdin
;
if
(
runtime_create
(
id
,
runtime
,
&
create_params
)
!=
0
)
{
ret
=
-
1
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录