!13 4.24: sync with upstream stable-2.0.0
Merge pull request !13 from lifeng_isula/424
This commit is contained in:
commit
0819308ca0
2
lcr.spec
2
lcr.spec
@ -1,5 +1,5 @@
|
|||||||
%global _version 2.0.0
|
%global _version 2.0.0
|
||||||
%global _release 20200318.003237.gitcdd4f8ab
|
%global _release 20200418.180709.gitaabdb4e4
|
||||||
Name: lcr
|
Name: lcr
|
||||||
Version: %{_version}
|
Version: %{_version}
|
||||||
Release: %{_release}
|
Release: %{_release}
|
||||||
|
|||||||
19
src/conf.c
19
src/conf.c
@ -2550,22 +2550,6 @@ static int add_needed_pty_conf(struct lcr_list *conf)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int add_needed_tty_conf(struct lcr_list *conf)
|
|
||||||
{
|
|
||||||
struct lcr_list *node = create_lcr_list_node("lxc.tty.max", "4");
|
|
||||||
if (node == NULL) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
lcr_list_add_tail(conf, node);
|
|
||||||
|
|
||||||
node = create_lcr_list_node("lxc.tty.dir", "lxc");
|
|
||||||
if (node == NULL) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
lcr_list_add_tail(conf, node);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int add_needed_net_conf(struct lcr_list *conf)
|
static int add_needed_net_conf(struct lcr_list *conf)
|
||||||
{
|
{
|
||||||
struct lcr_list *node = create_lcr_list_node("lxc.net.0.type", "empty");
|
struct lcr_list *node = create_lcr_list_node("lxc.net.0.type", "empty");
|
||||||
@ -2591,9 +2575,6 @@ struct lcr_list *get_needed_lxc_conf()
|
|||||||
}
|
}
|
||||||
lcr_list_init(conf);
|
lcr_list_init(conf);
|
||||||
|
|
||||||
if (add_needed_tty_conf(conf) < 0) {
|
|
||||||
goto out_free;
|
|
||||||
}
|
|
||||||
if (add_needed_pty_conf(conf) < 0) {
|
if (add_needed_pty_conf(conf) < 0) {
|
||||||
goto out_free;
|
goto out_free;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -271,6 +271,9 @@ struct lcr_exec_request {
|
|||||||
int64_t timeout;
|
int64_t timeout;
|
||||||
|
|
||||||
const char *suffix;
|
const char *suffix;
|
||||||
|
|
||||||
|
bool tty;
|
||||||
|
bool open_stdin;
|
||||||
};
|
};
|
||||||
/*
|
/*
|
||||||
* Execute process inside a container
|
* Execute process inside a container
|
||||||
|
|||||||
@ -571,10 +571,12 @@ static void execute_lxc_attach(const char *name, const char *path, const struct
|
|||||||
add_array_elem(params, args_len, &i, "-P");
|
add_array_elem(params, args_len, &i, "-P");
|
||||||
add_array_elem(params, args_len, &i, path);
|
add_array_elem(params, args_len, &i, path);
|
||||||
add_array_elem(params, args_len, &i, "--clear-env");
|
add_array_elem(params, args_len, &i, "--clear-env");
|
||||||
|
add_array_elem(params, args_len, &i, "--quiet");
|
||||||
add_array_kv(params, args_len, &i, "--logfile", request->logpath);
|
add_array_kv(params, args_len, &i, "--logfile", request->logpath);
|
||||||
add_array_kv(params, args_len, &i, "-l", request->loglevel);
|
add_array_kv(params, args_len, &i, "-l", request->loglevel);
|
||||||
add_array_kv(params, args_len, &i, "--in-fifo", request->console_fifos[0]);
|
add_array_kv(params, args_len, &i, "--in-fifo", request->console_fifos[0]);
|
||||||
add_array_kv(params, args_len, &i, "--out-fifo", request->console_fifos[1]);
|
add_array_kv(params, args_len, &i, "--out-fifo", request->console_fifos[1]);
|
||||||
|
add_array_kv(params, args_len, &i, "--err-fifo", request->console_fifos[2]);
|
||||||
for (j = 0; j < request->env_len; j++) {
|
for (j = 0; j < request->env_len; j++) {
|
||||||
add_array_elem(params, args_len, &i, "-v");
|
add_array_elem(params, args_len, &i, "-v");
|
||||||
add_array_elem(params, args_len, &i, request->env[j]);
|
add_array_elem(params, args_len, &i, request->env[j]);
|
||||||
@ -599,6 +601,13 @@ static void execute_lxc_attach(const char *name, const char *path, const struct
|
|||||||
|
|
||||||
add_array_kv(params, args_len, &i, "--suffix", request->suffix);
|
add_array_kv(params, args_len, &i, "--suffix", request->suffix);
|
||||||
|
|
||||||
|
if (!request->tty) {
|
||||||
|
add_array_elem(params, args_len, &i, "--disable-pty");
|
||||||
|
}
|
||||||
|
if (request->open_stdin) {
|
||||||
|
add_array_elem(params, args_len, &i, "--open-stdin");
|
||||||
|
}
|
||||||
|
|
||||||
add_array_elem(params, args_len, &i, "--");
|
add_array_elem(params, args_len, &i, "--");
|
||||||
for (j = 0; j < request->args_len; j++) {
|
for (j = 0; j < request->args_len; j++) {
|
||||||
add_array_elem(params, args_len, &i, request->args[j]);
|
add_array_elem(params, args_len, &i, request->args[j]);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user