diff --git a/0001-confile-add-lxc.isulad.init.args-config-interface.patch b/0001-confile-add-lxc.isulad.init.args-config-interface.patch index d0f4300ef80fa985144d2227082da01111f7d23f..e01d1f151c8abe6d3130984746e164f0f713fd4c 100644 --- a/0001-confile-add-lxc.isulad.init.args-config-interface.patch +++ b/0001-confile-add-lxc.isulad.init.args-config-interface.patch @@ -1,21 +1,21 @@ -From 093ea5bade9dbe2bf585b3627a21f144a3a9cd35 Mon Sep 17 00:00:00 2001 +From 0f644fdef13f66047b2b60a3d6dd31f8783a86ab Mon Sep 17 00:00:00 2001 From: LiFeng Date: Thu, 10 Jan 2019 06:54:37 -0500 -Subject: [PATCH 001/131] confile: add lxc.isulad.init.args config interface +Subject: [PATCH 001/138] confile: add lxc.isulad.init.args config interface lxc.isulad.init.args config interface is used to specify the args for the container. Signed-off-by: LiFeng --- - src/lxc/conf.c | 13 +++++++++ - src/lxc/conf.h | 8 ++++++ - src/lxc/confile.c | 61 ++++++++++++++++++++++++++++++++++++++++++ - src/lxc/lxccontainer.c | 30 +++++++++++++++++++++ + src/lxc/conf.c | 13 +++++++++++ + src/lxc/conf.h | 8 +++++++ + src/lxc/confile.c | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++ + src/lxc/lxccontainer.c | 30 +++++++++++++++++++++++++ 4 files changed, 112 insertions(+) diff --git a/src/lxc/conf.c b/src/lxc/conf.c -index d95bc4c7..f20d6297 100644 +index d95bc4c..f20d629 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -4014,6 +4014,18 @@ void lxc_clear_includes(struct lxc_conf *conf) @@ -46,7 +46,7 @@ index d95bc4c7..f20d6297 100644 free(conf->cgroup_meta.controllers); free(conf); diff --git a/src/lxc/conf.h b/src/lxc/conf.h -index 41f67cff..95c30270 100644 +index 41f67cf..95c3027 100644 --- a/src/lxc/conf.h +++ b/src/lxc/conf.h @@ -376,6 +376,10 @@ struct lxc_conf { @@ -70,7 +70,7 @@ index 41f67cff..95c30270 100644 + #endif /* __LXC_CONF_H */ diff --git a/src/lxc/confile.c b/src/lxc/confile.c -index 05c68231..7297b358 100644 +index 05c6823..7297b35 100644 --- a/src/lxc/confile.c +++ b/src/lxc/confile.c @@ -150,6 +150,10 @@ lxc_config_define(tty_dir); @@ -170,7 +170,7 @@ index 05c68231..7297b358 100644 struct lxc_conf *c, void *data) { diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c -index ad70886e..b4cacce2 100644 +index ad70886..b4cacce 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -847,6 +847,31 @@ static bool wait_on_daemonized_start(struct lxc_handler *handler, int pid) @@ -218,5 +218,5 @@ index ad70886e..b4cacce2 100644 if (!argv) { if (useinit) { -- -2.23.0 +1.8.3.1 diff --git a/0002-namespace-add-support-share-namespace-by-path.patch b/0002-namespace-add-support-share-namespace-by-path.patch index 9f0b2a93b08622c1abf0663249e1e39f40f9a5c7..fc78ce86b8e2743a963783622d62362004ed364f 100644 --- a/0002-namespace-add-support-share-namespace-by-path.patch +++ b/0002-namespace-add-support-share-namespace-by-path.patch @@ -1,7 +1,7 @@ -From 342207f0766c7937082e0fca7375acd54c77f03b Mon Sep 17 00:00:00 2001 +From 57c5e215695a3b4c4e3fa80776aee90e0542d980 Mon Sep 17 00:00:00 2001 From: LiFeng Date: Thu, 10 Jan 2019 08:42:19 -0500 -Subject: [PATCH 002/131] namespace: add support share namespace by path +Subject: [PATCH 002/138] namespace: add support share namespace by path Signed-off-by: LiFeng --- @@ -9,7 +9,7 @@ Signed-off-by: LiFeng 1 file changed, 11 insertions(+) diff --git a/src/lxc/confile_utils.c b/src/lxc/confile_utils.c -index 7280463f..9049ce82 100644 +index 7280463..9049ce8 100644 --- a/src/lxc/confile_utils.c +++ b/src/lxc/confile_utils.c @@ -789,6 +789,17 @@ int lxc_inherit_namespace(const char *lxcname_or_pid, const char *lxcpath, @@ -31,5 +31,5 @@ index 7280463f..9049ce82 100644 if (lastslash) { dup = strdup(lxcname_or_pid); -- -2.23.0 +1.8.3.1 diff --git a/0003-confile-add-lxc.isulad.populate.device-interface.patch b/0003-confile-add-lxc.isulad.populate.device-interface.patch index 548c73a90a595a69370050d1bf4799d330ee1b22..9037beba16adeb83d4355dd9c940b0500f402892 100644 --- a/0003-confile-add-lxc.isulad.populate.device-interface.patch +++ b/0003-confile-add-lxc.isulad.populate.device-interface.patch @@ -1,17 +1,17 @@ -From 5229766b8f1ef3802ae4ae3d44da693b25155113 Mon Sep 17 00:00:00 2001 +From d1bb169f38282acf9ae38ef000c2f5c658b4f325 Mon Sep 17 00:00:00 2001 From: LiFeng Date: Fri, 11 Jan 2019 01:51:25 -0500 -Subject: [PATCH 003/131] confile: add lxc.isulad.populate.device interface +Subject: [PATCH 003/138] confile: add lxc.isulad.populate.device interface Signed-off-by: LiFeng --- - src/lxc/conf.c | 125 +++++++++++++++++++++++++++++++++++++++++++--- - src/lxc/conf.h | 28 ++++++++++- - src/lxc/confile.c | 124 +++++++++++++++++++++++++++++++++++++++++++++ + src/lxc/conf.c | 125 +++++++++++++++++++++++++++++++++++++++++++++++++++--- + src/lxc/conf.h | 28 +++++++++++- + src/lxc/confile.c | 124 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 269 insertions(+), 8 deletions(-) diff --git a/src/lxc/conf.c b/src/lxc/conf.c -index f20d6297..20b7abab 100644 +index f20d629..20b7aba 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -2745,6 +2745,10 @@ struct lxc_conf *lxc_conf_init(void) @@ -184,14 +184,13 @@ index f20d6297..20b7abab 100644 } diff --git a/src/lxc/conf.h b/src/lxc/conf.h -index 95c30270..cced868c 100644 +index 95c3027..cced868 100644 --- a/src/lxc/conf.h +++ b/src/lxc/conf.h -@@ -170,6 +170,26 @@ struct lxc_rootfs { - char *data; +@@ -171,6 +171,26 @@ struct lxc_rootfs { }; -+/* + /* + * iSulad: Defines a structure to store the devices which will + * be attached in container + * @name : the target device name in container @@ -211,9 +210,10 @@ index 95c30270..cced868c 100644 +}; + + - /* ++/* * Automatic mounts for LXC to perform inside the container */ + enum { @@ -377,9 +397,13 @@ struct lxc_conf { /* procs */ struct lxc_list procs; @@ -239,7 +239,7 @@ index 95c30270..cced868c 100644 #endif /* __LXC_CONF_H */ diff --git a/src/lxc/confile.c b/src/lxc/confile.c -index 7297b358..e3212d3d 100644 +index 7297b35..e3212d3 100644 --- a/src/lxc/confile.c +++ b/src/lxc/confile.c @@ -152,6 +152,7 @@ lxc_config_define(sysctl); @@ -402,5 +402,5 @@ index 7297b358..e3212d3d 100644 struct lxc_conf *c, void *data) { -- -2.23.0 +1.8.3.1 diff --git a/0004-support-isulad-fifo-log.patch b/0004-support-isulad-fifo-log.patch index dd3445c55504ce6d015bb0df4d4e51a23957ee60..95272a01be6d3e8b9aae68ed47f654af7cdb419f 100644 --- a/0004-support-isulad-fifo-log.patch +++ b/0004-support-isulad-fifo-log.patch @@ -1,7 +1,7 @@ -From 1e2ac640b439da580d364e69ebdd2cfc344c6cd5 Mon Sep 17 00:00:00 2001 +From 88c0440da8e943d251cff194b8d1d8bb916a524a Mon Sep 17 00:00:00 2001 From: liuhao Date: Fri, 11 Jan 2019 16:11:34 +0800 -Subject: [PATCH 004/131] support isulad fifo log +Subject: [PATCH 004/138] support isulad fifo log support isulad fifo log in lxc3.0 @@ -11,7 +11,7 @@ Signed-off-by: LiFeng 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/src/lxc/log.c b/src/lxc/log.c -index 1e0cc6a6..4e744599 100644 +index 1e0cc6a..4e74459 100644 --- a/src/lxc/log.c +++ b/src/lxc/log.c @@ -68,6 +68,7 @@ static int syslog_enable = 0; @@ -92,5 +92,5 @@ index 1e0cc6a6..4e744599 100644 ERROR("Failed to enable logfile"); return -1; -- -2.23.0 +1.8.3.1 diff --git a/0005-auto-mount-cgroup-sys-and-proc.patch b/0005-auto-mount-cgroup-sys-and-proc.patch index 7773afbff76f1a59f6896c2bceb88ec1e33d1f97..019aab49281f7f8b87291d42fa1da2c927e9df9a 100644 --- a/0005-auto-mount-cgroup-sys-and-proc.patch +++ b/0005-auto-mount-cgroup-sys-and-proc.patch @@ -1,7 +1,7 @@ -From 5dfe223c483c298557604c2314ef757d4c147b66 Mon Sep 17 00:00:00 2001 +From a0cd5fd3be5a45b13d39316f371a3573a491ed13 Mon Sep 17 00:00:00 2001 From: tanyifeng Date: Thu, 10 Jan 2019 20:40:19 +0800 -Subject: [PATCH 005/131] auto mount cgroup sys and proc +Subject: [PATCH 005/138] auto mount cgroup sys and proc Signed-off-by: LiFeng --- @@ -10,7 +10,7 @@ Signed-off-by: LiFeng 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c -index acc6c309..aff2b5e1 100644 +index acc6c30..aff2b5e 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -1648,6 +1648,10 @@ __cgfsng_ops static bool cgfsng_mount(struct cgroup_ops *ops, @@ -36,7 +36,7 @@ index acc6c309..aff2b5e1 100644 if (ret < 0) { free(controllerpath); diff --git a/src/lxc/conf.c b/src/lxc/conf.c -index 20b7abab..18753d18 100644 +index 20b7aba..18753d1 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -670,8 +670,8 @@ static int lxc_mount_auto_mounts(struct lxc_conf *conf, int flags, struct lxc_ha @@ -76,5 +76,5 @@ index 20b7abab..18753d18 100644 r = 0; } else if (r < 0) { -- -2.23.0 +1.8.3.1 diff --git a/0006-conf.c-fix-bug-when-set-no-ro-mount-mount-propagatio.patch b/0006-conf.c-fix-bug-when-set-no-ro-mount-mount-propagatio.patch index 998252191beff7310f722992cb73a52c7335bdb2..64a9c7453cc34f37deb4661b758d95edac6090e8 100644 --- a/0006-conf.c-fix-bug-when-set-no-ro-mount-mount-propagatio.patch +++ b/0006-conf.c-fix-bug-when-set-no-ro-mount-mount-propagatio.patch @@ -1,7 +1,7 @@ -From d0ea541f9360eed1cb6beb91a0e69f1afa0b5031 Mon Sep 17 00:00:00 2001 +From 5791056145d9d1885a5b17826f39a3c925168dd8 Mon Sep 17 00:00:00 2001 From: tanyifeng Date: Fri, 11 Jan 2019 16:55:01 +0800 -Subject: [PATCH 006/131] conf.c: fix bug when set no ro mount, mount +Subject: [PATCH 006/138] conf.c: fix bug when set no ro mount, mount propagation will be skipped Signed-off-by: LiFeng @@ -10,7 +10,7 @@ Signed-off-by: LiFeng 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/lxc/conf.c b/src/lxc/conf.c -index 18753d18..37a5ff79 100644 +index 18753d1..37a5ff7 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -2087,6 +2087,9 @@ static int mount_entry(const char *fsname, const char *target, @@ -35,5 +35,5 @@ index 18753d18..37a5ff79 100644 srcpath ? srcpath : "(null)", target, fstype); -- -2.23.0 +1.8.3.1 diff --git a/0007-use-isulad-log-format.patch b/0007-use-isulad-log-format.patch index 55fcc41d6a396afe7bccf5df3cb823315ebf7160..4246c4d5dea92369c88a11b611fc987d49e703b1 100644 --- a/0007-use-isulad-log-format.patch +++ b/0007-use-isulad-log-format.patch @@ -1,7 +1,7 @@ -From 1958525ba64c9f2f255e5e0bc098eeaf7cbfc383 Mon Sep 17 00:00:00 2001 +From 038a44d304a7ab1cea6bd87a82af2b5f56527ba5 Mon Sep 17 00:00:00 2001 From: liuhao Date: Fri, 11 Jan 2019 17:00:48 +0800 -Subject: [PATCH 007/131] use isulad log format +Subject: [PATCH 007/138] use isulad log format use isulad log format @@ -11,7 +11,7 @@ Signed-off-by: LiFeng 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/lxc/log.c b/src/lxc/log.c -index 4e744599..91fb7efa 100644 +index 4e74459..91fb7ef 100644 --- a/src/lxc/log.c +++ b/src/lxc/log.c @@ -139,6 +139,7 @@ static char *lxc_log_get_va_msg(struct lxc_log_event *event) @@ -70,5 +70,5 @@ index 4e744599..91fb7efa 100644 return ret; -- -2.23.0 +1.8.3.1 diff --git a/0008-isulad-modify-exit-code-and-stop-signal.patch b/0008-isulad-modify-exit-code-and-stop-signal.patch index b76dcb24deb255f00f67fd846ec312710beca342..9f39d954f31fad1ef2a504b1e331d6a470af9df0 100644 --- a/0008-isulad-modify-exit-code-and-stop-signal.patch +++ b/0008-isulad-modify-exit-code-and-stop-signal.patch @@ -1,7 +1,7 @@ -From ca497ede318c29a609f7d4bfe0747b6253cb77fc Mon Sep 17 00:00:00 2001 +From 5d6aea523f0a89a1ef57c409de234c9b22b14eb4 Mon Sep 17 00:00:00 2001 From: tanyifeng Date: Fri, 11 Jan 2019 17:44:53 +0800 -Subject: [PATCH 008/131] isulad: modify exit code and stop signal +Subject: [PATCH 008/138] isulad: modify exit code and stop signal 1. modify default stop signal and disable reboot by signal. 2. send '128 + signal' if container is killed by signal. @@ -13,7 +13,7 @@ Signed-off-by: LiFeng 2 files changed, 18 insertions(+), 21 deletions(-) diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c -index b4cacce2..1d7f5bea 100644 +index b4cacce..1d7f5be 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -2069,7 +2069,8 @@ static bool do_lxcapi_shutdown(struct lxc_container *c, int timeout) @@ -39,7 +39,7 @@ index b4cacce2..1d7f5bea 100644 /* Add a new state client before sending the shutdown signal so that we * don't miss a state. diff --git a/src/lxc/start.c b/src/lxc/start.c -index 72e2de27..d64bdac1 100644 +index 72e2de2..d64bdac 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -1893,11 +1893,14 @@ out_abort: @@ -102,5 +102,5 @@ index 72e2de27..d64bdac1 100644 if (error_num) *error_num = handler->exit_status; -- -2.23.0 +1.8.3.1 diff --git a/0009-lxc_start-add-default-terminal-fifos.patch b/0009-lxc_start-add-default-terminal-fifos.patch index 58b7837d6f0d641d9fff2ec658efbce21e58e3f3..ac6f497077c3cc202ba2fd57cf6612263f01f1cc 100644 --- a/0009-lxc_start-add-default-terminal-fifos.patch +++ b/0009-lxc_start-add-default-terminal-fifos.patch @@ -1,23 +1,23 @@ -From fc179b0e5abb9dfe444343e81ef50e69cbc678cd Mon Sep 17 00:00:00 2001 +From 88256f6a222a9e2fbaac73f66ffcd02a4f970864 Mon Sep 17 00:00:00 2001 From: LiFeng Date: Fri, 11 Jan 2019 21:52:11 -0500 -Subject: [PATCH 009/131] lxc_start: add default terminal fifos +Subject: [PATCH 009/138] lxc_start: add default terminal fifos Signed-off-by: LiFeng --- src/lxc/conf.c | 4 + - src/lxc/lxccontainer.c | 30 ++++++ - src/lxc/lxccontainer.h | 10 ++ - src/lxc/terminal.c | 194 +++++++++++++++++++++++++++++++++++++- + src/lxc/lxccontainer.c | 30 +++++++ + src/lxc/lxccontainer.h | 10 +++ + src/lxc/terminal.c | 194 +++++++++++++++++++++++++++++++++++++++++++++- src/lxc/terminal.h | 16 ++++ - src/lxc/tools/arguments.h | 5 + + src/lxc/tools/arguments.h | 5 ++ src/lxc/tools/lxc_start.c | 11 +++ - src/lxc/utils.c | 23 +++++ + src/lxc/utils.c | 23 ++++++ src/lxc/utils.h | 4 + 9 files changed, 294 insertions(+), 3 deletions(-) diff --git a/src/lxc/conf.c b/src/lxc/conf.c -index 37a5ff79..7b7f95b7 100644 +index 37a5ff7..7b7f95b 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -2714,6 +2714,10 @@ struct lxc_conf *lxc_conf_init(void) @@ -32,7 +32,7 @@ index 37a5ff79..7b7f95b7 100644 new->nbd_idx = -1; new->rootfs.mount = strdup(default_rootfs_mount); diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c -index 1d7f5bea..318c71e6 100644 +index 1d7f5be..318c71e 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -4961,6 +4961,33 @@ out: @@ -80,7 +80,7 @@ index 1d7f5bea..318c71e6 100644 err: diff --git a/src/lxc/lxccontainer.h b/src/lxc/lxccontainer.h -index 9e06215c..486531e5 100644 +index 9e06215..486531e 100644 --- a/src/lxc/lxccontainer.h +++ b/src/lxc/lxccontainer.h @@ -847,6 +847,16 @@ struct lxc_container { @@ -101,7 +101,7 @@ index 9e06215c..486531e5 100644 /*! diff --git a/src/lxc/terminal.c b/src/lxc/terminal.c -index 4060e7f9..c5077122 100644 +index 4060e7f..c507712 100644 --- a/src/lxc/terminal.c +++ b/src/lxc/terminal.c @@ -364,6 +364,20 @@ static int lxc_terminal_write_log_file(struct lxc_terminal *terminal, char *buf, @@ -382,7 +382,7 @@ index 4060e7f9..c5077122 100644 int lxc_terminal_map_ids(struct lxc_conf *c, struct lxc_terminal *terminal) diff --git a/src/lxc/terminal.h b/src/lxc/terminal.h -index bfd271f4..d25da657 100644 +index bfd271f..d25da65 100644 --- a/src/lxc/terminal.h +++ b/src/lxc/terminal.h @@ -115,6 +115,17 @@ struct lxc_terminal { @@ -414,7 +414,7 @@ index bfd271f4..d25da657 100644 + #endif /* __LXC_TERMINAL_H */ diff --git a/src/lxc/tools/arguments.h b/src/lxc/tools/arguments.h -index 810050ad..b7af2b51 100644 +index 810050a..b7af2b5 100644 --- a/src/lxc/tools/arguments.h +++ b/src/lxc/tools/arguments.h @@ -62,6 +62,7 @@ struct lxc_arguments { @@ -437,7 +437,7 @@ index 810050ad..b7af2b51 100644 extern int lxc_arguments_parse(struct lxc_arguments *args, int argc, char *const argv[]); diff --git a/src/lxc/tools/lxc_start.c b/src/lxc/tools/lxc_start.c -index 4553cb5c..8f03f111 100644 +index 4553cb5..8f03f11 100644 --- a/src/lxc/tools/lxc_start.c +++ b/src/lxc/tools/lxc_start.c @@ -69,6 +69,8 @@ static const struct option my_longopts[] = { @@ -473,7 +473,7 @@ index 4553cb5c..8f03f111 100644 err = c->start(c, 0, NULL) ? EXIT_SUCCESS : EXIT_FAILURE; else diff --git a/src/lxc/utils.c b/src/lxc/utils.c -index 6e9165ae..67c3b3ef 100644 +index 6e9165a..67c3b3e 100644 --- a/src/lxc/utils.c +++ b/src/lxc/utils.c @@ -611,6 +611,19 @@ bool dir_exists(const char *path) @@ -514,7 +514,7 @@ index 6e9165ae..67c3b3ef 100644 { int ret; diff --git a/src/lxc/utils.h b/src/lxc/utils.h -index 94196d09..2d38178c 100644 +index 94196d0..2d38178 100644 --- a/src/lxc/utils.h +++ b/src/lxc/utils.h @@ -147,6 +147,8 @@ extern gid_t get_ns_gid(gid_t orig); @@ -534,5 +534,5 @@ index 94196d09..2d38178c 100644 + #endif /* __LXC_UTILS_H */ -- -2.23.0 +1.8.3.1 diff --git a/0010-Save-pid-ppid-info-into-file-for-isulad.patch b/0010-Save-pid-ppid-info-into-file-for-isulad.patch index 20da2a9d789a0e0647b4802d6c1818f6e107d34f..df2af1d228ed11770f487b7faef0ffccd338d89d 100644 --- a/0010-Save-pid-ppid-info-into-file-for-isulad.patch +++ b/0010-Save-pid-ppid-info-into-file-for-isulad.patch @@ -1,23 +1,23 @@ -From 091e9a9121c04a96a3d8a227a133ca6616f0b86f Mon Sep 17 00:00:00 2001 +From 891845a031814911a72b8eed95c4d44426b7e69c Mon Sep 17 00:00:00 2001 From: LiFeng Date: Fri, 11 Jan 2019 22:53:56 -0500 -Subject: [PATCH 010/131] Save pid/ppid info into file for isulad +Subject: [PATCH 010/138] Save pid/ppid info into file for isulad Signed-off-by: LiFeng --- src/lxc/conf.c | 1 + src/lxc/conf.h | 2 + - src/lxc/lxccontainer.c | 24 ++++++++ + src/lxc/lxccontainer.c | 24 ++++++++++ src/lxc/lxccontainer.h | 10 ++++ - src/lxc/start.c | 41 ++++++++++++++ + src/lxc/start.c | 41 +++++++++++++++++ src/lxc/tools/arguments.h | 2 + - src/lxc/tools/lxc_start.c | 20 +++++++ - src/lxc/utils.c | 114 ++++++++++++++++++++++++++++++++++++++ - src/lxc/utils.h | 66 ++++++++++++++++++++++ + src/lxc/tools/lxc_start.c | 20 ++++++++ + src/lxc/utils.c | 114 ++++++++++++++++++++++++++++++++++++++++++++++ + src/lxc/utils.h | 66 +++++++++++++++++++++++++++ 9 files changed, 280 insertions(+) diff --git a/src/lxc/conf.c b/src/lxc/conf.c -index 7b7f95b7..0b4b63b8 100644 +index 7b7f95b..0b4b63b 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -4194,6 +4194,7 @@ void lxc_conf_free(struct lxc_conf *conf) @@ -29,7 +29,7 @@ index 7b7f95b7..0b4b63b8 100644 free(conf); } diff --git a/src/lxc/conf.h b/src/lxc/conf.h -index cced868c..e0954f92 100644 +index cced868..e0954f9 100644 --- a/src/lxc/conf.h +++ b/src/lxc/conf.h @@ -403,6 +403,8 @@ struct lxc_conf { @@ -42,7 +42,7 @@ index cced868c..e0954f92 100644 }; diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c -index 318c71e6..5679b9b4 100644 +index 318c71e..5679b9b 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -4988,6 +4988,29 @@ static bool do_lxcapi_set_terminal_default_fifos(struct lxc_container *c, const @@ -84,7 +84,7 @@ index 318c71e6..5679b9b4 100644 return c; diff --git a/src/lxc/lxccontainer.h b/src/lxc/lxccontainer.h -index 486531e5..3c845fea 100644 +index 486531e..3c845fe 100644 --- a/src/lxc/lxccontainer.h +++ b/src/lxc/lxccontainer.h @@ -857,6 +857,16 @@ struct lxc_container { @@ -105,7 +105,7 @@ index 486531e5..3c845fea 100644 /*! diff --git a/src/lxc/start.c b/src/lxc/start.c -index d64bdac1..9d71dd79 100644 +index d64bdac..9d71dd7 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -1553,6 +1553,39 @@ static inline int do_share_ns(void *arg) @@ -164,7 +164,7 @@ index d64bdac1..9d71dd79 100644 if (handler->ns_on_clone_flags & ns_info[i].clone_flag) INFO("Cloned %s", ns_info[i].flag_name); diff --git a/src/lxc/tools/arguments.h b/src/lxc/tools/arguments.h -index b7af2b51..b6df23f8 100644 +index b7af2b5..b6df23f 100644 --- a/src/lxc/tools/arguments.h +++ b/src/lxc/tools/arguments.h @@ -63,6 +63,7 @@ struct lxc_arguments { @@ -184,7 +184,7 @@ index b7af2b51..b6df23f8 100644 extern int lxc_arguments_parse(struct lxc_arguments *args, int argc, diff --git a/src/lxc/tools/lxc_start.c b/src/lxc/tools/lxc_start.c -index 8f03f111..2f94d671 100644 +index 8f03f11..2f94d67 100644 --- a/src/lxc/tools/lxc_start.c +++ b/src/lxc/tools/lxc_start.c @@ -69,8 +69,11 @@ static const struct option my_longopts[] = { @@ -244,7 +244,7 @@ index 8f03f111..2f94d671 100644 exit(err); } diff --git a/src/lxc/utils.c b/src/lxc/utils.c -index 67c3b3ef..4728284f 100644 +index 67c3b3e..4728284 100644 --- a/src/lxc/utils.c +++ b/src/lxc/utils.c @@ -1828,3 +1828,117 @@ int lxc_setup_keyring(void) @@ -366,7 +366,7 @@ index 67c3b3ef..4728284f 100644 +} + diff --git a/src/lxc/utils.h b/src/lxc/utils.h -index 2d38178c..8e4ed894 100644 +index 2d38178..8e4ed89 100644 --- a/src/lxc/utils.h +++ b/src/lxc/utils.h @@ -56,6 +56,71 @@ extern char *get_rundir(void); @@ -449,5 +449,5 @@ index 2d38178c..8e4ed894 100644 #endif /* __LXC_UTILS_H */ -- -2.23.0 +1.8.3.1 diff --git a/0011-Add-exit-FIFO-to-monitor-state-of-lxc-monitor.patch b/0011-Add-exit-FIFO-to-monitor-state-of-lxc-monitor.patch index 954178a9f354db9c084ea9e966aa07d1452b543b..0ee612819804ccbef218723c639fd0943ce66c98 100644 --- a/0011-Add-exit-FIFO-to-monitor-state-of-lxc-monitor.patch +++ b/0011-Add-exit-FIFO-to-monitor-state-of-lxc-monitor.patch @@ -1,7 +1,7 @@ -From 8d93081e3d8384dbb2b2b5dd14d02b0394af8c15 Mon Sep 17 00:00:00 2001 +From 0ebd912b689734dce70226495a5ac35893dda615 Mon Sep 17 00:00:00 2001 From: LiFeng Date: Sat, 12 Jan 2019 02:07:15 -0500 -Subject: [PATCH 011/131] Add exit FIFO to monitor state of [lxc monitor] +Subject: [PATCH 011/138] Add exit FIFO to monitor state of [lxc monitor] Signed-off-by: LiFeng --- @@ -18,7 +18,7 @@ Signed-off-by: LiFeng 10 files changed, 59 insertions(+), 7 deletions(-) diff --git a/src/lxc/conf.c b/src/lxc/conf.c -index 0b4b63b8..bc45e448 100644 +index 0b4b63b..bc45e44 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -2759,6 +2759,7 @@ struct lxc_conf *lxc_conf_init(void) @@ -39,7 +39,7 @@ index 0b4b63b8..bc45e448 100644 free(conf); } diff --git a/src/lxc/conf.h b/src/lxc/conf.h -index e0954f92..2d939cd2 100644 +index e0954f9..2d939cd 100644 --- a/src/lxc/conf.h +++ b/src/lxc/conf.h @@ -405,6 +405,8 @@ struct lxc_conf { @@ -52,7 +52,7 @@ index e0954f92..2d939cd2 100644 }; diff --git a/src/lxc/confile.c b/src/lxc/confile.c -index e3212d3d..cbef2e21 100644 +index e3212d3..cbef2e2 100644 --- a/src/lxc/confile.c +++ b/src/lxc/confile.c @@ -240,10 +240,10 @@ static struct lxc_config_t config_jump_table[] = { @@ -71,7 +71,7 @@ index e3212d3d..cbef2e21 100644 static const size_t config_jump_table_size = sizeof(config_jump_table) / sizeof(struct lxc_config_t); diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c -index 5679b9b4..8029f339 100644 +index 5679b9b..8029f33 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -295,6 +295,10 @@ static void lxc_container_free(struct lxc_container *c) @@ -123,7 +123,7 @@ index 5679b9b4..8029f339 100644 sizeof(keepfds) / sizeof(keepfds[0])); if (ret < 0) { diff --git a/src/lxc/lxccontainer.h b/src/lxc/lxccontainer.h -index 3c845fea..503038af 100644 +index 3c845fe..503038a 100644 --- a/src/lxc/lxccontainer.h +++ b/src/lxc/lxccontainer.h @@ -81,6 +81,12 @@ struct lxc_container { @@ -140,7 +140,7 @@ index 3c845fea..503038af 100644 * \private * Container semaphore lock. diff --git a/src/lxc/start.c b/src/lxc/start.c -index 9d71dd79..9365d116 100644 +index 9d71dd7..9365d11 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -730,6 +730,7 @@ struct lxc_handler *lxc_init_handler(const char *name, struct lxc_conf *conf, @@ -175,7 +175,7 @@ index 9d71dd79..9365d116 100644 out_fini: lxc_delete_network(handler); diff --git a/src/lxc/start.h b/src/lxc/start.h -index df987dcb..f59bf549 100644 +index df987dc..f59bf54 100644 --- a/src/lxc/start.h +++ b/src/lxc/start.h @@ -133,6 +133,8 @@ struct lxc_handler { @@ -188,7 +188,7 @@ index df987dcb..f59bf549 100644 struct execute_args { diff --git a/src/lxc/terminal.c b/src/lxc/terminal.c -index c5077122..508e2e67 100644 +index c507712..508e2e6 100644 --- a/src/lxc/terminal.c +++ b/src/lxc/terminal.c @@ -1004,8 +1004,8 @@ static int lxc_terminal_set_fifo(struct lxc_terminal *console, const char *in, c @@ -203,7 +203,7 @@ index c5077122..508e2e67 100644 return lxc_terminal_set_fifo(terminal, terminal->init_fifo[0], terminal->init_fifo[1]); diff --git a/src/lxc/tools/arguments.h b/src/lxc/tools/arguments.h -index b6df23f8..61f4a0a7 100644 +index b6df23f..61f4a0a 100644 --- a/src/lxc/tools/arguments.h +++ b/src/lxc/tools/arguments.h @@ -64,6 +64,7 @@ struct lxc_arguments { @@ -223,7 +223,7 @@ index b6df23f8..61f4a0a7 100644 extern int lxc_arguments_parse(struct lxc_arguments *args, int argc, diff --git a/src/lxc/tools/lxc_start.c b/src/lxc/tools/lxc_start.c -index 2f94d671..60c7d70b 100644 +index 2f94d67..60c7d70 100644 --- a/src/lxc/tools/lxc_start.c +++ b/src/lxc/tools/lxc_start.c @@ -73,6 +73,7 @@ static const struct option my_longopts[] = { @@ -257,5 +257,5 @@ index 2f94d671..60c7d70b 100644 if (!c->set_config_item(c, "lxc.console.path", my_args.console)) goto out; -- -2.23.0 +1.8.3.1 diff --git a/0012-Init-fifos-in-lxc_attach_terminal.patch b/0012-Init-fifos-in-lxc_attach_terminal.patch index 2a6babfd051b46c732ee4b6cb8f879cac71d3651..0d76169bd464d87ff1f8dfb449ff14019307b159 100644 --- a/0012-Init-fifos-in-lxc_attach_terminal.patch +++ b/0012-Init-fifos-in-lxc_attach_terminal.patch @@ -1,7 +1,7 @@ -From bcd44e3419e34357a47e54ed30b2091648aabb03 Mon Sep 17 00:00:00 2001 +From 2cecb3a3476d62937a123d59bbeab5aafa7e5c39 Mon Sep 17 00:00:00 2001 From: LiFeng Date: Sat, 12 Jan 2019 03:23:53 -0500 -Subject: [PATCH 012/131] Init fifos in lxc_attach_terminal +Subject: [PATCH 012/138] Init fifos in lxc_attach_terminal Signed-off-by: LiFeng --- @@ -9,7 +9,7 @@ Signed-off-by: LiFeng 1 file changed, 4 insertions(+) diff --git a/src/lxc/terminal.c b/src/lxc/terminal.c -index 508e2e67..410f643c 100644 +index 508e2e6..410f643 100644 --- a/src/lxc/terminal.c +++ b/src/lxc/terminal.c @@ -1341,6 +1341,10 @@ void lxc_terminal_init(struct lxc_terminal *terminal) @@ -24,5 +24,5 @@ index 508e2e67..410f643c 100644 /* isulad: judge the fd whether is fifo */ -- -2.23.0 +1.8.3.1 diff --git a/0013-isulad-set-env-home-in-container.patch b/0013-isulad-set-env-home-in-container.patch index c7a6e23999caf42cb2dc54a6cc938aba49979cd9..5d3772fb92c3fee13e339d9eef7945537431eba2 100644 --- a/0013-isulad-set-env-home-in-container.patch +++ b/0013-isulad-set-env-home-in-container.patch @@ -1,7 +1,7 @@ -From 7c8ec2cca91b15442f58a32c986f00b7064253ca Mon Sep 17 00:00:00 2001 +From 9b0dd80f08b4a21c9ab2ff6a7fd5f74c281825bb Mon Sep 17 00:00:00 2001 From: tanyifeng Date: Sat, 12 Jan 2019 14:42:27 +0800 -Subject: [PATCH 013/131] isulad: set env home in container +Subject: [PATCH 013/138] isulad: set env home in container Signed-off-by: LiFeng --- @@ -14,7 +14,7 @@ Signed-off-by: LiFeng 6 files changed, 45 insertions(+), 3 deletions(-) diff --git a/src/lxc/attach.c b/src/lxc/attach.c -index e7ba705c..2bbf1eb5 100644 +index e7ba705..2bbf1eb 100644 --- a/src/lxc/attach.c +++ b/src/lxc/attach.c @@ -876,6 +876,11 @@ static int attach_child_main(struct attach_clone_payload *payload) @@ -30,7 +30,7 @@ index e7ba705c..2bbf1eb5 100644 init_ctx->container->lxc_conf->no_new_privs) || (options->attach_flags & LXC_ATTACH_NO_NEW_PRIVS)) { diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c -index aff2b5e1..3e702b34 100644 +index aff2b5e..3e702b3 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -1704,8 +1704,9 @@ __cgfsng_ops static bool cgfsng_mount(struct cgroup_ops *ops, @@ -46,7 +46,7 @@ index aff2b5e1..3e702b34 100644 if (ret < 0) { free(controllerpath); diff --git a/src/lxc/conf.c b/src/lxc/conf.c -index bc45e448..5065e697 100644 +index bc45e44..5065e69 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -3680,7 +3680,7 @@ int lxc_setup(struct lxc_handler *handler) @@ -59,7 +59,7 @@ index bc45e448..5065e697 100644 ret = setup_mount_entries(lxc_conf, &lxc_conf->rootfs, &lxc_conf->mount_list, name, lxcpath); diff --git a/src/lxc/start.c b/src/lxc/start.c -index 9365d116..b13326ce 100644 +index 9365d11..b13326c 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -1398,6 +1398,10 @@ static int do_start(void *data) @@ -74,7 +74,7 @@ index 9365d116..b13326ce 100644 if (new_uid == nsuid) new_uid = LXC_INVALID_UID; diff --git a/src/lxc/utils.c b/src/lxc/utils.c -index 4728284f..74e74a15 100644 +index 4728284..74e74a1 100644 --- a/src/lxc/utils.c +++ b/src/lxc/utils.c @@ -45,6 +45,7 @@ @@ -121,7 +121,7 @@ index 4728284f..74e74a15 100644 static int lxc_file2str(const char *filename, char ret[], int cap) { diff --git a/src/lxc/utils.h b/src/lxc/utils.h -index 8e4ed894..364bf672 100644 +index 8e4ed89..364bf67 100644 --- a/src/lxc/utils.h +++ b/src/lxc/utils.h @@ -309,6 +309,9 @@ extern int fd_cloexec(int fd, bool cloexec); @@ -135,5 +135,5 @@ index 8e4ed894..364bf672 100644 extern int unsigned long long lxc_get_process_startat(pid_t pid); -- -2.23.0 +1.8.3.1 diff --git a/0014-support-rotate-for-container-log-file.patch b/0014-support-rotate-for-container-log-file.patch index f52b57b230b24bd69db558e8ff435e9591aff56f..73c51c2a48003e78330cd61e86d8b5e176c4f2a4 100644 --- a/0014-support-rotate-for-container-log-file.patch +++ b/0014-support-rotate-for-container-log-file.patch @@ -1,7 +1,7 @@ -From e5a0cdcd196da8697a2a83f8122245d29c90247c Mon Sep 17 00:00:00 2001 +From 525ebf75258bcc7ea9edeeb726c9b3363bb80d80 Mon Sep 17 00:00:00 2001 From: liuhao Date: Sat, 12 Jan 2019 15:29:56 +0800 -Subject: [PATCH 014/131] support rotate for container log file +Subject: [PATCH 014/138] support rotate for container log file support rotate for container log file @@ -12,7 +12,7 @@ Signed-off-by: LiFeng 2 files changed, 43 insertions(+) diff --git a/src/lxc/confile.c b/src/lxc/confile.c -index cbef2e21..e7822115 100644 +index cbef2e2..e782211 100644 --- a/src/lxc/confile.c +++ b/src/lxc/confile.c @@ -1802,11 +1802,14 @@ static int set_config_console_rotate(const char *key, const char *value, @@ -31,7 +31,7 @@ index cbef2e21..e7822115 100644 return 0; } diff --git a/src/lxc/terminal.c b/src/lxc/terminal.c -index 410f643c..3bb3a52a 100644 +index 410f643..3bb3a52 100644 --- a/src/lxc/terminal.c +++ b/src/lxc/terminal.c @@ -229,6 +229,39 @@ static int lxc_terminal_truncate_log_file(struct lxc_terminal *terminal) @@ -89,5 +89,5 @@ index 410f643c..3bb3a52a 100644 tmp = alloca(len); -- -2.23.0 +1.8.3.1 diff --git a/0015-fix-high-gcc-compile-bug.patch b/0015-fix-high-gcc-compile-bug.patch index 4dbd69802488526a13473562e841d51d503fa1f7..baa8aa3b8e5eb2a09cfd580175d5c17815d9f747 100644 --- a/0015-fix-high-gcc-compile-bug.patch +++ b/0015-fix-high-gcc-compile-bug.patch @@ -1,7 +1,7 @@ -From 887c38c0198592051e2323d8c2921f5ec4c22741 Mon Sep 17 00:00:00 2001 +From b5365278bc22ab4798d5ebd7bdb7c9d110b60124 Mon Sep 17 00:00:00 2001 From: liuhao Date: Sat, 12 Jan 2019 16:28:41 +0800 -Subject: [PATCH 015/131] fix high gcc compile bug +Subject: [PATCH 015/138] fix high gcc compile bug fix high gcc compile bug @@ -11,7 +11,7 @@ Signed-off-by: LiFeng 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lxc/terminal.c b/src/lxc/terminal.c -index 3bb3a52a..7aa47309 100644 +index 3bb3a52..7aa4730 100644 --- a/src/lxc/terminal.c +++ b/src/lxc/terminal.c @@ -235,18 +235,18 @@ static int lxc_terminal_truncate_log_file(struct lxc_terminal *terminal) @@ -37,5 +37,5 @@ index 3bb3a52a..7aa47309 100644 free(rename_fname); return -EFBIG; -- -2.23.0 +1.8.3.1 diff --git a/0016-add-masked-paths-and-ro-paths.patch b/0016-add-masked-paths-and-ro-paths.patch index f845ba1bb0c06b68058b9fe834f5df500a8315f7..f18f36191417c3682aac781693d25ac3cfca6273 100644 --- a/0016-add-masked-paths-and-ro-paths.patch +++ b/0016-add-masked-paths-and-ro-paths.patch @@ -1,17 +1,17 @@ -From 8ae551897a4ab1c56019767640d0600eaebc993d Mon Sep 17 00:00:00 2001 +From e1a53f3d458be5b8c9b9301a9e6280a2c64bf00b Mon Sep 17 00:00:00 2001 From: tanyifeng Date: Sat, 12 Jan 2019 15:55:52 +0800 -Subject: [PATCH 016/131] add masked paths and ro paths +Subject: [PATCH 016/138] add masked paths and ro paths Signed-off-by: LiFeng --- - src/lxc/conf.c | 135 ++++++++++++++++++++++++++++++++++++++++++++++ - src/lxc/conf.h | 8 +++ - src/lxc/confile.c | 113 +++++++++++++++++++++++++++++++++++++- + src/lxc/conf.c | 135 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ + src/lxc/conf.h | 8 ++++ + src/lxc/confile.c | 113 ++++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 255 insertions(+), 1 deletion(-) diff --git a/src/lxc/conf.c b/src/lxc/conf.c -index 5065e697..537f956c 100644 +index 5065e69..537f956 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -1343,6 +1343,95 @@ static int lxc_mount_rootfs(struct lxc_conf *conf) @@ -185,7 +185,7 @@ index 5065e697..537f956c 100644 if (conf->exit_fd != -1) close(conf->exit_fd); diff --git a/src/lxc/conf.h b/src/lxc/conf.h -index 2d939cd2..79278128 100644 +index 2d939cd..7927812 100644 --- a/src/lxc/conf.h +++ b/src/lxc/conf.h @@ -160,6 +160,8 @@ struct lxc_tty_info { @@ -218,7 +218,7 @@ index 2d939cd2..79278128 100644 /* isulad add end */ diff --git a/src/lxc/confile.c b/src/lxc/confile.c -index e7822115..e1999656 100644 +index e782211..e199965 100644 --- a/src/lxc/confile.c +++ b/src/lxc/confile.c @@ -139,6 +139,8 @@ lxc_config_define(pty_max); @@ -377,5 +377,5 @@ index e7822115..e1999656 100644 struct lxc_conf *c, void *data) { -- -2.23.0 +1.8.3.1 diff --git a/0017-isulad-check-cgroup-cpu.shares-after-setted.patch b/0017-isulad-check-cgroup-cpu.shares-after-setted.patch index 57d4d425b27dd04c800b9898e38e4b6ab69cde06..fcb9616698786f5675138f11e4aced10c4a69400 100644 --- a/0017-isulad-check-cgroup-cpu.shares-after-setted.patch +++ b/0017-isulad-check-cgroup-cpu.shares-after-setted.patch @@ -1,15 +1,15 @@ -From 7b916ae46720ce394cc49ee605ae678c73d62640 Mon Sep 17 00:00:00 2001 +From 21741c37e812d677d3adf3c721c4343e04a81c65 Mon Sep 17 00:00:00 2001 From: tanyifeng Date: Mon, 14 Jan 2019 11:03:03 +0800 -Subject: [PATCH 017/131] isulad: check cgroup cpu.shares after setted +Subject: [PATCH 017/138] isulad: check cgroup cpu.shares after setted Signed-off-by: LiFeng --- - src/lxc/cgroups/cgfsng.c | 61 ++++++++++++++++++++++++++++++++++++++++ + src/lxc/cgroups/cgfsng.c | 61 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c -index 3e702b34..ab5732ba 100644 +index 3e702b3..ab5732b 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -2204,6 +2204,42 @@ static int cg_legacy_set_data(struct cgroup_ops *ops, const char *filename, @@ -95,5 +95,5 @@ index 3e702b34..ab5732ba 100644 ret = true; -- -2.23.0 +1.8.3.1 diff --git a/0018-lxc-attach-add-support-terminal-fifos.patch b/0018-lxc-attach-add-support-terminal-fifos.patch index fe77ed7b0073c16bf63171f502ad5615386e7f3f..9621b51089fe687b5bed1ea27d2a343bf71b9dc0 100644 --- a/0018-lxc-attach-add-support-terminal-fifos.patch +++ b/0018-lxc-attach-add-support-terminal-fifos.patch @@ -1,22 +1,22 @@ -From 1f5b601dcc5ccd9f2699495134d1adfc0473cb18 Mon Sep 17 00:00:00 2001 +From de7a18f60c2339c6b962caf7f0ee967993d7e579 Mon Sep 17 00:00:00 2001 From: LiFeng Date: Mon, 14 Jan 2019 02:18:26 -0500 -Subject: [PATCH 018/131] lxc-attach: add support terminal fifos +Subject: [PATCH 018/138] lxc-attach: add support terminal fifos 1. support terminal fifos to redirect terminal 2. support lxc-attach run in background Signed-off-by: LiFeng --- - src/lxc/attach.c | 18 +++- + src/lxc/attach.c | 18 ++++- src/lxc/attach_options.h | 3 + - src/lxc/terminal.c | 27 ++++-- + src/lxc/terminal.c | 27 +++++-- src/lxc/tools/arguments.h | 2 +- - src/lxc/tools/lxc_attach.c | 181 +++++++++++++++++++++++++++++++++---- + src/lxc/tools/lxc_attach.c | 181 +++++++++++++++++++++++++++++++++++++++++---- 5 files changed, 204 insertions(+), 27 deletions(-) diff --git a/src/lxc/attach.c b/src/lxc/attach.c -index 2bbf1eb5..1886bdef 100644 +index 2bbf1eb..1886bde 100644 --- a/src/lxc/attach.c +++ b/src/lxc/attach.c @@ -988,12 +988,23 @@ on_error: @@ -71,7 +71,7 @@ index 2bbf1eb5..1886bdef 100644 if (ret < 0) ERROR("Failed to exec"); diff --git a/src/lxc/attach_options.h b/src/lxc/attach_options.h -index 193fd7e7..081618cd 100644 +index 193fd7e..081618c 100644 --- a/src/lxc/attach_options.h +++ b/src/lxc/attach_options.h @@ -135,6 +135,8 @@ typedef struct lxc_attach_options_t { @@ -92,7 +92,7 @@ index 193fd7e7..081618cd 100644 /*! diff --git a/src/lxc/terminal.c b/src/lxc/terminal.c -index 7aa47309..ee3aef21 100644 +index 7aa4730..ee3aef2 100644 --- a/src/lxc/terminal.c +++ b/src/lxc/terminal.c @@ -514,7 +514,7 @@ static int lxc_terminal_mainloop_add_peer(struct lxc_terminal *terminal) @@ -155,7 +155,7 @@ index 7aa47309..ee3aef21 100644 return -1; diff --git a/src/lxc/tools/arguments.h b/src/lxc/tools/arguments.h -index 61f4a0a7..047e9f16 100644 +index 61f4a0a..047e9f1 100644 --- a/src/lxc/tools/arguments.h +++ b/src/lxc/tools/arguments.h @@ -62,7 +62,7 @@ struct lxc_arguments { @@ -168,7 +168,7 @@ index 61f4a0a7..047e9f16 100644 const char *exit_monitor_fifo; /* isulad: fifo used to monitor state of monitor process */ diff --git a/src/lxc/tools/lxc_attach.c b/src/lxc/tools/lxc_attach.c -index 8c8e7d39..6d0ffe57 100644 +index 8c8e7d3..6d0ffe5 100644 --- a/src/lxc/tools/lxc_attach.c +++ b/src/lxc/tools/lxc_attach.c @@ -75,6 +75,8 @@ static const struct option my_longopts[] = { @@ -406,5 +406,5 @@ index 8c8e7d39..6d0ffe57 100644 exit(EXIT_FAILURE); -- -2.23.0 +1.8.3.1 diff --git a/0019-remount-cgroup-readonly-and-make-soft-link-of-subcgr.patch b/0019-remount-cgroup-readonly-and-make-soft-link-of-subcgr.patch index 8a4b4be82fb494456de71a29c6602d4160ad4e12..f50119143d1946330a560f2ffc56ed8cc6ca6503 100644 --- a/0019-remount-cgroup-readonly-and-make-soft-link-of-subcgr.patch +++ b/0019-remount-cgroup-readonly-and-make-soft-link-of-subcgr.patch @@ -1,16 +1,16 @@ -From 9a6ef0c1f9a7d91b7b4362082ad7ae05cc8a1e6b Mon Sep 17 00:00:00 2001 +From bf718c9619dc27da6c196f71d1552855b8436cc0 Mon Sep 17 00:00:00 2001 From: tanyifeng Date: Mon, 14 Jan 2019 13:51:01 +0800 -Subject: [PATCH 019/131] remount cgroup readonly and make soft link of +Subject: [PATCH 019/138] remount cgroup readonly and make soft link of subcgroup Signed-off-by: LiFeng --- - src/lxc/cgroups/cgfsng.c | 44 ++++++++++++++++++++++++++++++++++++++++ + src/lxc/cgroups/cgfsng.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c -index ab5732ba..705985f2 100644 +index ab5732b..705985f 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -1621,6 +1621,7 @@ __cgfsng_ops static bool cgfsng_mount(struct cgroup_ops *ops, @@ -83,5 +83,5 @@ index ab5732ba..705985f2 100644 } -- -2.23.0 +1.8.3.1 diff --git a/0020-fix-log-error-when-symlink-subcgroup.patch b/0020-fix-log-error-when-symlink-subcgroup.patch index 3ee10088cc871bbbb223105c598724c6380ff0be..c0c014fd672664d06a8f9dbf649b9cf23808686d 100644 --- a/0020-fix-log-error-when-symlink-subcgroup.patch +++ b/0020-fix-log-error-when-symlink-subcgroup.patch @@ -1,7 +1,7 @@ -From 43ea109da4ebe985fa1990b0289f41f3ec30c747 Mon Sep 17 00:00:00 2001 +From c3be42e31402b3361f15d6a6d25a39f36cb58234 Mon Sep 17 00:00:00 2001 From: tanyifeng Date: Mon, 14 Jan 2019 15:33:12 +0800 -Subject: [PATCH 020/131] fix log error when symlink subcgroup +Subject: [PATCH 020/138] fix log error when symlink subcgroup Signed-off-by: LiFeng --- @@ -9,7 +9,7 @@ Signed-off-by: LiFeng 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c -index 705985f2..7f2a200a 100644 +index 705985f..7f2a200 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -1736,21 +1736,21 @@ __cgfsng_ops static bool cgfsng_mount(struct cgroup_ops *ops, @@ -40,5 +40,5 @@ index 705985f2..7f2a200a 100644 } -- -2.23.0 +1.8.3.1 diff --git a/0021-lxc-attch-add-error-message.patch b/0021-lxc-attch-add-error-message.patch index cddb83147a0c1455be45559a0dfc5f1320dde969..d52264f4c9ce92d5f34cdfcd968061d74033e95e 100644 --- a/0021-lxc-attch-add-error-message.patch +++ b/0021-lxc-attch-add-error-message.patch @@ -1,24 +1,24 @@ -From df2061c420b0ca9af3f3248a249458e64d399c12 Mon Sep 17 00:00:00 2001 +From 1c8e603aed10f387d6f74b51551c76c0154e1ad5 Mon Sep 17 00:00:00 2001 From: LiFeng Date: Mon, 14 Jan 2019 04:29:40 -0500 -Subject: [PATCH 021/131] lxc-attch: add error message +Subject: [PATCH 021/138] lxc-attch: add error message Signed-off-by: LiFeng --- - src/lxc/attach.c | 49 ++++++++++++++++++++++++++++++++++---- + src/lxc/attach.c | 49 +++++++++++++++++++++++++++++++++++++++++----- src/lxc/attach.h | 4 ++-- - src/lxc/attach_options.h | 6 ++--- - src/lxc/conf.c | 27 +++++++++++++++++---- + src/lxc/attach_options.h | 6 +++--- + src/lxc/conf.c | 27 +++++++++++++++++++++---- src/lxc/conf.h | 3 +++ src/lxc/lxccontainer.c | 4 ++-- - src/lxc/tools/lxc_attach.c | 8 +++---- + src/lxc/tools/lxc_attach.c | 8 ++++---- src/lxc/tools/lxc_ls.c | 4 ++-- - src/lxc/utils.c | 21 ++++++++++++++++ + src/lxc/utils.c | 21 ++++++++++++++++++++ src/lxc/utils.h | 1 + 10 files changed, 105 insertions(+), 22 deletions(-) diff --git a/src/lxc/attach.c b/src/lxc/attach.c -index 1886bdef..570b9d0e 100644 +index 1886bde..570b9d0 100644 --- a/src/lxc/attach.c +++ b/src/lxc/attach.c @@ -757,10 +757,15 @@ static int attach_child_main(struct attach_clone_payload *payload) @@ -142,7 +142,7 @@ index 1886bdef..570b9d0e 100644 uid_t uid; struct passwd pwent; diff --git a/src/lxc/attach.h b/src/lxc/attach.h -index 4bf9578e..e62b98bc 100644 +index 4bf9578..e62b98b 100644 --- a/src/lxc/attach.h +++ b/src/lxc/attach.h @@ -42,7 +42,7 @@ struct lxc_proc_context_info { @@ -156,7 +156,7 @@ index 4bf9578e..e62b98bc 100644 #endif /* __LXC_ATTACH_H */ diff --git a/src/lxc/attach_options.h b/src/lxc/attach_options.h -index 081618cd..7b0a8cb3 100644 +index 081618c..7b0a8cb 100644 --- a/src/lxc/attach_options.h +++ b/src/lxc/attach_options.h @@ -71,7 +71,7 @@ enum { @@ -187,7 +187,7 @@ index 081618cd..7b0a8cb3 100644 #ifdef __cplusplus } diff --git a/src/lxc/conf.c b/src/lxc/conf.c -index 537f956c..8d8230fb 100644 +index 537f956..8d8230f 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -2803,10 +2803,6 @@ struct lxc_conf *lxc_conf_init(void) @@ -246,7 +246,7 @@ index 537f956c..8d8230fb 100644 free(conf); } diff --git a/src/lxc/conf.h b/src/lxc/conf.h -index 79278128..db474e11 100644 +index 7927812..db474e1 100644 --- a/src/lxc/conf.h +++ b/src/lxc/conf.h @@ -413,6 +413,9 @@ struct lxc_conf { @@ -260,7 +260,7 @@ index 79278128..db474e11 100644 }; diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c -index 8029f339..31f4819e 100644 +index 8029f33..31f4819 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -4063,7 +4063,7 @@ static int lxcapi_attach(struct lxc_container *c, lxc_attach_exec_t exec_functio @@ -282,7 +282,7 @@ index 8029f339..31f4819e 100644 ERROR("ups"); return r; diff --git a/src/lxc/tools/lxc_attach.c b/src/lxc/tools/lxc_attach.c -index 6d0ffe57..a590fd12 100644 +index 6d0ffe5..a590fd1 100644 --- a/src/lxc/tools/lxc_attach.c +++ b/src/lxc/tools/lxc_attach.c @@ -295,8 +295,8 @@ static int do_attach_foreground(struct lxc_container *c, lxc_attach_command_t *c @@ -308,7 +308,7 @@ index 6d0ffe57..a590fd12 100644 msgpipe[1] = -1; ret = -1; diff --git a/src/lxc/tools/lxc_ls.c b/src/lxc/tools/lxc_ls.c -index cb3eb1e5..e261c7bf 100644 +index cb3eb1e..e261c7b 100644 --- a/src/lxc/tools/lxc_ls.c +++ b/src/lxc/tools/lxc_ls.c @@ -122,7 +122,7 @@ struct wrapargs { @@ -330,7 +330,7 @@ index cb3eb1e5..e261c7bf 100644 int ret = -1; size_t len = 0; diff --git a/src/lxc/utils.c b/src/lxc/utils.c -index 74e74a15..8ec9f461 100644 +index 74e74a1..8ec9f46 100644 --- a/src/lxc/utils.c +++ b/src/lxc/utils.c @@ -1971,3 +1971,24 @@ out: @@ -359,7 +359,7 @@ index 74e74a15..8ec9f461 100644 +} + diff --git a/src/lxc/utils.h b/src/lxc/utils.h -index 364bf672..3d56fd93 100644 +index 364bf67..3d56fd9 100644 --- a/src/lxc/utils.h +++ b/src/lxc/utils.h @@ -314,5 +314,6 @@ extern int lxc_setup_env_home(uid_t uid); @@ -370,5 +370,5 @@ index 364bf672..3d56fd93 100644 #endif /* __LXC_UTILS_H */ -- -2.23.0 +1.8.3.1 diff --git a/0022-support-rootfs-mount-propagation.patch b/0022-support-rootfs-mount-propagation.patch index 35b56ad8888d939a52f411128d2ea61e84af1c07..2358e8665db5e0fa805cfe6ee2f4a3160ed9b789 100644 --- a/0022-support-rootfs-mount-propagation.patch +++ b/0022-support-rootfs-mount-propagation.patch @@ -1,11 +1,11 @@ -From f266297dbbc4a0278ca993946656fb664a674336 Mon Sep 17 00:00:00 2001 +From 5748a52d562b6a72f958a632a8ab8bd9b0157e11 Mon Sep 17 00:00:00 2001 From: tanyifeng Date: Mon, 14 Jan 2019 17:02:02 +0800 -Subject: [PATCH 022/131] support rootfs mount propagation +Subject: [PATCH 022/138] support rootfs mount propagation Signed-off-by: LiFeng --- - src/lxc/conf.c | 230 +++++++++++++++++++++----------- + src/lxc/conf.c | 230 ++++++++++++++++++++++++++-------------- src/lxc/conf.h | 2 +- src/lxc/confile.c | 8 +- src/lxc/criu.c | 4 +- @@ -17,7 +17,7 @@ Signed-off-by: LiFeng 9 files changed, 165 insertions(+), 104 deletions(-) diff --git a/src/lxc/conf.c b/src/lxc/conf.c -index 8d8230fb..55d1e453 100644 +index 8d8230f..55d1e45 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -1296,11 +1296,102 @@ static int lxc_fill_autodev(const struct lxc_rootfs *rootfs) @@ -338,7 +338,7 @@ index 8d8230fb..55d1e453 100644 ret = run_lxc_hooks(name, "pre-mount", conf, NULL); if (ret < 0) { diff --git a/src/lxc/conf.h b/src/lxc/conf.h -index db474e11..7393dbfe 100644 +index db474e1..7393dbf 100644 --- a/src/lxc/conf.h +++ b/src/lxc/conf.h @@ -463,7 +463,7 @@ extern int userns_exec_1(struct lxc_conf *conf, int (*fn)(void *), void *data, @@ -351,7 +351,7 @@ index db474e11..7393dbfe 100644 extern void tmp_proc_unmount(struct lxc_conf *lxc_conf); extern void remount_all_slave(void); diff --git a/src/lxc/confile.c b/src/lxc/confile.c -index e1999656..db63b550 100644 +index e199965..db63b55 100644 --- a/src/lxc/confile.c +++ b/src/lxc/confile.c @@ -2065,16 +2065,10 @@ static int set_config_rootfs_options(const char *key, const char *value, @@ -373,7 +373,7 @@ index e1999656..db63b550 100644 if (ret < 0) { free(mdata); diff --git a/src/lxc/criu.c b/src/lxc/criu.c -index 31c19407..bb97859b 100644 +index 31c1940..bb97859 100644 --- a/src/lxc/criu.c +++ b/src/lxc/criu.c @@ -389,9 +389,9 @@ static void exec_criu(struct cgroup_ops *cgroup_ops, struct lxc_conf *conf, @@ -389,7 +389,7 @@ index 31c19407..bb97859b 100644 free(mntdata); diff --git a/src/lxc/storage/btrfs.c b/src/lxc/storage/btrfs.c -index bbfce61b..a02c2150 100644 +index bbfce61..a02c215 100644 --- a/src/lxc/storage/btrfs.c +++ b/src/lxc/storage/btrfs.c @@ -212,7 +212,7 @@ bool btrfs_detect(const char *path) @@ -411,7 +411,7 @@ index bbfce61b..a02c2150 100644 return -22; } diff --git a/src/lxc/storage/dir.c b/src/lxc/storage/dir.c -index 79b64696..c7b5ee27 100644 +index 79b6469..c7b5ee2 100644 --- a/src/lxc/storage/dir.c +++ b/src/lxc/storage/dir.c @@ -170,20 +170,13 @@ int dir_mount(struct lxc_storage *bdev) @@ -437,7 +437,7 @@ index 79b64696..c7b5ee27 100644 ret = mount(src, bdev->dest, "bind", MS_BIND | MS_REC | mntflags | pflags, mntdata); diff --git a/src/lxc/storage/overlay.c b/src/lxc/storage/overlay.c -index 01546b1b..90408a3b 100644 +index 01546b1..90408a3 100644 --- a/src/lxc/storage/overlay.c +++ b/src/lxc/storage/overlay.c @@ -495,7 +495,7 @@ int ovl_mount(struct lxc_storage *bdev) @@ -459,7 +459,7 @@ index 01546b1b..90408a3b 100644 ERROR("Failed to parse mount options"); free(mntdata); diff --git a/src/lxc/storage/storage_utils.c b/src/lxc/storage/storage_utils.c -index fa4e7270..46e08a35 100644 +index fa4e727..46e08a3 100644 --- a/src/lxc/storage/storage_utils.c +++ b/src/lxc/storage/storage_utils.c @@ -396,7 +396,7 @@ int find_fstype_cb(char *buffer, void *data) @@ -481,7 +481,7 @@ index fa4e7270..46e08a35 100644 return 0; } diff --git a/src/lxc/storage/zfs.c b/src/lxc/storage/zfs.c -index ba104da5..752b0c50 100644 +index ba104da..752b0c5 100644 --- a/src/lxc/storage/zfs.c +++ b/src/lxc/storage/zfs.c @@ -184,7 +184,7 @@ int zfs_mount(struct lxc_storage *bdev) @@ -503,5 +503,5 @@ index ba104da5..752b0c50 100644 ERROR("Failed to parse mount options"); free(mntdata); -- -2.23.0 +1.8.3.1 diff --git a/0023-attach.c-change-uid-and-gid-from-lxc-container-confi.patch b/0023-attach.c-change-uid-and-gid-from-lxc-container-confi.patch index 03f63a5c7e05815f8ec5a3235c319f493eaa495a..db5c0618349ca0c9478351d416c55c6f150dc438 100644 --- a/0023-attach.c-change-uid-and-gid-from-lxc-container-confi.patch +++ b/0023-attach.c-change-uid-and-gid-from-lxc-container-confi.patch @@ -1,7 +1,7 @@ -From 4952a0eadbe150322b295c124db10e02518d0515 Mon Sep 17 00:00:00 2001 +From 166964c25070bfb6055d380cca6b52782d097826 Mon Sep 17 00:00:00 2001 From: tanyifeng Date: Mon, 14 Jan 2019 17:09:57 +0800 -Subject: [PATCH 023/131] attach.c: change uid and gid from lxc container +Subject: [PATCH 023/138] attach.c: change uid and gid from lxc container config Signed-off-by: LiFeng @@ -10,7 +10,7 @@ Signed-off-by: LiFeng 1 file changed, 6 insertions(+) diff --git a/src/lxc/attach.c b/src/lxc/attach.c -index 570b9d0e..e6e4b0d1 100644 +index 570b9d0..e6e4b0d 100644 --- a/src/lxc/attach.c +++ b/src/lxc/attach.c @@ -1146,6 +1146,12 @@ int lxc_attach(const char *name, const char *lxcpath, @@ -27,5 +27,5 @@ index 570b9d0e..e6e4b0d1 100644 WARN("Failed to get seccomp policy"); -- -2.23.0 +1.8.3.1 diff --git a/0024-isulad-support-symlink-in-mount-entry-and-not-permit.patch b/0024-isulad-support-symlink-in-mount-entry-and-not-permit.patch index 73066ce04ff36b14cd33f2c461d49b828a663983..9147ec558147927c1e0f3924e9c33b8ab1d93c52 100644 --- a/0024-isulad-support-symlink-in-mount-entry-and-not-permit.patch +++ b/0024-isulad-support-symlink-in-mount-entry-and-not-permit.patch @@ -1,21 +1,21 @@ -From 472aa08222783b4255b60a4dd7a10197711bf703 Mon Sep 17 00:00:00 2001 +From 6e84696ab1628a9eb52ba2855bc39fb4ffd908b8 Mon Sep 17 00:00:00 2001 From: tanyifeng Date: Mon, 14 Jan 2019 20:12:06 +0800 -Subject: [PATCH 024/131] isulad: support symlink in mount entry, and not +Subject: [PATCH 024/138] isulad: support symlink in mount entry, and not permit mount to /proc Signed-off-by: LiFeng --- src/lxc/Makefile.am | 2 + - src/lxc/conf.c | 108 ++++++++- - src/lxc/path.c | 546 ++++++++++++++++++++++++++++++++++++++++++++ - src/lxc/path.h | 70 ++++++ + src/lxc/conf.c | 108 ++++++++++- + src/lxc/path.c | 546 ++++++++++++++++++++++++++++++++++++++++++++++++++++ + src/lxc/path.h | 70 +++++++ 4 files changed, 721 insertions(+), 5 deletions(-) create mode 100644 src/lxc/path.c create mode 100644 src/lxc/path.h diff --git a/src/lxc/Makefile.am b/src/lxc/Makefile.am -index 08e2fab6..f2928b7d 100644 +index 08e2fab..f2928b7 100644 --- a/src/lxc/Makefile.am +++ b/src/lxc/Makefile.am @@ -12,6 +12,7 @@ noinst_HEADERS = attach.h \ @@ -35,7 +35,7 @@ index 08e2fab6..f2928b7d 100644 criu.c criu.h \ error.c error.h \ diff --git a/src/lxc/conf.c b/src/lxc/conf.c -index 55d1e453..800573a8 100644 +index 55d1e45..800573a 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -77,6 +77,7 @@ @@ -189,7 +189,7 @@ index 55d1e453..800573a8 100644 diff --git a/src/lxc/path.c b/src/lxc/path.c new file mode 100644 -index 00000000..e917dcb8 +index 0000000..e917dcb --- /dev/null +++ b/src/lxc/path.c @@ -0,0 +1,546 @@ @@ -742,7 +742,7 @@ index 00000000..e917dcb8 \ No newline at end of file diff --git a/src/lxc/path.h b/src/lxc/path.h new file mode 100644 -index 00000000..e3a04cc5 +index 0000000..e3a04cc --- /dev/null +++ b/src/lxc/path.h @@ -0,0 +1,70 @@ @@ -817,5 +817,5 @@ index 00000000..e3a04cc5 + +#endif -- -2.23.0 +1.8.3.1 diff --git a/0025-support-oci-hooks.patch b/0025-support-oci-hooks.patch index e089eb9612299271cb4269de956df831e66236ac..acd06af47ca786c26921e735341df55c4dba8c98 100644 --- a/0025-support-oci-hooks.patch +++ b/0025-support-oci-hooks.patch @@ -1,7 +1,7 @@ -From 6ebea2ab8e91d294ba2d8d2821937a770f27fcb4 Mon Sep 17 00:00:00 2001 +From 6d039fb81856965a4aed6bb29c1d14f958245cde Mon Sep 17 00:00:00 2001 From: liuhao Date: Mon, 14 Jan 2019 17:47:17 +0800 -Subject: [PATCH 025/131] support oci hooks +Subject: [PATCH 025/138] support oci hooks support oci hooks @@ -9,22 +9,22 @@ Signed-off-by: LiFeng --- configure.ac | 3 + src/lxc/Makefile.am | 13 +- - src/lxc/conf.c | 528 ++++++++++++- + src/lxc/conf.c | 528 ++++++++++++++++- src/lxc/conf.h | 9 + - src/lxc/json/defs.c | 198 +++++ - src/lxc/json/defs.h | 37 + - src/lxc/json/json_common.c | 1196 ++++++++++++++++++++++++++++++ - src/lxc/json/json_common.h | 185 +++++ + src/lxc/json/defs.c | 198 +++++++ + src/lxc/json/defs.h | 37 ++ + src/lxc/json/json_common.c | 1196 ++++++++++++++++++++++++++++++++++++++ + src/lxc/json/json_common.h | 185 ++++++ src/lxc/json/oci_runtime_hooks.c | 53 ++ src/lxc/json/oci_runtime_hooks.h | 15 + - src/lxc/json/oci_runtime_spec.c | 196 +++++ - src/lxc/json/oci_runtime_spec.h | 37 + + src/lxc/json/oci_runtime_spec.c | 196 +++++++ + src/lxc/json/oci_runtime_spec.h | 37 ++ src/lxc/json/read-file.c | 94 +++ src/lxc/json/read-file.h | 11 + - src/lxc/lxccontainer.c | 66 ++ + src/lxc/lxccontainer.c | 66 +++ src/lxc/lxccontainer.h | 7 + src/lxc/start.c | 17 + - src/lxc/utils.c | 66 +- + src/lxc/utils.c | 66 ++- src/lxc/utils.h | 2 + 19 files changed, 2716 insertions(+), 17 deletions(-) create mode 100644 src/lxc/json/defs.c @@ -39,7 +39,7 @@ Signed-off-by: LiFeng create mode 100644 src/lxc/json/read-file.h diff --git a/configure.ac b/configure.ac -index 950c8dde..4da52a27 100644 +index 950c8dd..4da52a2 100644 --- a/configure.ac +++ b/configure.ac @@ -120,6 +120,9 @@ AM_CONDITIONAL([DISTRO_UBUNTU], [test "x$with_distro" = "xubuntu"]) @@ -53,7 +53,7 @@ index 950c8dde..4da52a27 100644 AC_MSG_CHECKING([for init system type]) AC_ARG_WITH([init-script], diff --git a/src/lxc/Makefile.am b/src/lxc/Makefile.am -index f2928b7d..5678b8da 100644 +index f2928b7..5678b8d 100644 --- a/src/lxc/Makefile.am +++ b/src/lxc/Makefile.am @@ -43,6 +43,11 @@ noinst_HEADERS = attach.h \ @@ -98,7 +98,7 @@ index f2928b7d..5678b8da 100644 liblxc_la_LIBADD = $(CAP_LIBS) \ $(GNUTLS_LIBS) \ diff --git a/src/lxc/conf.c b/src/lxc/conf.c -index 800573a8..6a14de1f 100644 +index 800573a..6a14de1 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -53,6 +53,7 @@ @@ -664,7 +664,7 @@ index 800573a8..6a14de1f 100644 free(conf->rootfs.mount); free(conf->rootfs.bdev_type); diff --git a/src/lxc/conf.h b/src/lxc/conf.h -index 7393dbfe..2263e47e 100644 +index 7393dbf..2263e47 100644 --- a/src/lxc/conf.h +++ b/src/lxc/conf.h @@ -35,6 +35,7 @@ @@ -699,7 +699,7 @@ index 7393dbfe..2263e47e 100644 char *lsm_se_context; diff --git a/src/lxc/json/defs.c b/src/lxc/json/defs.c new file mode 100644 -index 00000000..38df2f7a +index 0000000..38df2f7 --- /dev/null +++ b/src/lxc/json/defs.c @@ -0,0 +1,198 @@ @@ -903,7 +903,7 @@ index 00000000..38df2f7a +} diff --git a/src/lxc/json/defs.h b/src/lxc/json/defs.h new file mode 100644 -index 00000000..0bbd8ac8 +index 0000000..0bbd8ac --- /dev/null +++ b/src/lxc/json/defs.h @@ -0,0 +1,37 @@ @@ -946,7 +946,7 @@ index 00000000..0bbd8ac8 +#endif diff --git a/src/lxc/json/json_common.c b/src/lxc/json/json_common.c new file mode 100755 -index 00000000..8b91844d +index 0000000..8b91844 --- /dev/null +++ b/src/lxc/json/json_common.c @@ -0,0 +1,1196 @@ @@ -2148,7 +2148,7 @@ index 00000000..8b91844d +} diff --git a/src/lxc/json/json_common.h b/src/lxc/json/json_common.h new file mode 100755 -index 00000000..904fe3cd +index 0000000..904fe3c --- /dev/null +++ b/src/lxc/json/json_common.h @@ -0,0 +1,185 @@ @@ -2340,7 +2340,7 @@ index 00000000..904fe3cd \ No newline at end of file diff --git a/src/lxc/json/oci_runtime_hooks.c b/src/lxc/json/oci_runtime_hooks.c new file mode 100644 -index 00000000..3aa134ef +index 0000000..3aa134e --- /dev/null +++ b/src/lxc/json/oci_runtime_hooks.c @@ -0,0 +1,53 @@ @@ -2399,7 +2399,7 @@ index 00000000..3aa134ef +} diff --git a/src/lxc/json/oci_runtime_hooks.h b/src/lxc/json/oci_runtime_hooks.h new file mode 100644 -index 00000000..bf570c9e +index 0000000..bf570c9 --- /dev/null +++ b/src/lxc/json/oci_runtime_hooks.h @@ -0,0 +1,15 @@ @@ -2420,7 +2420,7 @@ index 00000000..bf570c9e +#endif diff --git a/src/lxc/json/oci_runtime_spec.c b/src/lxc/json/oci_runtime_spec.c new file mode 100644 -index 00000000..1f6073c9 +index 0000000..1f6073c --- /dev/null +++ b/src/lxc/json/oci_runtime_spec.c @@ -0,0 +1,196 @@ @@ -2622,7 +2622,7 @@ index 00000000..1f6073c9 +} diff --git a/src/lxc/json/oci_runtime_spec.h b/src/lxc/json/oci_runtime_spec.h new file mode 100644 -index 00000000..ef3f1619 +index 0000000..ef3f161 --- /dev/null +++ b/src/lxc/json/oci_runtime_spec.h @@ -0,0 +1,37 @@ @@ -2665,7 +2665,7 @@ index 00000000..ef3f1619 +#endif diff --git a/src/lxc/json/read-file.c b/src/lxc/json/read-file.c new file mode 100644 -index 00000000..ad0eda1e +index 0000000..ad0eda1 --- /dev/null +++ b/src/lxc/json/read-file.c @@ -0,0 +1,94 @@ @@ -2765,7 +2765,7 @@ index 00000000..ad0eda1e +} diff --git a/src/lxc/json/read-file.h b/src/lxc/json/read-file.h new file mode 100644 -index 00000000..5d6e0eb6 +index 0000000..5d6e0eb --- /dev/null +++ b/src/lxc/json/read-file.h @@ -0,0 +1,11 @@ @@ -2781,7 +2781,7 @@ index 00000000..5d6e0eb6 + +#endif diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c -index 31f4819e..68134d87 100644 +index 31f4819..68134d8 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -271,6 +271,9 @@ static void lxc_container_free(struct lxc_container *c) @@ -2886,25 +2886,25 @@ index 31f4819e..68134d87 100644 fprintf(stderr, "Failed to load config for %s\n", name); goto err; diff --git a/src/lxc/lxccontainer.h b/src/lxc/lxccontainer.h -index 503038af..5d23cc7e 100644 +index 503038a..5d23cc7 100644 --- a/src/lxc/lxccontainer.h +++ b/src/lxc/lxccontainer.h -@@ -75,6 +75,13 @@ struct lxc_container { - */ - char *configfile; +@@ -77,6 +77,13 @@ struct lxc_container { -+ /*! -+ * \private + /*! + * \private + * isulad: support oci hook from json file + * full path of json file + * */ + char *ocihookfile; + - /*! - * \private ++ /*! ++ * \private * File to store pid. + */ + char *pidfile; diff --git a/src/lxc/start.c b/src/lxc/start.c -index b13326ce..63f5af88 100644 +index b13326c..63f5af8 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -1887,6 +1887,16 @@ static int lxc_spawn(struct lxc_handler *handler) @@ -2939,7 +2939,7 @@ index b13326ce..63f5af88 100644 if (ret < 0) { ERROR("Failed to set state to \"%s\"", lxc_state2str(RUNNING)); diff --git a/src/lxc/utils.c b/src/lxc/utils.c -index 8ec9f461..d1a22f73 100644 +index 8ec9f46..d1a22f7 100644 --- a/src/lxc/utils.c +++ b/src/lxc/utils.c @@ -1864,11 +1864,11 @@ static int lxc_file2str(const char *filename, char ret[], int cap) @@ -3072,7 +3072,7 @@ index 8ec9f461..d1a22f73 100644 + return alive; +} diff --git a/src/lxc/utils.h b/src/lxc/utils.h -index 3d56fd93..abc88ca5 100644 +index 3d56fd9..abc88ca 100644 --- a/src/lxc/utils.h +++ b/src/lxc/utils.h @@ -316,4 +316,6 @@ extern int fd_nonblock(int fd); @@ -3083,5 +3083,5 @@ index 3d56fd93..abc88ca5 100644 + #endif /* __LXC_UTILS_H */ -- -2.23.0 +1.8.3.1 diff --git a/0026-remove-filelock-and-do-not-destroy-directory-when-de.patch b/0026-remove-filelock-and-do-not-destroy-directory-when-de.patch index 56f6b47b293b042f52b01535860a9a6638c71313..31115dcc03e71a51cbd8a501cc5e0c27d497ba4e 100644 --- a/0026-remove-filelock-and-do-not-destroy-directory-when-de.patch +++ b/0026-remove-filelock-and-do-not-destroy-directory-when-de.patch @@ -1,7 +1,7 @@ -From bb6ce8063c801154eae7f2d6f22c016811c1694b Mon Sep 17 00:00:00 2001 +From 654c22d0f010187a98d77cf68cc8c0d259f09587 Mon Sep 17 00:00:00 2001 From: tanyifeng Date: Mon, 14 Jan 2019 21:13:00 +0800 -Subject: [PATCH 026/131] remove filelock and do not destroy directory when +Subject: [PATCH 026/138] remove filelock and do not destroy directory when destroy container Signed-off-by: LiFeng @@ -13,7 +13,7 @@ Signed-off-by: LiFeng 4 files changed, 43 insertions(+), 13 deletions(-) diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c -index 68134d87..81c0ec35 100644 +index 68134d8..81c0ec3 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -2996,8 +2996,14 @@ static bool container_destroy(struct lxc_container *c, @@ -51,7 +51,7 @@ index 68134d87..81c0ec35 100644 if (has_snapshots(c)) { diff --git a/src/lxc/lxclock.c b/src/lxc/lxclock.c -index e3d4654b..8890968f 100644 +index e3d4654..8890968 100644 --- a/src/lxc/lxclock.c +++ b/src/lxc/lxclock.c @@ -198,6 +198,21 @@ on_error: @@ -91,7 +91,7 @@ index e3d4654b..8890968f 100644 + return lxc_removelock(c->privlock); +} diff --git a/src/lxc/lxclock.h b/src/lxc/lxclock.h -index 364a71b8..e86bc340 100644 +index 364a71b..e86bc34 100644 --- a/src/lxc/lxclock.h +++ b/src/lxc/lxclock.h @@ -174,4 +174,9 @@ extern int container_disk_lock(struct lxc_container *c); @@ -105,7 +105,7 @@ index 364a71b8..e86bc340 100644 + #endif diff --git a/src/lxc/storage/dir.c b/src/lxc/storage/dir.c -index c7b5ee27..deeecec2 100644 +index c7b5ee2..deeecec 100644 --- a/src/lxc/storage/dir.c +++ b/src/lxc/storage/dir.c @@ -123,17 +123,7 @@ int dir_create(struct lxc_storage *bdev, const char *dest, const char *n, @@ -128,5 +128,5 @@ index c7b5ee27..deeecec2 100644 } -- -2.23.0 +1.8.3.1 diff --git a/0027-fix-bug-of-memory-leak.patch b/0027-fix-bug-of-memory-leak.patch index b0cf110a8b8a278fc87a465233eb9c6971d84429..42c50d0a9e74c17c7e9e4ba97452acebf6dcbfed 100644 --- a/0027-fix-bug-of-memory-leak.patch +++ b/0027-fix-bug-of-memory-leak.patch @@ -1,7 +1,7 @@ -From 8cd813403960ae2038ec49bcc22c3a49af9c3664 Mon Sep 17 00:00:00 2001 +From 44f1f43ed02453951dd974bc3cc17ee364476894 Mon Sep 17 00:00:00 2001 From: tanyifeng Date: Mon, 14 Jan 2019 21:24:25 +0800 -Subject: [PATCH 027/131] fix bug of memory leak +Subject: [PATCH 027/138] fix bug of memory leak Signed-off-by: LiFeng --- @@ -11,7 +11,7 @@ Signed-off-by: LiFeng 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/lxc/conf.c b/src/lxc/conf.c -index 6a14de1f..e076bf28 100644 +index 6a14de1..e076bf2 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -4822,6 +4822,16 @@ int lxc_clear_procs(struct lxc_conf *c, const char *key) @@ -40,7 +40,7 @@ index 6a14de1f..e076bf28 100644 free(conf->cgroup_meta.controllers); /* isulad add begin */ diff --git a/src/lxc/conf.h b/src/lxc/conf.h -index 2263e47e..44feb986 100644 +index 2263e47..44feb98 100644 --- a/src/lxc/conf.h +++ b/src/lxc/conf.h @@ -491,6 +491,7 @@ extern int setup_sysctl_parameters(struct lxc_list *sysctls); @@ -52,7 +52,7 @@ index 2263e47e..44feb986 100644 /* isulad add begin */ int lxc_clear_init_args(struct lxc_conf *lxc_conf); diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c -index 81c0ec35..e6272fcd 100644 +index 81c0ec3..e6272fc 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -5418,10 +5418,13 @@ int list_active_containers(const char *lxcpath, char ***nret, @@ -74,5 +74,5 @@ index 81c0ec35..e6272fcd 100644 if (!add_to_array(&ct_name, p, ct_name_cnt)) { -- -2.23.0 +1.8.3.1 diff --git a/0028-support-rootfs-for-container.patch b/0028-support-rootfs-for-container.patch index 3a5ddf444f109ca55456510b9af42c7b57e11041..0126be6610b5a6a56bf159fd38f54b06fedc005e 100644 --- a/0028-support-rootfs-for-container.patch +++ b/0028-support-rootfs-for-container.patch @@ -1,15 +1,15 @@ -From 79e621410a8969949f8d4e4fe9994603225d6fca Mon Sep 17 00:00:00 2001 +From af616876267279ffc89cd86744ba327e8c5c3d83 Mon Sep 17 00:00:00 2001 From: tanyifeng Date: Tue, 15 Jan 2019 09:45:44 +0800 -Subject: [PATCH 028/131] support rootfs / for container +Subject: [PATCH 028/138] support rootfs / for container Signed-off-by: LiFeng --- - src/lxc/conf.c | 61 +++++++++++++++++++++++++++++++++++++++++++------- + src/lxc/conf.c | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 53 insertions(+), 8 deletions(-) diff --git a/src/lxc/conf.c b/src/lxc/conf.c -index e076bf28..f429491e 100644 +index e076bf2..f429491 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -888,9 +888,6 @@ static int lxc_setup_ttys(struct lxc_conf *conf) @@ -119,5 +119,5 @@ index e076bf28..f429491e 100644 { int ret; -- -2.23.0 +1.8.3.1 diff --git a/0029-add-start-timeout-to-limit-start-time.patch b/0029-add-start-timeout-to-limit-start-time.patch index 36bb38e670b437265b6b024c615e12594f4cd85d..ecbbb6c2be28904c8da91b4ec3a8cb53c34c578b 100644 --- a/0029-add-start-timeout-to-limit-start-time.patch +++ b/0029-add-start-timeout-to-limit-start-time.patch @@ -1,23 +1,23 @@ -From 9e139dac0cbfc7252b672a23cfc54d62e1989223 Mon Sep 17 00:00:00 2001 +From 384d6f6e29e2c8e46db765382fa3e1f94c9d0a4e Mon Sep 17 00:00:00 2001 From: LiFeng Date: Mon, 14 Jan 2019 21:38:07 -0500 -Subject: [PATCH 029/131] add start timeout to limit start time +Subject: [PATCH 029/138] add start timeout to limit start time Signed-off-by: LiFeng --- src/lxc/conf.c | 6 +-- src/lxc/execute.c | 4 +- - src/lxc/lxc.h | 8 +-- - src/lxc/lxccontainer.c | 21 +++++++- - src/lxc/lxccontainer.h | 16 ++++++ - src/lxc/start.c | 106 ++++++++++++++++++++++++++++++++++++-- + src/lxc/lxc.h | 8 ++-- + src/lxc/lxccontainer.c | 21 ++++++++- + src/lxc/lxccontainer.h | 16 +++++++ + src/lxc/start.c | 106 +++++++++++++++++++++++++++++++++++++++++++--- src/lxc/start.h | 6 +-- src/lxc/tools/arguments.h | 2 + - src/lxc/tools/lxc_start.c | 26 ++++++++++ + src/lxc/tools/lxc_start.c | 26 ++++++++++++ 9 files changed, 175 insertions(+), 20 deletions(-) diff --git a/src/lxc/conf.c b/src/lxc/conf.c -index f429491e..439353b2 100644 +index f429491..439353b 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -4381,14 +4381,12 @@ void* wait_ocihook_timeout(void *arg) @@ -38,7 +38,7 @@ index f429491e..439353b2 100644 } diff --git a/src/lxc/execute.c b/src/lxc/execute.c -index 45ca67e3..d388e633 100644 +index 45ca67e..d388e63 100644 --- a/src/lxc/execute.c +++ b/src/lxc/execute.c @@ -111,12 +111,12 @@ static struct lxc_operations execute_start_ops = { @@ -57,7 +57,7 @@ index 45ca67e3..d388e633 100644 + daemonize, error_num, start_timeout); } diff --git a/src/lxc/lxc.h b/src/lxc/lxc.h -index 22e35096..687b4b28 100644 +index 22e3509..687b4b2 100644 --- a/src/lxc/lxc.h +++ b/src/lxc/lxc.h @@ -55,7 +55,7 @@ struct lxc_handler; @@ -83,7 +83,7 @@ index 22e35096..687b4b28 100644 /* * Close the fd associated with the monitoring diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c -index e6272fcd..beae459b 100644 +index e6272fc..beae459 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -1169,10 +1169,10 @@ reboot: @@ -131,7 +131,7 @@ index e6272fcd..beae459b 100644 return c; diff --git a/src/lxc/lxccontainer.h b/src/lxc/lxccontainer.h -index 5d23cc7e..77de7040 100644 +index 5d23cc7..77de704 100644 --- a/src/lxc/lxccontainer.h +++ b/src/lxc/lxccontainer.h @@ -94,6 +94,12 @@ struct lxc_container { @@ -165,7 +165,7 @@ index 5d23cc7e..77de7040 100644 /*! diff --git a/src/lxc/start.c b/src/lxc/start.c -index 63f5af88..f7be9e43 100644 +index 63f5af8..f7be9e4 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -93,7 +93,22 @@ extern void mod_all_rdeps(struct lxc_container *c, bool inc); @@ -330,7 +330,7 @@ index 63f5af88..f7be9e43 100644 static void lxc_destroy_container_on_signal(struct lxc_handler *handler, diff --git a/src/lxc/start.h b/src/lxc/start.h -index f59bf549..a96f2aed 100644 +index f59bf54..a96f2ae 100644 --- a/src/lxc/start.h +++ b/src/lxc/start.h @@ -174,9 +174,9 @@ extern void lxc_fini(const char *name, struct lxc_handler *handler); @@ -347,7 +347,7 @@ index f59bf549..a96f2aed 100644 extern int resolve_clone_flags(struct lxc_handler *handler); diff --git a/src/lxc/tools/arguments.h b/src/lxc/tools/arguments.h -index 047e9f16..afab9f54 100644 +index 047e9f1..afab9f5 100644 --- a/src/lxc/tools/arguments.h +++ b/src/lxc/tools/arguments.h @@ -65,6 +65,7 @@ struct lxc_arguments { @@ -367,7 +367,7 @@ index 047e9f16..afab9f54 100644 extern int lxc_arguments_parse(struct lxc_arguments *args, int argc, diff --git a/src/lxc/tools/lxc_start.c b/src/lxc/tools/lxc_start.c -index 60c7d70b..f37f8a6a 100644 +index 60c7d70..f37f8a6 100644 --- a/src/lxc/tools/lxc_start.c +++ b/src/lxc/tools/lxc_start.c @@ -40,6 +40,7 @@ @@ -432,5 +432,5 @@ index 60c7d70b..f37f8a6a 100644 if (!c->set_config_item(c, "lxc.console.path", my_args.console)) goto out; -- -2.23.0 +1.8.3.1 diff --git a/0030-support-block-device-as-rootfs.patch b/0030-support-block-device-as-rootfs.patch index 0c7eb942a47ee88a63ea2bf5b6cd05c9b09269d9..bed69d013001d95683f77340a9be92fac3d76727 100644 --- a/0030-support-block-device-as-rootfs.patch +++ b/0030-support-block-device-as-rootfs.patch @@ -1,23 +1,23 @@ -From 9eb3f03ff4604a61dae9f587294599ef7f68da64 Mon Sep 17 00:00:00 2001 +From 0a4c408e992b1431316a1e743f4109f1b8a0a837 Mon Sep 17 00:00:00 2001 From: tanyifeng Date: Tue, 15 Jan 2019 16:00:30 +0800 -Subject: [PATCH 030/131] support block device as rootfs +Subject: [PATCH 030/138] support block device as rootfs Signed-off-by: LiFeng --- src/lxc/Makefile.am | 1 + - src/lxc/conf.c | 10 ++-- - src/lxc/storage/block.c | 86 +++++++++++++++++++++++++++++++++ - src/lxc/storage/block.h | 41 ++++++++++++++++ - src/lxc/storage/dir.c | 10 +--- - src/lxc/storage/storage.c | 18 +++++++ + src/lxc/conf.c | 10 ++--- + src/lxc/storage/block.c | 86 +++++++++++++++++++++++++++++++++++++++++ + src/lxc/storage/block.h | 41 ++++++++++++++++++++ + src/lxc/storage/dir.c | 10 +---- + src/lxc/storage/storage.c | 18 +++++++++ src/lxc/storage/storage_utils.c | 2 +- 7 files changed, 153 insertions(+), 15 deletions(-) create mode 100644 src/lxc/storage/block.c create mode 100644 src/lxc/storage/block.h diff --git a/src/lxc/Makefile.am b/src/lxc/Makefile.am -index 5678b8da..260a7eb0 100644 +index 5678b8d..260a7eb 100644 --- a/src/lxc/Makefile.am +++ b/src/lxc/Makefile.am @@ -130,6 +130,7 @@ liblxc_la_SOURCES = af_unix.c af_unix.h \ @@ -29,7 +29,7 @@ index 5678b8da..260a7eb0 100644 storage/lvm.c storage/lvm.h \ storage/nbd.c storage/nbd.h \ diff --git a/src/lxc/conf.c b/src/lxc/conf.c -index 439353b2..88763ee2 100644 +index 439353b..88763ee 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -3865,13 +3865,10 @@ static int setup_populate_devs(const struct lxc_rootfs *rootfs, struct lxc_list @@ -61,7 +61,7 @@ index 439353b2..88763ee2 100644 } diff --git a/src/lxc/storage/block.c b/src/lxc/storage/block.c new file mode 100644 -index 00000000..eb75e706 +index 0000000..eb75e70 --- /dev/null +++ b/src/lxc/storage/block.c @@ -0,0 +1,86 @@ @@ -153,7 +153,7 @@ index 00000000..eb75e706 +} diff --git a/src/lxc/storage/block.h b/src/lxc/storage/block.h new file mode 100644 -index 00000000..2fa7565f +index 0000000..2fa7565 --- /dev/null +++ b/src/lxc/storage/block.h @@ -0,0 +1,41 @@ @@ -199,7 +199,7 @@ index 00000000..2fa7565f + +#endif /* __LXC_BLK_H */ diff --git a/src/lxc/storage/dir.c b/src/lxc/storage/dir.c -index deeecec2..2b548d0f 100644 +index deeecec..2b548d0 100644 --- a/src/lxc/storage/dir.c +++ b/src/lxc/storage/dir.c @@ -150,7 +150,7 @@ bool dir_detect(const char *path) @@ -227,7 +227,7 @@ index deeecec2..2b548d0f 100644 if (ret < 0) { SYSERROR("Failed to mount \"%s\" on \"%s\"", src, bdev->dest); diff --git a/src/lxc/storage/storage.c b/src/lxc/storage/storage.c -index c4f4c2ea..18f754a4 100644 +index c4f4c2e..18f754a 100644 --- a/src/lxc/storage/storage.c +++ b/src/lxc/storage/storage.c @@ -61,6 +61,7 @@ @@ -270,7 +270,7 @@ index c4f4c2ea..18f754a4 100644 static const size_t numbdevs = sizeof(bdevs) / sizeof(struct lxc_storage_type); diff --git a/src/lxc/storage/storage_utils.c b/src/lxc/storage/storage_utils.c -index 46e08a35..b4dcb57c 100644 +index 46e08a3..b4dcb57 100644 --- a/src/lxc/storage/storage_utils.c +++ b/src/lxc/storage/storage_utils.c @@ -416,7 +416,7 @@ int find_fstype_cb(char *buffer, void *data) @@ -283,5 +283,5 @@ index 46e08a35..b4dcb57c 100644 free(mntdata); return 0; -- -2.23.0 +1.8.3.1 diff --git a/0031-clean-add-clean-resources-api.patch b/0031-clean-add-clean-resources-api.patch index c607b8008d56817c4257db4db7cd0bbb1874ac03..8807002b1e5f13b98169d102dda8478a068ebae3 100644 --- a/0031-clean-add-clean-resources-api.patch +++ b/0031-clean-add-clean-resources-api.patch @@ -1,21 +1,21 @@ -From 136011fb9e859ce315139d2c176d9db505d591c6 Mon Sep 17 00:00:00 2001 +From 218fd1ad5b650ddb53e3b89189e6f35b10bc59d3 Mon Sep 17 00:00:00 2001 From: LiFeng Date: Tue, 15 Jan 2019 04:20:57 -0500 -Subject: [PATCH 031/131] clean: add clean resources api +Subject: [PATCH 031/138] clean: add clean resources api Signed-off-by: LiFeng --- - src/lxc/cgroups/cgfsng.c | 124 +++++++++++++++------------------- + src/lxc/cgroups/cgfsng.c | 124 +++++++++++++++++------------------------ src/lxc/cgroups/cgroup.c | 2 +- src/lxc/cgroups/cgroup.h | 4 +- - src/lxc/lxccontainer.c | 18 +++++ - src/lxc/lxccontainer.h | 10 +++ - src/lxc/start.c | 141 +++++++++++++++++++++++++++++++++++++++ + src/lxc/lxccontainer.c | 18 ++++++ + src/lxc/lxccontainer.h | 10 ++++ + src/lxc/start.c | 141 +++++++++++++++++++++++++++++++++++++++++++++++ src/lxc/start.h | 4 ++ 7 files changed, 228 insertions(+), 75 deletions(-) diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c -index 7f2a200a..8b913a6b 100644 +index 7f2a200..8b913a6 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -1050,12 +1050,15 @@ static int cgroup_rmdir(struct hierarchy **hierarchies, @@ -230,7 +230,7 @@ index 7f2a200a..8b913a6b 100644 cgfsng_ops->payload_enter = cgfsng_payload_enter; cgfsng_ops->escape = cgfsng_escape; diff --git a/src/lxc/cgroups/cgroup.c b/src/lxc/cgroups/cgroup.c -index 04e0311d..8e7aef96 100644 +index 04e0311..8e7aef9 100644 --- a/src/lxc/cgroups/cgroup.c +++ b/src/lxc/cgroups/cgroup.c @@ -50,7 +50,7 @@ struct cgroup_ops *cgroup_init(struct lxc_handler *handler) @@ -243,7 +243,7 @@ index 04e0311d..8e7aef96 100644 TRACE("Initialized cgroup driver %s", cgroup_ops->driver); diff --git a/src/lxc/cgroups/cgroup.h b/src/lxc/cgroups/cgroup.h -index ba4c1532..fa4871ed 100644 +index ba4c153..fa4871e 100644 --- a/src/lxc/cgroups/cgroup.h +++ b/src/lxc/cgroups/cgroup.h @@ -123,8 +123,8 @@ struct cgroup_ops { @@ -258,7 +258,7 @@ index ba4c1532..fa4871ed 100644 bool (*payload_enter)(struct cgroup_ops *ops, pid_t pid); const char *(*get_cgroup)(struct cgroup_ops *ops, const char *controller); diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c -index beae459b..38059faf 100644 +index beae459..38059fa 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -5116,6 +5116,23 @@ static bool do_lxcapi_set_start_timeout(struct lxc_container *c, unsigned int s @@ -294,7 +294,7 @@ index beae459b..38059faf 100644 return c; diff --git a/src/lxc/lxccontainer.h b/src/lxc/lxccontainer.h -index 77de7040..679ca42c 100644 +index 77de704..679ca42 100644 --- a/src/lxc/lxccontainer.h +++ b/src/lxc/lxccontainer.h @@ -896,6 +896,16 @@ struct lxc_container { @@ -315,7 +315,7 @@ index 77de7040..679ca42c 100644 /*! diff --git a/src/lxc/start.c b/src/lxc/start.c -index f7be9e43..08d753ab 100644 +index f7be9e4..08d753a 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -1895,6 +1895,11 @@ static int lxc_spawn(struct lxc_handler *handler) @@ -471,7 +471,7 @@ index f7be9e43..08d753ab 100644 +} + diff --git a/src/lxc/start.h b/src/lxc/start.h -index a96f2aed..1d84325b 100644 +index a96f2ae..1d84325 100644 --- a/src/lxc/start.h +++ b/src/lxc/start.h @@ -180,4 +180,8 @@ extern int __lxc_start(const char *name, struct lxc_handler *handler, @@ -484,5 +484,5 @@ index a96f2aed..1d84325b 100644 + #endif -- -2.23.0 +1.8.3.1 diff --git a/0032-Drop-all-caps-when-cap.keep-ISULAD_KEEP_NONE.patch b/0032-Drop-all-caps-when-cap.keep-ISULAD_KEEP_NONE.patch index 6f658c57add19257f7fd33048cd004188ab50216..f39bd5963a802afab9e8b5c5a0b17f46fe0f7493 100644 --- a/0032-Drop-all-caps-when-cap.keep-ISULAD_KEEP_NONE.patch +++ b/0032-Drop-all-caps-when-cap.keep-ISULAD_KEEP_NONE.patch @@ -1,7 +1,7 @@ -From 40bb25ecfda607f2a42659843a99c2c1447e31a3 Mon Sep 17 00:00:00 2001 +From d81dd5eca326f5173b89fbad3e419f7e623ccaea Mon Sep 17 00:00:00 2001 From: LiFeng Date: Tue, 15 Jan 2019 05:39:39 -0500 -Subject: [PATCH 032/131] Drop all caps when cap.keep=ISULAD_KEEP_NONE +Subject: [PATCH 032/138] Drop all caps when cap.keep=ISULAD_KEEP_NONE Signed-off-by: LiFeng --- @@ -9,7 +9,7 @@ Signed-off-by: LiFeng 1 file changed, 9 insertions(+) diff --git a/src/lxc/conf.c b/src/lxc/conf.c -index 88763ee2..54b967b4 100644 +index 88763ee..54b967b 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -2805,6 +2805,15 @@ static int dropcaps_except(struct lxc_list *caps) @@ -29,5 +29,5 @@ index 88763ee2..54b967b4 100644 if (capid == -2) continue; -- -2.23.0 +1.8.3.1 diff --git a/0033-support-mount-squashfs-in-mount-entry.patch b/0033-support-mount-squashfs-in-mount-entry.patch index c0a058e279699badb65679f18dfa90bd8304a454..997d3b2f5b48d35afb135ba98166dd1efc83eed2 100644 --- a/0033-support-mount-squashfs-in-mount-entry.patch +++ b/0033-support-mount-squashfs-in-mount-entry.patch @@ -1,19 +1,19 @@ -From fcfc10ab645e152899225bdfa9d74acedb739afd Mon Sep 17 00:00:00 2001 +From 3e5a9c9672e31e4f97c111d2c30424b2c203824f Mon Sep 17 00:00:00 2001 From: tanyifeng Date: Tue, 15 Jan 2019 19:54:13 +0800 -Subject: [PATCH 033/131] support mount squashfs in mount entry +Subject: [PATCH 033/138] support mount squashfs in mount entry Signed-off-by: LiFeng --- - src/lxc/conf.c | 88 +++++++++++++++++++++++++++++++-- - src/lxc/storage/loop.c | 36 ++++++++++++-- - src/lxc/storage/storage_utils.c | 36 +++++++++++++- - src/lxc/utils.c | 33 +++++++++++-- + src/lxc/conf.c | 88 +++++++++++++++++++++++++++++++++++++++-- + src/lxc/storage/loop.c | 36 ++++++++++++++--- + src/lxc/storage/storage_utils.c | 36 ++++++++++++++++- + src/lxc/utils.c | 33 ++++++++++++++-- src/lxc/utils.h | 1 + 5 files changed, 181 insertions(+), 13 deletions(-) diff --git a/src/lxc/conf.c b/src/lxc/conf.c -index 54b967b4..fea0f592 100644 +index 54b967b..fea0f59 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -78,6 +78,7 @@ @@ -133,7 +133,7 @@ index 54b967b4..fea0f592 100644 { int ret; diff --git a/src/lxc/storage/loop.c b/src/lxc/storage/loop.c -index 35cb13e0..760def81 100644 +index 35cb13e..760def8 100644 --- a/src/lxc/storage/loop.c +++ b/src/lxc/storage/loop.c @@ -41,6 +41,7 @@ @@ -214,7 +214,7 @@ index 35cb13e0..760def81 100644 int loop_umount(struct lxc_storage *bdev) diff --git a/src/lxc/storage/storage_utils.c b/src/lxc/storage/storage_utils.c -index b4dcb57c..0a87778e 100644 +index b4dcb57..0a87778 100644 --- a/src/lxc/storage/storage_utils.c +++ b/src/lxc/storage/storage_utils.c @@ -339,10 +339,14 @@ int is_blktype(struct lxc_storage *b) @@ -293,7 +293,7 @@ index b4dcb57c..0a87778e 100644 } diff --git a/src/lxc/utils.c b/src/lxc/utils.c -index d1a22f73..120a13d7 100644 +index d1a22f7..120a13d 100644 --- a/src/lxc/utils.c +++ b/src/lxc/utils.c @@ -1053,7 +1053,7 @@ static int open_if_safe(int dirfd, const char *nextpath) @@ -353,7 +353,7 @@ index d1a22f73..120a13d7 100644 on_error: close(fd_ctl); diff --git a/src/lxc/utils.h b/src/lxc/utils.h -index abc88ca5..43139424 100644 +index abc88ca..4313942 100644 --- a/src/lxc/utils.h +++ b/src/lxc/utils.h @@ -224,6 +224,7 @@ extern bool cgns_supported(void); @@ -365,5 +365,5 @@ index abc88ca5..43139424 100644 unsigned long flags, const void *data, const char *rootfs); -- -2.23.0 +1.8.3.1 diff --git a/0034-some-small-bugfix.patch b/0034-some-small-bugfix.patch index a7138fdfad9321cc620191ccebf0a0188b836c23..6f2e8c62af2abbdbad8dafe73fcadf735a12df32 100644 --- a/0034-some-small-bugfix.patch +++ b/0034-some-small-bugfix.patch @@ -1,7 +1,7 @@ -From ad4a2433846406dd288b31589dc9bc468749918e Mon Sep 17 00:00:00 2001 +From 0c156740697d390dc68c693b4b317a1e4bf77774 Mon Sep 17 00:00:00 2001 From: tanyifeng Date: Tue, 15 Jan 2019 20:39:11 +0800 -Subject: [PATCH 034/131] some small bugfix +Subject: [PATCH 034/138] some small bugfix 1. support new container without load config to save time 2. try to create workdir if not exist @@ -16,7 +16,7 @@ Signed-off-by: LiFeng 5 files changed, 58 insertions(+), 8 deletions(-) diff --git a/src/lxc/attach.c b/src/lxc/attach.c -index e6e4b0d1..8cbbf962 100644 +index e6e4b0d..8cbbf96 100644 --- a/src/lxc/attach.c +++ b/src/lxc/attach.c @@ -806,6 +806,22 @@ static int attach_child_main(struct attach_clone_payload *payload) @@ -43,23 +43,23 @@ index e6e4b0d1..8cbbf962 100644 * if you want this to be a no-op). */ diff --git a/src/lxc/lxc.h b/src/lxc/lxc.h -index 687b4b28..5df5080a 100644 +index 687b4b2..5df5080 100644 --- a/src/lxc/lxc.h +++ b/src/lxc/lxc.h -@@ -103,6 +103,11 @@ extern lxc_state_t lxc_state(const char *name, const char *lxcpath); - */ +@@ -104,6 +104,11 @@ extern lxc_state_t lxc_state(const char *name, const char *lxcpath); extern struct lxc_container *lxc_container_new(const char *name, const char *configpath); -+/* + /* + * Create a new container without loading config. + */ +extern struct lxc_container *lxc_container_without_config_new(const char *name, const char *configpath); + - /* ++/* * Returns 1 on success, 0 on failure. */ + extern int lxc_container_get(struct lxc_container *c); diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c -index 38059faf..e99c41cb 100644 +index 38059fa..e99c41c 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -5133,7 +5133,7 @@ static bool do_lxcapi_clean_container_resource(struct lxc_container *c, pid_t pi @@ -105,14 +105,13 @@ index 38059faf..e99c41cb 100644 { int i; diff --git a/src/lxc/lxccontainer.h b/src/lxc/lxccontainer.h -index 679ca42c..a00e0ece 100644 +index 679ca42..a00e0ec 100644 --- a/src/lxc/lxccontainer.h +++ b/src/lxc/lxccontainer.h -@@ -1039,6 +1039,18 @@ struct lxc_console_log { - */ +@@ -1040,6 +1040,18 @@ struct lxc_console_log { struct lxc_container *lxc_container_new(const char *name, const char *configpath); -+/*! + /*! + * \brief Create a new container without loading config. + * + * \param name Name to use for container. @@ -124,11 +123,12 @@ index 679ca42c..a00e0ece 100644 + */ +struct lxc_container *lxc_container_without_config_new(const char *name, const char *configpath); + - /*! ++/*! * \brief Add a reference to the specified container. * + * \param c Container. diff --git a/src/lxc/start.c b/src/lxc/start.c -index 08d753ab..040909c3 100644 +index 08d753a..040909c 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -1364,10 +1364,14 @@ static int do_start(void *data) @@ -151,5 +151,5 @@ index 08d753ab..040909c3 100644 } } -- -2.23.0 +1.8.3.1 diff --git a/0035-lxc-fixup-builds-with-newer-glibc.patch b/0035-lxc-fixup-builds-with-newer-glibc.patch index 68d5500c7be727c71211b86f7b41ae6c330ba145..b28da23c2b14fe550353835029a2ff9a57af3211 100644 --- a/0035-lxc-fixup-builds-with-newer-glibc.patch +++ b/0035-lxc-fixup-builds-with-newer-glibc.patch @@ -1,7 +1,7 @@ -From ff2e749f043f49a4a10d849a56de258a8bfebb56 Mon Sep 17 00:00:00 2001 +From f89900e2e45d8e94cd4576b5e1e7a7b3cca3b0a9 Mon Sep 17 00:00:00 2001 From: tanyifeng Date: Wed, 16 Jan 2019 20:53:25 +0800 -Subject: [PATCH 035/131] lxc: fixup builds with newer glibc +Subject: [PATCH 035/138] lxc: fixup builds with newer glibc Signed-off-by: LiFeng --- @@ -9,7 +9,7 @@ Signed-off-by: LiFeng 1 file changed, 1 insertion(+) diff --git a/src/lxc/utils.c b/src/lxc/utils.c -index 120a13d7..c8fb9931 100644 +index 120a13d..c8fb993 100644 --- a/src/lxc/utils.c +++ b/src/lxc/utils.c @@ -44,6 +44,7 @@ @@ -21,5 +21,5 @@ index 120a13d7..c8fb9931 100644 #include -- -2.23.0 +1.8.3.1 diff --git a/0036-drop_caps-add-drop-caps-of-current-process.patch b/0036-drop_caps-add-drop-caps-of-current-process.patch index 2e84595af7b3c4557f60b0d2c8853d4c5d28062b..3df3c527d8282baa5eff8c367592a653a42b672c 100644 --- a/0036-drop_caps-add-drop-caps-of-current-process.patch +++ b/0036-drop_caps-add-drop-caps-of-current-process.patch @@ -1,19 +1,19 @@ -From d891502489641740373c74e761e3b615845e11a0 Mon Sep 17 00:00:00 2001 +From eb12d34669676227b6973d7d2aa8a1d1ee595d79 Mon Sep 17 00:00:00 2001 From: LiFeng Date: Tue, 15 Jan 2019 22:55:06 -0500 -Subject: [PATCH 036/131] drop_caps: add drop caps of current process +Subject: [PATCH 036/138] drop_caps: add drop caps of current process Signed-off-by: LiFeng --- - src/lxc/attach.c | 26 ++++++++++--- - src/lxc/cgroups/cgfsng.c | 35 +++++++++--------- - src/lxc/conf.c | 79 ++++++++++++++++++++++++++++++++++++++++ + src/lxc/attach.c | 26 +++++++++++++--- + src/lxc/cgroups/cgfsng.c | 35 ++++++++++----------- + src/lxc/conf.c | 79 ++++++++++++++++++++++++++++++++++++++++++++++++ src/lxc/conf.h | 1 + - src/lxc/start.c | 16 ++++++++ + src/lxc/start.c | 16 ++++++++++ 5 files changed, 135 insertions(+), 22 deletions(-) diff --git a/src/lxc/attach.c b/src/lxc/attach.c -index 8cbbf962..3f60fe10 100644 +index 8cbbf96..3f60fe1 100644 --- a/src/lxc/attach.c +++ b/src/lxc/attach.c @@ -936,11 +936,6 @@ static int attach_child_main(struct attach_clone_payload *payload) @@ -60,7 +60,7 @@ index 8cbbf962..3f60fe10 100644 _exit(payload->exec_function(payload->exec_payload, msg_fd)); diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c -index 8b913a6b..bc1481d4 100644 +index 8b913a6..bc1481d 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -2664,11 +2664,11 @@ __cgfsng_ops static bool cgfsng_data_init(struct cgroup_ops *ops, struct lxc_han @@ -116,7 +116,7 @@ index 8b913a6b..bc1481d4 100644 } diff --git a/src/lxc/conf.c b/src/lxc/conf.c -index fea0f592..6134ed3b 100644 +index fea0f59..6134ed3 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -4220,6 +4220,85 @@ int lxc_setup(struct lxc_handler *handler) @@ -206,7 +206,7 @@ index fea0f592..6134ed3b 100644 defs_hook *ocihook; diff --git a/src/lxc/conf.h b/src/lxc/conf.h -index 44feb986..b92c48e1 100644 +index 44feb98..b92c48e 100644 --- a/src/lxc/conf.h +++ b/src/lxc/conf.h @@ -498,6 +498,7 @@ int lxc_clear_init_args(struct lxc_conf *lxc_conf); @@ -218,7 +218,7 @@ index 44feb986..b92c48e1 100644 /* isulad add end */ diff --git a/src/lxc/start.c b/src/lxc/start.c -index 040909c3..357e81d2 100644 +index 040909c..357e81d 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -1411,6 +1411,11 @@ static int do_start(void *data) @@ -252,5 +252,5 @@ index 040909c3..357e81d2 100644 * as it execs. */ -- -2.23.0 +1.8.3.1 diff --git a/0037-restore-default-signal-handlers-and-set-umask-0027.patch b/0037-restore-default-signal-handlers-and-set-umask-0027.patch index e63fc99a10793dceb98ec920f65d0591e80dd662..963f9f57edac3774738fcdcdae6d43b18c728c1a 100644 --- a/0037-restore-default-signal-handlers-and-set-umask-0027.patch +++ b/0037-restore-default-signal-handlers-and-set-umask-0027.patch @@ -1,7 +1,7 @@ -From 3c281973b8d068164a2276a823f06a5087b285c1 Mon Sep 17 00:00:00 2001 +From f4a12bc311b3c3a9710948fd65ed7a7addbe183d Mon Sep 17 00:00:00 2001 From: LiFeng Date: Tue, 15 Jan 2019 23:14:14 -0500 -Subject: [PATCH 037/131] restore default signal handlers and set umask 0027 +Subject: [PATCH 037/138] restore default signal handlers and set umask 0027 Signed-off-by: LiFeng --- @@ -11,7 +11,7 @@ Signed-off-by: LiFeng 3 files changed, 41 insertions(+), 2 deletions(-) diff --git a/src/lxc/attach.c b/src/lxc/attach.c -index 3f60fe10..4ccdd74b 100644 +index 3f60fe1..4ccdd74 100644 --- a/src/lxc/attach.c +++ b/src/lxc/attach.c @@ -750,7 +750,7 @@ static void lxc_put_attach_clone_payload(struct attach_clone_payload *p) @@ -56,7 +56,7 @@ index 3f60fe10..4ccdd74b 100644 * lxc-attach(1) manual page. We have to remount here and not in the * parent process, otherwise /proc may not properly reflect the new pid diff --git a/src/lxc/conf.c b/src/lxc/conf.c -index 6134ed3b..88cebfd5 100644 +index 6134ed3..88cebfd 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -4180,6 +4180,9 @@ int lxc_setup(struct lxc_handler *handler) @@ -70,7 +70,7 @@ index 6134ed3b..88cebfd5 100644 if (ret < 0) { ERROR("Failed to set personality"); diff --git a/src/lxc/start.c b/src/lxc/start.c -index 357e81d2..708ab7f5 100644 +index 357e81d..708ab7f 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -1103,7 +1103,7 @@ void lxc_abort(const char *name, struct lxc_handler *handler) @@ -109,5 +109,5 @@ index 357e81d2..708ab7f5 100644 * we set the parent death signal, we will detect its death with the * synchro right after, otherwise we have a window where the parent can -- -2.23.0 +1.8.3.1 diff --git a/0038-make-the-given-terminal-as-controlling-terminal.patch b/0038-make-the-given-terminal-as-controlling-terminal.patch index b9f315bce42e8be6a6e2b06fa67d6a755ec70b17..88a2466a63d2413c83bbe6f491756b9b7a45270c 100644 --- a/0038-make-the-given-terminal-as-controlling-terminal.patch +++ b/0038-make-the-given-terminal-as-controlling-terminal.patch @@ -1,7 +1,7 @@ -From 7db0308d2d89a5b6ae91408258c31d2ebb8c17b6 Mon Sep 17 00:00:00 2001 +From 28a1cd4ca1f09ad2179954cf210c2a0e4deae47e Mon Sep 17 00:00:00 2001 From: LiFeng Date: Tue, 15 Jan 2019 23:24:21 -0500 -Subject: [PATCH 038/131] make the given terminal as controlling terminal +Subject: [PATCH 038/138] make the given terminal as controlling terminal Avoid warning when start cmd /bin/sh : sh: cannot set terminal process group (-1): Inappropriate ioctl for device @@ -13,7 +13,7 @@ Signed-off-by: LiFeng 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/lxc/start.c b/src/lxc/start.c -index 708ab7f5..ec61b322 100644 +index 708ab7f..ec61b32 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -1330,7 +1330,15 @@ static int do_start(void *data) @@ -42,5 +42,5 @@ index 708ab7f5..ec61b322 100644 /* isulad: try to craete workdir if not exist */ struct stat st; -- -2.23.0 +1.8.3.1 diff --git a/0039-print-error-message-when-container-start-failed.patch b/0039-print-error-message-when-container-start-failed.patch index 8fec8173ebc47c801409bdbc187ff7a43d699d6c..5ef6933cac0aff8b826a3f57574c11caf8702fc6 100644 --- a/0039-print-error-message-when-container-start-failed.patch +++ b/0039-print-error-message-when-container-start-failed.patch @@ -1,26 +1,26 @@ -From 0032e0ea93b38d9f869683ac08328ab1ca029f4d Mon Sep 17 00:00:00 2001 +From 0dc9bee69873493576be01fe001e17211b46ad87 Mon Sep 17 00:00:00 2001 From: tanyifeng Date: Wed, 16 Jan 2019 14:38:38 +0800 -Subject: [PATCH 039/131] print error message when container start failed +Subject: [PATCH 039/138] print error message when container start failed Signed-off-by: tanyifeng Signed-off-by: LiFeng --- - src/lxc/attach.c | 6 +- - src/lxc/cgroups/cgfsng.c | 22 +++++-- + src/lxc/attach.c | 6 +-- + src/lxc/cgroups/cgfsng.c | 22 +++++++-- src/lxc/cgroups/cgroup.c | 4 +- src/lxc/cgroups/cgroup.h | 2 + - src/lxc/conf.c | 122 ++++++++++++++++++++++---------------- + src/lxc/conf.c | 122 ++++++++++++++++++++++++++-------------------- src/lxc/conf.h | 5 +- src/lxc/execute.c | 3 +- - src/lxc/lxccontainer.c | 37 +++++++++++- - src/lxc/start.c | 14 +++-- + src/lxc/lxccontainer.c | 37 ++++++++++++-- + src/lxc/start.c | 14 ++++-- src/lxc/start.h | 2 +- - src/lxc/tools/lxc_start.c | 3 + + src/lxc/tools/lxc_start.c | 3 ++ 11 files changed, 147 insertions(+), 73 deletions(-) diff --git a/src/lxc/attach.c b/src/lxc/attach.c -index 4ccdd74b..b44ea746 100644 +index 4ccdd74..b44ea74 100644 --- a/src/lxc/attach.c +++ b/src/lxc/attach.c @@ -1396,7 +1396,7 @@ int lxc_attach(const char *name, const char *lxcpath, @@ -44,7 +44,7 @@ index 4ccdd74b..b44ea746 100644 SYSERROR("Failed to exec \"%s\"", cmd->program); return ret; diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c -index bc1481d4..47b12a64 100644 +index bc1481d..47b12a6 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -1236,7 +1236,7 @@ static int mkdir_eexist_on_last(const char *dir, mode_t mode) @@ -122,7 +122,7 @@ index bc1481d4..47b12a64 100644 cgfsng_ops->destroy = cgfsng_payload_destroy; cgfsng_ops->payload_create = cgfsng_payload_create; diff --git a/src/lxc/cgroups/cgroup.c b/src/lxc/cgroups/cgroup.c -index 8e7aef96..7442c310 100644 +index 8e7aef9..7442c31 100644 --- a/src/lxc/cgroups/cgroup.c +++ b/src/lxc/cgroups/cgroup.c @@ -38,13 +38,13 @@ @@ -142,7 +142,7 @@ index 8e7aef96..7442c310 100644 ERROR("Failed to initialize cgroup driver"); return NULL; diff --git a/src/lxc/cgroups/cgroup.h b/src/lxc/cgroups/cgroup.h -index fa4871ed..b6116f68 100644 +index fa4871e..b6116f6 100644 --- a/src/lxc/cgroups/cgroup.h +++ b/src/lxc/cgroups/cgroup.h @@ -92,6 +92,8 @@ struct cgroup_ops { @@ -155,7 +155,7 @@ index fa4871ed..b6116f68 100644 /* @hierarchies * - A NULL-terminated array of struct hierarchy, one per legacy diff --git a/src/lxc/conf.c b/src/lxc/conf.c -index 88cebfd5..8fa63f7c 100644 +index 88cebfd..8fa63f7 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -2414,6 +2414,8 @@ static int mount_entry_create_dir_file(const struct mntent *mntent, @@ -544,7 +544,7 @@ index 88cebfd5..8fa63f7c 100644 goto print_hook; } diff --git a/src/lxc/conf.h b/src/lxc/conf.h -index b92c48e1..88f5b417 100644 +index b92c48e..88f5b41 100644 --- a/src/lxc/conf.h +++ b/src/lxc/conf.h @@ -175,6 +175,8 @@ struct lxc_rootfs { @@ -574,7 +574,7 @@ index b92c48e1..88f5b417 100644 /* isulad add end */ diff --git a/src/lxc/execute.c b/src/lxc/execute.c -index d388e633..3fc46c6e 100644 +index d388e63..3fc46c6 100644 --- a/src/lxc/execute.c +++ b/src/lxc/execute.c @@ -40,7 +40,7 @@ @@ -595,7 +595,7 @@ index d388e633..3fc46c6e 100644 free(argv); out1: diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c -index e99c41cb..d6418510 100644 +index e99c41c..d641851 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -916,7 +916,9 @@ static bool do_lxcapi_start(struct lxc_container *c, int useinit, char * const a @@ -711,7 +711,7 @@ index e99c41cb..d6418510 100644 sizeof(keepfds) / sizeof(keepfds[0])); if (ret < 0) { diff --git a/src/lxc/start.c b/src/lxc/start.c -index ec61b322..3e6854fa 100644 +index ec61b32..3e6854f 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -892,6 +892,7 @@ int lxc_init(const char *name, struct lxc_handler *handler) @@ -785,7 +785,7 @@ index ec61b322..3e6854fa 100644 } diff --git a/src/lxc/start.h b/src/lxc/start.h -index 1d84325b..ab72e6e0 100644 +index 1d84325..ab72e6e 100644 --- a/src/lxc/start.h +++ b/src/lxc/start.h @@ -145,7 +145,7 @@ struct execute_args { @@ -798,7 +798,7 @@ index 1d84325b..ab72e6e0 100644 }; diff --git a/src/lxc/tools/lxc_start.c b/src/lxc/tools/lxc_start.c -index f37f8a6a..ec487018 100644 +index f37f8a6..ec48701 100644 --- a/src/lxc/tools/lxc_start.c +++ b/src/lxc/tools/lxc_start.c @@ -392,6 +392,9 @@ int main(int argc, char *argv[]) @@ -812,5 +812,5 @@ index f37f8a6a..ec487018 100644 if (my_args.daemonize) -- -2.23.0 +1.8.3.1 diff --git a/0040-add-timeout-200ms-for-cmds-send-to-lxc-monitor.patch b/0040-add-timeout-200ms-for-cmds-send-to-lxc-monitor.patch index 45d19d948a3504085d81fb77f4537ff7aa0a3561..59970d1e58db06a71c74934a591d5d837d628fad 100644 --- a/0040-add-timeout-200ms-for-cmds-send-to-lxc-monitor.patch +++ b/0040-add-timeout-200ms-for-cmds-send-to-lxc-monitor.patch @@ -1,7 +1,7 @@ -From 51e56ed2d4d4e9a98a5f23cfa857403100db433a Mon Sep 17 00:00:00 2001 +From bbd3eefaa71e17113a05268ad14707b8cee52bd1 Mon Sep 17 00:00:00 2001 From: LiFeng Date: Wed, 16 Jan 2019 02:22:13 -0500 -Subject: [PATCH 040/131] add timeout(200ms) for cmds send to [lxc monitor] +Subject: [PATCH 040/138] add timeout(200ms) for cmds send to [lxc monitor] Signed-off-by: LiFeng --- @@ -11,7 +11,7 @@ Signed-off-by: LiFeng 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/src/lxc/af_unix.c b/src/lxc/af_unix.c -index 02f32c45..24500a8f 100644 +index 02f32c4..24500a8 100644 --- a/src/lxc/af_unix.c +++ b/src/lxc/af_unix.c @@ -194,8 +194,9 @@ int lxc_abstract_unix_send_fds(int fd, int *sendfds, int num_sendfds, @@ -68,7 +68,7 @@ index 02f32c45..24500a8f 100644 { struct msghdr msg = {0}; diff --git a/src/lxc/af_unix.h b/src/lxc/af_unix.h -index f2c2fdcc..74fd77ff 100644 +index f2c2fdc..74fd77f 100644 --- a/src/lxc/af_unix.h +++ b/src/lxc/af_unix.h @@ -37,5 +37,7 @@ extern int lxc_abstract_unix_recv_fds(int fd, int *recvfds, int num_recvfds, @@ -80,7 +80,7 @@ index f2c2fdcc..74fd77ff 100644 #endif /* __LXC_AF_UNIX_H */ diff --git a/src/lxc/commands.c b/src/lxc/commands.c -index 133384d7..47a824a9 100644 +index 133384d..47a824a 100644 --- a/src/lxc/commands.c +++ b/src/lxc/commands.c @@ -126,13 +126,16 @@ static int lxc_cmd_rsp_recv(int sock, struct lxc_cmd_rr *cmd) @@ -103,5 +103,5 @@ index 133384d7..47a824a9 100644 return -1; } -- -2.23.0 +1.8.3.1 diff --git a/0041-return-1-when-_lxc_start-fails.patch b/0041-return-1-when-_lxc_start-fails.patch index a41db453220213520a1901ce521e2dad09015561..c7dba0b17af8e0e0409f50e3db022ad2bbf30444 100644 --- a/0041-return-1-when-_lxc_start-fails.patch +++ b/0041-return-1-when-_lxc_start-fails.patch @@ -1,7 +1,7 @@ -From 6153c99f9dad1499a5ac9b64def6cbb0f7aeeadc Mon Sep 17 00:00:00 2001 +From 5d0b2b47921f1e2c5120dabb9b8916b2abce023b Mon Sep 17 00:00:00 2001 From: LiFeng Date: Wed, 16 Jan 2019 05:53:36 -0500 -Subject: [PATCH 041/131] return -1 when _lxc_start fails +Subject: [PATCH 041/138] return -1 when _lxc_start fails Signed-off-by: LiFeng --- @@ -9,7 +9,7 @@ Signed-off-by: LiFeng 1 file changed, 1 insertion(+) diff --git a/src/lxc/start.c b/src/lxc/start.c -index 3e6854fa..7bbcb009 100644 +index 3e6854f..7bbcb00 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -2175,6 +2175,7 @@ int __lxc_start(const char *name, struct lxc_handler *handler, @@ -21,5 +21,5 @@ index 3e6854fa..7bbcb009 100644 } -- -2.23.0 +1.8.3.1 diff --git a/0042-lxc-seccomp-adopt-to-lxc3.0.patch b/0042-lxc-seccomp-adopt-to-lxc3.0.patch index 61c6e91f0db75b5e2b5aeaccff5c998a1db8b937..630cee603794d24ac68e2aaf0d0e4e34b6f92769 100644 --- a/0042-lxc-seccomp-adopt-to-lxc3.0.patch +++ b/0042-lxc-seccomp-adopt-to-lxc3.0.patch @@ -1,15 +1,15 @@ -From a96bf413990df081d5e63094f44d996106264eaf Mon Sep 17 00:00:00 2001 +From 264bfe855295416c66f9c149a0dcb93e56492011 Mon Sep 17 00:00:00 2001 From: tanyifeng Date: Thu, 17 Jan 2019 03:09:00 +0800 -Subject: [PATCH 042/131] lxc: seccomp adopt to lxc3.0 +Subject: [PATCH 042/138] lxc: seccomp adopt to lxc3.0 Signed-off-by: LiFeng --- - src/lxc/seccomp.c | 127 ++++++++++++++++++++++++---------------------- + src/lxc/seccomp.c | 127 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 65 insertions(+), 62 deletions(-) diff --git a/src/lxc/seccomp.c b/src/lxc/seccomp.c -index 1e14be17..27bdc223 100644 +index 1e14be1..27bdc22 100644 --- a/src/lxc/seccomp.c +++ b/src/lxc/seccomp.c @@ -936,86 +936,89 @@ static int parse_config_v2(FILE *f, char *line, size_t *line_bufsz, struct lxc_c @@ -165,5 +165,5 @@ index 1e14be17..27bdc223 100644 return 0; -- -2.23.0 +1.8.3.1 diff --git a/0043-check-null-pointer-of-handler-to-fix-coredump-of-att.patch b/0043-check-null-pointer-of-handler-to-fix-coredump-of-att.patch index 7b74a5229528a412f413761f517d9b90ab114a60..baeb67c8e4af16436296a22b061a070d480b427e 100644 --- a/0043-check-null-pointer-of-handler-to-fix-coredump-of-att.patch +++ b/0043-check-null-pointer-of-handler-to-fix-coredump-of-att.patch @@ -1,7 +1,7 @@ -From 5698aab60ae5ef398af34b129f4998922a43826c Mon Sep 17 00:00:00 2001 +From ff77c9eb552544103add1f52f0534831642aaa2b Mon Sep 17 00:00:00 2001 From: tanyifeng Date: Thu, 17 Jan 2019 10:19:37 +0800 -Subject: [PATCH 043/131] check null pointer of handler to fix coredump of +Subject: [PATCH 043/138] check null pointer of handler to fix coredump of attach Signed-off-by: tanyifeng @@ -11,7 +11,7 @@ Signed-off-by: LiFeng 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lxc/cgroups/cgroup.c b/src/lxc/cgroups/cgroup.c -index 7442c310..720a6c93 100644 +index 7442c31..720a6c9 100644 --- a/src/lxc/cgroups/cgroup.c +++ b/src/lxc/cgroups/cgroup.c @@ -44,7 +44,7 @@ struct cgroup_ops *cgroup_init(struct lxc_handler *handler) @@ -24,5 +24,5 @@ index 7442c310..720a6c93 100644 ERROR("Failed to initialize cgroup driver"); return NULL; -- -2.23.0 +1.8.3.1 diff --git a/0044-support-space-in-volume-mount-and-env.patch b/0044-support-space-in-volume-mount-and-env.patch index 36591fbc0ec7ecf0327d7e300fc047f46e838d23..ecd6ba9bc2d3044c749f3d2029b8998f93b1f0ac 100644 --- a/0044-support-space-in-volume-mount-and-env.patch +++ b/0044-support-space-in-volume-mount-and-env.patch @@ -1,7 +1,7 @@ -From 366ac099187f128958f1d59123ae6148d0bec731 Mon Sep 17 00:00:00 2001 +From 3744b844951dff491d0bc4c5381790880d5d2199 Mon Sep 17 00:00:00 2001 From: tanyifeng Date: Thu, 17 Jan 2019 10:18:23 +0800 -Subject: [PATCH 044/131] support space in --volume, --mount and --env +Subject: [PATCH 044/138] support space in --volume, --mount and --env Signed-off-by: tanyifeng Signed-off-by: LiFeng @@ -13,7 +13,7 @@ Signed-off-by: LiFeng 4 files changed, 28 insertions(+), 1 deletion(-) diff --git a/src/lxc/conf.c b/src/lxc/conf.c -index 8fa63f7c..48e31aff 100644 +index 8fa63f7..48e31af 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -54,6 +54,7 @@ @@ -54,7 +54,7 @@ index 8fa63f7c..48e31aff 100644 return -1; } diff --git a/src/lxc/confile.c b/src/lxc/confile.c -index db63b550..7e9d5c85 100644 +index db63b55..7e9d5c8 100644 --- a/src/lxc/confile.c +++ b/src/lxc/confile.c @@ -1036,6 +1036,7 @@ static int set_config_environment(const char *key, const char *value, @@ -88,7 +88,7 @@ index db63b550..7e9d5c85 100644 } diff --git a/src/lxc/namespace.h b/src/lxc/namespace.h -index ab583da7..9caaf89d 100644 +index ab583da..9caaf89 100644 --- a/src/lxc/namespace.h +++ b/src/lxc/namespace.h @@ -26,6 +26,7 @@ @@ -100,7 +100,7 @@ index ab583da7..9caaf89d 100644 #ifndef CLONE_PARENT_SETTID #define CLONE_PARENT_SETTID 0x00100000 diff --git a/src/lxc/utils.h b/src/lxc/utils.h -index 43139424..73ffdd97 100644 +index 4313942..73ffdd9 100644 --- a/src/lxc/utils.h +++ b/src/lxc/utils.h @@ -43,6 +43,9 @@ @@ -114,5 +114,5 @@ index 43139424..73ffdd97 100644 extern int lxc_rmdir_onedev(const char *path, const char *exclude); extern int get_u16(unsigned short *val, const char *arg, int base); -- -2.23.0 +1.8.3.1 diff --git a/0045-add_terminal_fifos-Add-terminal-fifos-dynamically.patch b/0045-add_terminal_fifos-Add-terminal-fifos-dynamically.patch index 42affefada836efa36d78a1804a770a3c0be0c48..8a20f710d7acc09de95a8b398312d123d5f2ce41 100644 --- a/0045-add_terminal_fifos-Add-terminal-fifos-dynamically.patch +++ b/0045-add_terminal_fifos-Add-terminal-fifos-dynamically.patch @@ -1,20 +1,20 @@ -From 37c62f3f3ae17c22d4a0a4edd2ed5b804c6491bf Mon Sep 17 00:00:00 2001 +From 1b1e83d187893f2e61c8952887d24b5afb949c77 Mon Sep 17 00:00:00 2001 From: LiFeng Date: Thu, 17 Jan 2019 02:18:14 -0500 -Subject: [PATCH 045/131] add_terminal_fifos: Add terminal fifos dynamically +Subject: [PATCH 045/138] add_terminal_fifos: Add terminal fifos dynamically Signed-off-by: LiFeng --- - src/lxc/commands.c | 62 ++++++++++++++++++++++++++++++++++++++++++ - src/lxc/commands.h | 4 +++ - src/lxc/lxccontainer.c | 24 ++++++++++++++++ - src/lxc/lxccontainer.h | 10 +++++++ - src/lxc/terminal.c | 47 ++++++++++++++++++++++++++++++++ + src/lxc/commands.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++ + src/lxc/commands.h | 4 ++++ + src/lxc/lxccontainer.c | 24 +++++++++++++++++++ + src/lxc/lxccontainer.h | 10 ++++++++ + src/lxc/terminal.c | 47 ++++++++++++++++++++++++++++++++++++++ src/lxc/terminal.h | 1 + 6 files changed, 148 insertions(+) diff --git a/src/lxc/commands.c b/src/lxc/commands.c -index 47a824a9..46b28053 100644 +index 47a824a..46b2805 100644 --- a/src/lxc/commands.c +++ b/src/lxc/commands.c @@ -96,6 +96,7 @@ static const char *lxc_cmd_str(lxc_cmd_t cmd) @@ -101,7 +101,7 @@ index 47a824a9..46b28053 100644 if (req->cmd >= LXC_CMD_MAX) { diff --git a/src/lxc/commands.h b/src/lxc/commands.h -index 2c024b65..0c64544e 100644 +index 2c024b6..0c64544 100644 --- a/src/lxc/commands.h +++ b/src/lxc/commands.h @@ -46,6 +46,7 @@ typedef enum { @@ -121,7 +121,7 @@ index 2c024b65..0c64544e 100644 + #endif /* __commands_h */ diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c -index d6418510..bfbf223b 100644 +index d641851..bfbf223 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -5164,6 +5164,29 @@ static bool do_lxcapi_clean_container_resource(struct lxc_container *c, pid_t pi @@ -163,14 +163,13 @@ index d6418510..bfbf223b 100644 return c; diff --git a/src/lxc/lxccontainer.h b/src/lxc/lxccontainer.h -index a00e0ece..c1d83ba7 100644 +index a00e0ec..c1d83ba 100644 --- a/src/lxc/lxccontainer.h +++ b/src/lxc/lxccontainer.h -@@ -877,6 +877,16 @@ struct lxc_container { - */ +@@ -878,6 +878,16 @@ struct lxc_container { bool (*set_terminal_init_fifos)(struct lxc_container *c, const char *in, const char *out); -+ /*! isulad add + /*! isulad add + * \brief An API call to add the path of terminal fifos + * + * \param c Container. @@ -180,11 +179,12 @@ index a00e0ece..c1d83ba7 100644 + */ + bool (*add_terminal_fifos)(struct lxc_container *c, const char *in, const char *out); + - /*! isulad add ++ /*! isulad add * \brief An API call to set the path of info file * + * \param c Container. diff --git a/src/lxc/terminal.c b/src/lxc/terminal.c -index ee3aef21..a33830dd 100644 +index ee3aef2..a33830d 100644 --- a/src/lxc/terminal.c +++ b/src/lxc/terminal.c @@ -1473,3 +1473,50 @@ int lxc_terminal_map_ids(struct lxc_conf *c, struct lxc_terminal *terminal) @@ -239,7 +239,7 @@ index ee3aef21..a33830dd 100644 +} + diff --git a/src/lxc/terminal.h b/src/lxc/terminal.h -index d25da657..d006b80a 100644 +index d25da65..d006b80 100644 --- a/src/lxc/terminal.h +++ b/src/lxc/terminal.h @@ -310,5 +310,6 @@ extern int lxc_terminal_map_ids(struct lxc_conf *c, @@ -250,5 +250,5 @@ index d25da657..d006b80a 100644 #endif /* __LXC_TERMINAL_H */ -- -2.23.0 +1.8.3.1 diff --git a/0046-Do-not-test-cgroup-writeable.patch b/0046-Do-not-test-cgroup-writeable.patch index b6f5b36c8fe3418009ffbac81aad4d2baac12bb9..105c0db1888183995af9eb4b88b74ff2fce16cd3 100644 --- a/0046-Do-not-test-cgroup-writeable.patch +++ b/0046-Do-not-test-cgroup-writeable.patch @@ -1,7 +1,7 @@ -From acf23ca53402e88beef8a56359e74505c58f3813 Mon Sep 17 00:00:00 2001 +From 0a353f7e5bc5e8f03f2a2654d51eb48c752a22ea Mon Sep 17 00:00:00 2001 From: LiFeng Date: Thu, 17 Jan 2019 03:49:16 -0500 -Subject: [PATCH 046/131] Do not test cgroup writeable +Subject: [PATCH 046/138] Do not test cgroup writeable If we run isulad in docker without cgroup namespace, the base_cgroup will be docker/XXX.., mountpoint+base_cgroup may be not exist @@ -12,7 +12,7 @@ Signed-off-by: LiFeng 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c -index 47b12a64..6bfa693e 100644 +index 47b12a6..6bfa693 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -581,7 +581,7 @@ static bool cg_legacy_handle_cpuset_hierarchy(struct hierarchy *h, char *cgname) @@ -44,5 +44,5 @@ index 47b12a64..6bfa693e 100644 char *cgv2_ctrl_path; -- -2.23.0 +1.8.3.1 diff --git a/0047-Fix-memory-leak-in-lxc_global_config_value.patch b/0047-Fix-memory-leak-in-lxc_global_config_value.patch index b3d08ac9a331aba045cd8f3edd2cfc9ecc6efe13..d7be391cdc083c3a253107340445ffcbd8fca79d 100644 --- a/0047-Fix-memory-leak-in-lxc_global_config_value.patch +++ b/0047-Fix-memory-leak-in-lxc_global_config_value.patch @@ -1,7 +1,7 @@ -From fbf9417e0ee9a19cd678e1c493615fa049b547c9 Mon Sep 17 00:00:00 2001 +From 3e915fc0e452dc7488694f81e1727e979d7afee0 Mon Sep 17 00:00:00 2001 From: LiFeng Date: Thu, 17 Jan 2019 07:43:23 -0500 -Subject: [PATCH 047/131] Fix memory leak in lxc_global_config_value +Subject: [PATCH 047/138] Fix memory leak in lxc_global_config_value Signed-off-by: LiFeng --- @@ -10,7 +10,7 @@ Signed-off-by: LiFeng 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/lxc/cgroups/cgroup.c b/src/lxc/cgroups/cgroup.c -index 720a6c93..8d559bea 100644 +index 720a6c9..8d559be 100644 --- a/src/lxc/cgroups/cgroup.c +++ b/src/lxc/cgroups/cgroup.c @@ -95,6 +95,8 @@ void cgroup_exit(struct cgroup_ops *ops) @@ -23,7 +23,7 @@ index 720a6c93..8d559bea 100644 } diff --git a/src/lxc/initutils.c b/src/lxc/initutils.c -index 09b521e5..60147a5e 100644 +index 09b521e..60147a5 100644 --- a/src/lxc/initutils.c +++ b/src/lxc/initutils.c @@ -74,12 +74,7 @@ const char *lxc_global_config_value(const char *option_name) @@ -40,5 +40,5 @@ index 09b521e5..60147a5e 100644 /* user_config_path is freed as soon as it is used */ char *user_config_path = NULL; -- -2.23.0 +1.8.3.1 diff --git a/0048-clear-ONLCR-flag-from-master-of-terminal.patch b/0048-clear-ONLCR-flag-from-master-of-terminal.patch index dda87d5c55ce5c3407da263340121c8433a7aeca..faa035146315f7cdb6bbf74b08495f197cbb56d8 100644 --- a/0048-clear-ONLCR-flag-from-master-of-terminal.patch +++ b/0048-clear-ONLCR-flag-from-master-of-terminal.patch @@ -1,7 +1,7 @@ -From 933790143774db4c848cf1fafc79dcfa627ee298 Mon Sep 17 00:00:00 2001 +From e98cf0e42079d5fd184b6749c4fdb2467c2ce604 Mon Sep 17 00:00:00 2001 From: liuhao Date: Thu, 17 Jan 2019 20:46:33 +0800 -Subject: [PATCH 048/131] clear ONLCR flag from master of terminal +Subject: [PATCH 048/138] clear ONLCR flag from master of terminal clear ONLCR flag from master of terminal @@ -12,7 +12,7 @@ Signed-off-by: LiFeng 1 file changed, 25 insertions(+) diff --git a/src/lxc/terminal.c b/src/lxc/terminal.c -index a33830dd..95140e0b 100644 +index a33830d..95140e0 100644 --- a/src/lxc/terminal.c +++ b/src/lxc/terminal.c @@ -1066,6 +1066,24 @@ static int lxc_terminal_fifo_default(struct lxc_terminal *terminal) @@ -55,5 +55,5 @@ index a33830dd..95140e0b 100644 if (ret < 0) { SYSERROR("Failed to set FD_CLOEXEC flag on terminal master"); -- -2.23.0 +1.8.3.1 diff --git a/0049-Add-100ms-timeout-for-console-epoll.patch b/0049-Add-100ms-timeout-for-console-epoll.patch index c880e167845b23093e928fa8e41e86f36ac85f97..184abb380f844cdb86b1c76f2fff0a58f2ee2682 100644 --- a/0049-Add-100ms-timeout-for-console-epoll.patch +++ b/0049-Add-100ms-timeout-for-console-epoll.patch @@ -1,7 +1,7 @@ -From 68b20e1e3571bdaf1d454bf23e649474d5675dfd Mon Sep 17 00:00:00 2001 +From 4bbef7bdc1a6d77804cad26bd16ff0d9dd219eb4 Mon Sep 17 00:00:00 2001 From: LiFeng Date: Sat, 19 Jan 2019 02:05:17 -0500 -Subject: [PATCH 049/131] Add 100ms timeout for console epoll +Subject: [PATCH 049/138] Add 100ms timeout for console epoll add 100ms timeout for console epoll to avoid lose console @@ -11,7 +11,7 @@ Signed-off-by: LiFeng 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lxc/start.c b/src/lxc/start.c -index 7bbcb009..daf2af4d 100644 +index 7bbcb00..daf2af4 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -643,7 +643,7 @@ int lxc_poll(const char *name, struct lxc_handler *handler) @@ -24,5 +24,5 @@ index 7bbcb009..daf2af4d 100644 out_mainloop_console: if (has_console) { -- -2.23.0 +1.8.3.1 diff --git a/0050-seccomp-add-rules-for-specified-architecture-only.patch b/0050-seccomp-add-rules-for-specified-architecture-only.patch index 35709e839f2fcf99510a98bbc3ea7ba2994b8d79..00a8a685891abc478ff12973440e1c9cf605b838 100644 --- a/0050-seccomp-add-rules-for-specified-architecture-only.patch +++ b/0050-seccomp-add-rules-for-specified-architecture-only.patch @@ -1,17 +1,17 @@ -From c556e8d4bebcde1ce34168fbac2d22328e19e36a Mon Sep 17 00:00:00 2001 +From 4a00131ad51ab942e847a19192becac112830be4 Mon Sep 17 00:00:00 2001 From: LiFeng Date: Fri, 18 Jan 2019 02:11:11 -0500 -Subject: [PATCH 050/131] seccomp: add rules for specified architecture only +Subject: [PATCH 050/138] seccomp: add rules for specified architecture only LXC MR: https://github.com/lxc/lxc/pull/2786 Signed-off-by: LiFeng --- - src/lxc/seccomp.c | 234 ++++++++++++++++++++++++++-------------------- + src/lxc/seccomp.c | 234 ++++++++++++++++++++++++++++++------------------------ 1 file changed, 132 insertions(+), 102 deletions(-) diff --git a/src/lxc/seccomp.c b/src/lxc/seccomp.c -index 27bdc223..4a9143bb 100644 +index 27bdc22..4a9143b 100644 --- a/src/lxc/seccomp.c +++ b/src/lxc/seccomp.c @@ -291,7 +291,7 @@ on_error: @@ -404,5 +404,5 @@ index 27bdc223..4a9143bb 100644 return 0; -- -2.23.0 +1.8.3.1 diff --git a/0051-if-ocihook-is-empty.patch b/0051-if-ocihook-is-empty.patch index 0c1740762a43625c4ed66cdc8df14b4716721c55..e51a1ca6b589dd17542163c86b968773e6811f93 100644 --- a/0051-if-ocihook-is-empty.patch +++ b/0051-if-ocihook-is-empty.patch @@ -1,7 +1,7 @@ -From 273a33174a35d31b7d56f99a9ce2a958d1ef3b17 Mon Sep 17 00:00:00 2001 +From 48ba71bbd898db500f486f7c33cb48a7a9908713 Mon Sep 17 00:00:00 2001 From: liuhao Date: Tue, 22 Jan 2019 11:25:45 +0800 -Subject: [PATCH 051/131] if ocihook is empty +Subject: [PATCH 051/138] if ocihook is empty return success @@ -12,7 +12,7 @@ Signed-off-by: LiFeng 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lxc/conf.c b/src/lxc/conf.c -index 48e31aff..6ea8f9c1 100644 +index 48e31af..6ea8f9c 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -4782,9 +4782,12 @@ static int run_oci_hooks(const char *name, const char *lxcpath, struct lxc_conf @@ -30,5 +30,5 @@ index 48e31aff..6ea8f9c1 100644 rootpath = get_root_path(lc->rootfs.path, lc->rootfs.bdev_type); if (!rootpath) { -- -2.23.0 +1.8.3.1 diff --git a/0052-Fix-seccomp-fail-when-all-specified-in-config.patch b/0052-Fix-seccomp-fail-when-all-specified-in-config.patch index 46c0aa6359b4f8012d96038b4a7655fbbe59eb49..be87001868e48392aa15f5aee92842cfecadd54a 100644 --- a/0052-Fix-seccomp-fail-when-all-specified-in-config.patch +++ b/0052-Fix-seccomp-fail-when-all-specified-in-config.patch @@ -1,15 +1,15 @@ -From fb356f57bc8783e28c611a25877f3a9d47218264 Mon Sep 17 00:00:00 2001 +From 5c54d741ab4b4c4a064aaf006c38ef10c4f43dca Mon Sep 17 00:00:00 2001 From: LiFeng Date: Mon, 21 Jan 2019 23:28:43 -0500 -Subject: [PATCH 052/131] Fix seccomp fail when [all] specified in config +Subject: [PATCH 052/138] Fix seccomp fail when [all] specified in config Signed-off-by: LiFeng --- - src/lxc/seccomp.c | 56 +++++++++++++++++++++++------------------------ + src/lxc/seccomp.c | 56 +++++++++++++++++++++++++++---------------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/src/lxc/seccomp.c b/src/lxc/seccomp.c -index 4a9143bb..3218a603 100644 +index 4a9143b..3218a60 100644 --- a/src/lxc/seccomp.c +++ b/src/lxc/seccomp.c @@ -346,7 +346,7 @@ int get_hostarch(void) @@ -188,5 +188,5 @@ index 4a9143bb..3218a603 100644 if (!do_resolve_add_rule(ctx.architectures[0], line, ctx.contexts[0], &rule)) -- -2.23.0 +1.8.3.1 diff --git a/0053-destroy-empty-cgroup-path-return-ture.patch b/0053-destroy-empty-cgroup-path-return-ture.patch index 29fc3156e5cbc56974469b35fdf063b91dbdf3f9..f807c2bea3f221acb313e9a002d1f2b84bdeb0bd 100644 --- a/0053-destroy-empty-cgroup-path-return-ture.patch +++ b/0053-destroy-empty-cgroup-path-return-ture.patch @@ -1,7 +1,7 @@ -From 814e6298692f74480fcd807eedc1588b94b3f961 Mon Sep 17 00:00:00 2001 +From a72808463a6f6ae225f2e7ba927973c6817f5496 Mon Sep 17 00:00:00 2001 From: liuhao Date: Tue, 22 Jan 2019 14:45:54 +0800 -Subject: [PATCH 053/131] destroy empty cgroup path return ture +Subject: [PATCH 053/138] destroy empty cgroup path return ture destroy empty cgroup path return ture @@ -12,7 +12,7 @@ Signed-off-by: LiFeng 1 file changed, 4 insertions(+) diff --git a/src/lxc/utils.c b/src/lxc/utils.c -index c8fb9931..24e975bc 100644 +index c8fb993..24e975b 100644 --- a/src/lxc/utils.c +++ b/src/lxc/utils.c @@ -1776,6 +1776,10 @@ int recursive_destroy(char *dirname) @@ -27,5 +27,5 @@ index c8fb9931..24e975bc 100644 return -1; } -- -2.23.0 +1.8.3.1 diff --git a/0054-fix-invalid-log-message.patch b/0054-fix-invalid-log-message.patch index b0314d4eb4d5e8da5cfa4b11b446274e70f8bdc0..af8330438b982b6910ae405e4d38b278ae11069e 100644 --- a/0054-fix-invalid-log-message.patch +++ b/0054-fix-invalid-log-message.patch @@ -1,7 +1,7 @@ -From 5b16103c5148098f737c2b7827805d9e35209ed9 Mon Sep 17 00:00:00 2001 +From 18727f1d50acf2a01e3f593e016ffdb06cef7f16 Mon Sep 17 00:00:00 2001 From: liuhao Date: Tue, 22 Jan 2019 20:14:53 +0800 -Subject: [PATCH 054/131] fix invalid log message +Subject: [PATCH 054/138] fix invalid log message fix invalid log message @@ -13,7 +13,7 @@ Signed-off-by: LiFeng 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/lxc/conf.c b/src/lxc/conf.c -index 6ea8f9c1..1e403ebb 100644 +index 6ea8f9c..1e403eb 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -2708,7 +2708,6 @@ static int mount_file_entries(const struct lxc_conf *conf, @@ -25,7 +25,7 @@ index 6ea8f9c1..1e403ebb 100644 ret = mount_entry_on_systemfs(&mntent); else if (mntent.mnt_dir[0] != '/') diff --git a/src/lxc/utils.c b/src/lxc/utils.c -index 24e975bc..4db61c56 100644 +index 24e975b..4db61c5 100644 --- a/src/lxc/utils.c +++ b/src/lxc/utils.c @@ -1777,7 +1777,7 @@ int recursive_destroy(char *dirname) @@ -38,5 +38,5 @@ index 24e975bc..4db61c56 100644 } SYSERROR("Failed to open dir \"%s\"", dirname); -- -2.23.0 +1.8.3.1 diff --git a/0055-Fix-compile-error.patch b/0055-Fix-compile-error.patch index ded48f1a7b7cc22f48c7ec2c8286fc60ecdf2c93..c33030d8529330867c36ab3d830fe71e3e88d1dc 100644 --- a/0055-Fix-compile-error.patch +++ b/0055-Fix-compile-error.patch @@ -1,7 +1,7 @@ -From ab9a88aaccd839edd48cc15e6e6ef28ff332299d Mon Sep 17 00:00:00 2001 +From 4ee09d4e9110bc6073db74cbf90de696c8104d1e Mon Sep 17 00:00:00 2001 From: LiFeng Date: Thu, 24 Jan 2019 05:14:24 -0500 -Subject: [PATCH 055/131] Fix compile error +Subject: [PATCH 055/138] Fix compile error Signed-off-by: LiFeng --- @@ -16,7 +16,7 @@ Signed-off-by: LiFeng 8 files changed, 18 insertions(+), 44 deletions(-) diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c -index 6bfa693e..e5132182 100644 +index 6bfa693..e513218 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -1263,18 +1263,6 @@ static bool create_path_for_hierarchy(struct hierarchy *h, char *cgname, int err @@ -47,7 +47,7 @@ index 6bfa693e..e5132182 100644 char *base_cgroup = NULL, *mountpoint = NULL; char **controller_list = NULL; diff --git a/src/lxc/conf.c b/src/lxc/conf.c -index 1e403ebb..4800943c 100644 +index 1e403eb..4800943 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -1518,7 +1518,7 @@ error: @@ -101,7 +101,7 @@ index 1e403ebb..4800943c 100644 if (!argv || !argv[0]) { ERROR("oci hook require lxcpath"); diff --git a/src/lxc/confile.c b/src/lxc/confile.c -index 7e9d5c85..f66d01ba 100644 +index 7e9d5c8..f66d01b 100644 --- a/src/lxc/confile.c +++ b/src/lxc/confile.c @@ -3909,7 +3909,6 @@ static int get_config_init_args(const char *key, char *retv, int inlen, @@ -113,7 +113,7 @@ index 7e9d5c85..f66d01ba 100644 if (!retv) inlen = 0; diff --git a/src/lxc/start.c b/src/lxc/start.c -index daf2af4d..816b4a2d 100644 +index daf2af4..816b4a2 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -2470,8 +2470,6 @@ retry: @@ -126,7 +126,7 @@ index daf2af4d..816b4a2d 100644 out: return ret; diff --git a/src/lxc/terminal.c b/src/lxc/terminal.c -index 95140e0b..252a644f 100644 +index 95140e0..252a644 100644 --- a/src/lxc/terminal.c +++ b/src/lxc/terminal.c @@ -418,6 +418,21 @@ static void lxc_forward_data_to_fifo(struct lxc_list *list, char *buf, int r) @@ -183,7 +183,7 @@ index 95140e0b..252a644f 100644 int lxc_terminal_delete_fifo(int fd, struct lxc_list *list) { diff --git a/src/lxc/terminal.h b/src/lxc/terminal.h -index d006b80a..0c9653c5 100644 +index d006b80..0c9653c 100644 --- a/src/lxc/terminal.h +++ b/src/lxc/terminal.h @@ -305,9 +305,6 @@ extern void lxc_terminal_info_init(struct lxc_terminal_info *terminal); @@ -197,7 +197,7 @@ index d006b80a..0c9653c5 100644 int lxc_terminal_delete_fifo(int fd, struct lxc_list *list); int lxc_terminal_add_fifos(struct lxc_conf *conf, const char *fifonames); diff --git a/src/lxc/tools/lxc_attach.c b/src/lxc/tools/lxc_attach.c -index a590fd12..88569344 100644 +index a590fd1..8856934 100644 --- a/src/lxc/tools/lxc_attach.c +++ b/src/lxc/tools/lxc_attach.c @@ -398,11 +398,9 @@ out: @@ -213,7 +213,7 @@ index a590fd12..88569344 100644 lxc_attach_command_t command = (lxc_attach_command_t){.program = NULL}; diff --git a/src/lxc/utils.c b/src/lxc/utils.c -index 4db61c56..9a50fced 100644 +index 4db61c5..9a50fce 100644 --- a/src/lxc/utils.c +++ b/src/lxc/utils.c @@ -2026,7 +2026,6 @@ void lxc_write_error_message(int errfd, const char *format, ...) @@ -225,5 +225,5 @@ index 4db61c56..9a50fced 100644 bool alive = true; proc_t *pid_info = NULL; -- -2.23.0 +1.8.3.1 diff --git a/0056-caps-use-_LINUX_CAPABILITY_VERSION_3-to-set-cap.patch b/0056-caps-use-_LINUX_CAPABILITY_VERSION_3-to-set-cap.patch index 8d85a96e114bb2801d2c23a6ef7c7c35dd743a69..6ad553174f940b574763901dd4d8ba191581d7aa 100644 --- a/0056-caps-use-_LINUX_CAPABILITY_VERSION_3-to-set-cap.patch +++ b/0056-caps-use-_LINUX_CAPABILITY_VERSION_3-to-set-cap.patch @@ -1,7 +1,7 @@ -From 4891152f9c76e68ae32c36f4af7262117ca3a3bd Mon Sep 17 00:00:00 2001 +From fce70a877da27262b274e56e5b31fbd16753adff Mon Sep 17 00:00:00 2001 From: LiFeng Date: Sat, 26 Jan 2019 02:22:48 -0500 -Subject: [PATCH 056/131] [caps]: use _LINUX_CAPABILITY_VERSION_3 to set cap +Subject: [PATCH 056/138] [caps]: use _LINUX_CAPABILITY_VERSION_3 to set cap Signed-off-by: LiFeng --- @@ -10,7 +10,7 @@ Signed-off-by: LiFeng 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/lxc/conf.c b/src/lxc/conf.c -index 4800943c..0c6aa28d 100644 +index 4800943..0c6aa28 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -4322,13 +4322,13 @@ int lxc_drop_caps(struct lxc_conf *conf) @@ -32,7 +32,7 @@ index 4800943c..0c6aa28d 100644 } diff --git a/src/lxc/seccomp.c b/src/lxc/seccomp.c -index 3218a603..4a5b3d0b 100644 +index 3218a60..4a5b3d0 100644 --- a/src/lxc/seccomp.c +++ b/src/lxc/seccomp.c @@ -706,7 +706,6 @@ static int parse_config_v2(FILE *f, char *line, size_t *line_bufsz, struct lxc_c @@ -44,5 +44,5 @@ index 3218a603..4a5b3d0b 100644 ctx.contexts[0] = get_new_ctx(lxc_seccomp_arch_mipsel, default_policy_action, &ctx.architectures[0]); -- -2.23.0 +1.8.3.1 diff --git a/0057-confile-add-support-umask.patch b/0057-confile-add-support-umask.patch index 44340f6677bcb61c557a023ad7a71bb6a5383316..d79b14a9aa7f778f752a8cfe324227d5a52a52c3 100644 --- a/0057-confile-add-support-umask.patch +++ b/0057-confile-add-support-umask.patch @@ -1,7 +1,7 @@ -From e72844df2abd8afda21af2cee1b546c8939759f4 Mon Sep 17 00:00:00 2001 +From 428aeee42cc96d20dc7934e2ac038561ca9cde3d Mon Sep 17 00:00:00 2001 From: LiFeng Date: Wed, 30 Jan 2019 03:39:42 -0500 -Subject: [PATCH 057/131] confile: add support umask +Subject: [PATCH 057/138] confile: add support umask lxc.isulad.umask=normal make the container umask to 0022 lxc.isulad.umask=secure make the container umask to 0027 (default) @@ -15,7 +15,7 @@ Signed-off-by: LiFeng 4 files changed, 44 insertions(+), 4 deletions(-) diff --git a/src/lxc/attach.c b/src/lxc/attach.c -index b44ea746..97688971 100644 +index b44ea74..9768897 100644 --- a/src/lxc/attach.c +++ b/src/lxc/attach.c @@ -768,8 +768,8 @@ static int attach_child_main(struct attach_clone_payload *payload) @@ -30,7 +30,7 @@ index b44ea746..97688971 100644 /*isulad: restore default signal handlers and unblock all signals*/ for (i = 1; i < NSIG; i++) diff --git a/src/lxc/conf.c b/src/lxc/conf.c -index 0c6aa28d..67beefe4 100644 +index 0c6aa28..67beefe 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -3163,6 +3163,7 @@ struct lxc_conf *lxc_conf_init(void) @@ -53,7 +53,7 @@ index 0c6aa28d..67beefe4 100644 ret = setup_personality(lxc_conf->personality); if (ret < 0) { diff --git a/src/lxc/conf.h b/src/lxc/conf.h -index 88f5b417..93cf15dd 100644 +index 88f5b41..93cf15d 100644 --- a/src/lxc/conf.h +++ b/src/lxc/conf.h @@ -427,6 +427,7 @@ struct lxc_conf { @@ -65,7 +65,7 @@ index 88f5b417..93cf15dd 100644 }; diff --git a/src/lxc/confile.c b/src/lxc/confile.c -index f66d01ba..3940b328 100644 +index f66d01b..3940b32 100644 --- a/src/lxc/confile.c +++ b/src/lxc/confile.c @@ -155,6 +155,7 @@ lxc_config_define(proc); @@ -142,5 +142,5 @@ index f66d01ba..3940b328 100644 struct lxc_conf *c, void *data) { -- -2.23.0 +1.8.3.1 diff --git a/0058-do-not-check-ppid-when-set-death-signal.patch b/0058-do-not-check-ppid-when-set-death-signal.patch index f11bf506f370e66e731f18b5d4f55ff5fd42df2f..e3e917046e1397f86dd0b48605143bd63be5c500 100644 --- a/0058-do-not-check-ppid-when-set-death-signal.patch +++ b/0058-do-not-check-ppid-when-set-death-signal.patch @@ -1,7 +1,7 @@ -From e7542b143ade41e65ab267f3593a9813ccff938d Mon Sep 17 00:00:00 2001 +From 33c5b695d265b115b6ff96bbc33152feb4e69473 Mon Sep 17 00:00:00 2001 From: tanyifeng Date: Tue, 12 Feb 2019 14:00:47 +0800 -Subject: [PATCH 058/131] do not check ppid when set death signal +Subject: [PATCH 058/138] do not check ppid when set death signal ppid will not be 0 if we shared host pid @@ -12,7 +12,7 @@ Signed-off-by: LiFeng 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lxc/utils.c b/src/lxc/utils.c -index 9a50fced..0aa87aa4 100644 +index 9a50fce..0aa87aa 100644 --- a/src/lxc/utils.c +++ b/src/lxc/utils.c @@ -1722,12 +1722,13 @@ int lxc_set_death_signal(int signal, pid_t parent) @@ -32,5 +32,5 @@ index 9a50fced..0aa87aa4 100644 if (ret < 0) return -1; -- -2.23.0 +1.8.3.1 diff --git a/0059-delete-unused-variable-ppid.patch b/0059-delete-unused-variable-ppid.patch index 8b4f7f15cc1f557abeec382588b3eacf849dbedb..6c891d352feba920ac3417949985782e9b087c70 100644 --- a/0059-delete-unused-variable-ppid.patch +++ b/0059-delete-unused-variable-ppid.patch @@ -1,7 +1,7 @@ -From b8b947bb46f94f46433568f9206648f8f889b0b3 Mon Sep 17 00:00:00 2001 +From 784667557d28af0e18296cff022e69632a85f706 Mon Sep 17 00:00:00 2001 From: tanyifeng Date: Tue, 12 Feb 2019 14:36:35 +0800 -Subject: [PATCH 059/131] delete unused variable ppid +Subject: [PATCH 059/138] delete unused variable ppid Signed-off-by: tanyifeng Signed-off-by: LiFeng @@ -10,7 +10,7 @@ Signed-off-by: LiFeng 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lxc/utils.c b/src/lxc/utils.c -index 0aa87aa4..91ba4935 100644 +index 0aa87aa..91ba493 100644 --- a/src/lxc/utils.c +++ b/src/lxc/utils.c @@ -1716,7 +1716,7 @@ uint64_t lxc_find_next_power2(uint64_t n) @@ -23,5 +23,5 @@ index 0aa87aa4..91ba4935 100644 ret = prctl(PR_SET_PDEATHSIG, prctl_arg(signal), prctl_arg(0), prctl_arg(0), prctl_arg(0)); -- -2.23.0 +1.8.3.1 diff --git a/0060-using-json-file-to-write-console-log-of-container.patch b/0060-using-json-file-to-write-console-log-of-container.patch index 5cd966f5caf6269d29b5f2b6796b5c10197b45ac..a00af4b56674a8ee10c8d5e9878e6075b94d65e3 100644 --- a/0060-using-json-file-to-write-console-log-of-container.patch +++ b/0060-using-json-file-to-write-console-log-of-container.patch @@ -1,23 +1,23 @@ -From 69d69a842a06671bc095bd4692dd8ea265cf6755 Mon Sep 17 00:00:00 2001 +From d8efea3a4bd5c23eb18de98c5a7f908fd6409e60 Mon Sep 17 00:00:00 2001 From: tanyifeng Date: Wed, 30 Jan 2019 17:44:19 +0800 -Subject: [PATCH 060/131] using json-file to write console log of container +Subject: [PATCH 060/138] using json-file to write console log of container Signed-off-by: tanyifeng Signed-off-by: LiFeng --- src/lxc/Makefile.am | 2 + - src/lxc/json/json_common.c | 14 +- + src/lxc/json/json_common.c | 14 ++- src/lxc/json/json_common.h | 2 + - src/lxc/json/logger_json_file.c | 243 ++++++++++++++++++++++++++++++++ - src/lxc/json/logger_json_file.h | 45 ++++++ - src/lxc/terminal.c | 166 ++++++++++++++++++++-- + src/lxc/json/logger_json_file.c | 243 ++++++++++++++++++++++++++++++++++++++++ + src/lxc/json/logger_json_file.h | 45 ++++++++ + src/lxc/terminal.c | 166 +++++++++++++++++++++++++-- 6 files changed, 457 insertions(+), 15 deletions(-) create mode 100644 src/lxc/json/logger_json_file.c create mode 100644 src/lxc/json/logger_json_file.h diff --git a/src/lxc/Makefile.am b/src/lxc/Makefile.am -index 260a7eb0..698f8f95 100644 +index 260a7eb..698f8f9 100644 --- a/src/lxc/Makefile.am +++ b/src/lxc/Makefile.am @@ -47,6 +47,7 @@ noinst_HEADERS = attach.h \ @@ -37,7 +37,7 @@ index 260a7eb0..698f8f95 100644 json/read-file.c json/read-file.h \ $(LSM_SOURCES) diff --git a/src/lxc/json/json_common.c b/src/lxc/json/json_common.c -index 8b91844d..e339ab3a 100755 +index 8b91844..e339ab3 100755 --- a/src/lxc/json/json_common.c +++ b/src/lxc/json/json_common.c @@ -86,7 +86,7 @@ bool json_gen_init(yajl_gen *g, struct parser_context *ctx) { @@ -81,7 +81,7 @@ index 8b91844d..e339ab3a 100755 +} \ No newline at end of file diff --git a/src/lxc/json/json_common.h b/src/lxc/json/json_common.h -index 904fe3cd..eb8281c7 100755 +index 904fe3c..eb8281c 100755 --- a/src/lxc/json/json_common.h +++ b/src/lxc/json/json_common.h @@ -23,6 +23,8 @@ extern "C" { @@ -95,7 +95,7 @@ index 904fe3cd..eb8281c7 100755 if (!*(err)) {\ diff --git a/src/lxc/json/logger_json_file.c b/src/lxc/json/logger_json_file.c new file mode 100644 -index 00000000..4d781032 +index 0000000..4d78103 --- /dev/null +++ b/src/lxc/json/logger_json_file.c @@ -0,0 +1,243 @@ @@ -344,7 +344,7 @@ index 00000000..4d781032 +} diff --git a/src/lxc/json/logger_json_file.h b/src/lxc/json/logger_json_file.h new file mode 100644 -index 00000000..ad5af7b4 +index 0000000..ad5af7b --- /dev/null +++ b/src/lxc/json/logger_json_file.h @@ -0,0 +1,45 @@ @@ -394,7 +394,7 @@ index 00000000..ad5af7b4 + +#endif diff --git a/src/lxc/terminal.c b/src/lxc/terminal.c -index 252a644f..602d43d7 100644 +index 252a644..602d43d 100644 --- a/src/lxc/terminal.c +++ b/src/lxc/terminal.c @@ -47,6 +47,7 @@ @@ -606,5 +606,5 @@ index 252a644f..602d43d7 100644 if (terminal->tty_state) { lxc_terminal_signal_fini(terminal->tty_state); -- -2.23.0 +1.8.3.1 diff --git a/0061-Fix-hook-use-the-path-args-envs-execvp-dirctory.patch b/0061-Fix-hook-use-the-path-args-envs-execvp-dirctory.patch index 7edd79cb4a97b22e2b76c17bbe8397de98da837d..0e4508919a100fb762142df9cced28556988dbe4 100644 --- a/0061-Fix-hook-use-the-path-args-envs-execvp-dirctory.patch +++ b/0061-Fix-hook-use-the-path-args-envs-execvp-dirctory.patch @@ -1,7 +1,7 @@ -From 48f6b2e54616c2dbb421374092502704201dfab9 Mon Sep 17 00:00:00 2001 +From 105b7c1dc22ec9928a42e803f32f9a4b461a6a3a Mon Sep 17 00:00:00 2001 From: LiFeng Date: Thu, 21 Feb 2019 05:37:05 -0500 -Subject: [PATCH 061/131] Fix hook: use the path, args, envs execvp dirctory +Subject: [PATCH 061/138] Fix hook: use the path, args, envs execvp dirctory Signed-off-by: LiFeng --- @@ -9,7 +9,7 @@ Signed-off-by: LiFeng 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/src/lxc/conf.c b/src/lxc/conf.c -index 67beefe4..c2f3cf56 100644 +index 67beefe..c2f3cf5 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -4467,9 +4467,6 @@ static struct lxc_popen_FILE *lxc_popen_ocihook(char *commandpath, char **args, @@ -46,5 +46,5 @@ index 67beefe4..c2f3cf56 100644 } -- -2.23.0 +1.8.3.1 diff --git a/0062-setup-sysctls-before-set-read-only-path-and-masked-p.patch b/0062-setup-sysctls-before-set-read-only-path-and-masked-p.patch index 35efbdbcf731d1b6d7a7853e730d83285dcab724..fcc9708bc874bc1a71eb0eea49f920e97afd6898 100644 --- a/0062-setup-sysctls-before-set-read-only-path-and-masked-p.patch +++ b/0062-setup-sysctls-before-set-read-only-path-and-masked-p.patch @@ -1,7 +1,7 @@ -From 39d38c5ced23ed1834686d7ad5f785f45ef31772 Mon Sep 17 00:00:00 2001 +From 90ed6cee52d52bb153c139ece83ccfbf46f79a44 Mon Sep 17 00:00:00 2001 From: tanyifeng Date: Tue, 26 Feb 2019 17:21:18 +0800 -Subject: [PATCH 062/131] setup sysctls before set read-only path and masked +Subject: [PATCH 062/138] setup sysctls before set read-only path and masked path Signed-off-by: tanyifeng @@ -11,7 +11,7 @@ Signed-off-by: LiFeng 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/lxc/conf.c b/src/lxc/conf.c -index c2f3cf56..e139dffe 100644 +index c2f3cf5..e139dff 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -3039,7 +3039,7 @@ int setup_sysctl_parameters(struct lxc_list *sysctls) @@ -70,5 +70,5 @@ index c2f3cf56..e139dffe 100644 if (!lxc_list_empty(&lxc_conf->caps)) { ERROR("Container requests lxc.cap.drop and " -- -2.23.0 +1.8.3.1 diff --git a/0063-lxc-ignore-systemcall-load-failure-error.patch b/0063-lxc-ignore-systemcall-load-failure-error.patch index 78b71d33d6241a58f633327fd33adef54b4542a6..ff84d94846735a94ca3a756d6d69aa31f0d8dd87 100644 --- a/0063-lxc-ignore-systemcall-load-failure-error.patch +++ b/0063-lxc-ignore-systemcall-load-failure-error.patch @@ -1,7 +1,7 @@ -From b9f9f1d5dc0c6156d58115e32be55f2b4259599c Mon Sep 17 00:00:00 2001 +From 317002555ed41c63b119799aff15196e8bd99124 Mon Sep 17 00:00:00 2001 From: tanyifeng Date: Sat, 9 Mar 2019 03:10:06 +0800 -Subject: [PATCH 063/131] lxc: ignore systemcall load failure error +Subject: [PATCH 063/138] lxc: ignore systemcall load failure error Signed-off-by: wujing Signed-off-by: LiFeng @@ -10,7 +10,7 @@ Signed-off-by: LiFeng 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lxc/seccomp.c b/src/lxc/seccomp.c -index 4a5b3d0b..26eac907 100644 +index 4a5b3d0..26eac90 100644 --- a/src/lxc/seccomp.c +++ b/src/lxc/seccomp.c @@ -543,7 +543,7 @@ bool do_resolve_add_rule(uint32_t arch, char *line, scmp_filter_ctx ctx, @@ -23,5 +23,5 @@ index 4a5b3d0b..26eac907 100644 return true; -- -2.23.0 +1.8.3.1 diff --git a/0064-lxc-Reduce-seccomp-processing-log-level.patch b/0064-lxc-Reduce-seccomp-processing-log-level.patch index 9eeb2ca97362ef264d2a94b8d40e62f686ef72a3..bef004529eb7193b8167130091f6cf3c1d827dda 100644 --- a/0064-lxc-Reduce-seccomp-processing-log-level.patch +++ b/0064-lxc-Reduce-seccomp-processing-log-level.patch @@ -1,7 +1,7 @@ -From 1a34ec5bddd89074575a985c87cec360eb4adc8c Mon Sep 17 00:00:00 2001 +From d058d9203581f1c883910c6b51f2faf95bf33634 Mon Sep 17 00:00:00 2001 From: tanyifeng Date: Sun, 10 Mar 2019 00:47:05 +0800 -Subject: [PATCH 064/131] lxc: Reduce seccomp processing log level +Subject: [PATCH 064/138] lxc: Reduce seccomp processing log level Signed-off-by: wujing Signed-off-by: LiFeng @@ -10,7 +10,7 @@ Signed-off-by: LiFeng 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lxc/seccomp.c b/src/lxc/seccomp.c -index 26eac907..7f107778 100644 +index 26eac90..7f10777 100644 --- a/src/lxc/seccomp.c +++ b/src/lxc/seccomp.c @@ -507,14 +507,14 @@ bool do_resolve_add_rule(uint32_t arch, char *line, scmp_filter_ctx ctx, @@ -42,5 +42,5 @@ index 26eac907..7f107778 100644 return true; } -- -2.23.0 +1.8.3.1 diff --git a/0065-Storage-return-true-if-storage_init-init-fail.patch b/0065-Storage-return-true-if-storage_init-init-fail.patch index 4c31a2a16b830ca01af8b12339be0fbeedcd0a1a..f6b26d55cfb1abe48a2810e0b19f24ac7577d96a 100644 --- a/0065-Storage-return-true-if-storage_init-init-fail.patch +++ b/0065-Storage-return-true-if-storage_init-init-fail.patch @@ -1,7 +1,7 @@ -From 86c34d70d2a3e213945bda652ccb970bc89b79c6 Mon Sep 17 00:00:00 2001 +From a7911877ab97ce77a810f57ff4a3e4a9383f6f9d Mon Sep 17 00:00:00 2001 From: LiFeng Date: Mon, 11 Mar 2019 23:26:27 -0400 -Subject: [PATCH 065/131] Storage: return true if storage_init init fail +Subject: [PATCH 065/138] Storage: return true if storage_init init fail Signed-off-by: LiFeng --- @@ -9,7 +9,7 @@ Signed-off-by: LiFeng 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lxc/storage/storage.c b/src/lxc/storage/storage.c -index 18f754a4..88ed7884 100644 +index 18f754a..88ed788 100644 --- a/src/lxc/storage/storage.c +++ b/src/lxc/storage/storage.c @@ -610,8 +610,11 @@ bool storage_destroy(struct lxc_conf *conf) @@ -26,5 +26,5 @@ index 18f754a4..88ed7884 100644 destroy_rv = r->ops->destroy(r); if (destroy_rv == 0) -- -2.23.0 +1.8.3.1 diff --git a/0066-lxc-Pids-limit-does-not-report-an-error-after-execut.patch b/0066-lxc-Pids-limit-does-not-report-an-error-after-execut.patch index 195e7ef3a359e3c77f8d36ec05fe87006046fd2c..e1bad41202328b81b990dd540088e86bfb83c472 100644 --- a/0066-lxc-Pids-limit-does-not-report-an-error-after-execut.patch +++ b/0066-lxc-Pids-limit-does-not-report-an-error-after-execut.patch @@ -1,7 +1,7 @@ -From 662d5aab3686ddf29294a7f6d67e4e092cac51e9 Mon Sep 17 00:00:00 2001 +From 62a3cf699d424e956cc7f7a73d425c5828f64902 Mon Sep 17 00:00:00 2001 From: tanyifeng Date: Fri, 15 Mar 2019 10:11:10 +0800 -Subject: [PATCH 066/131] lxc: Pids limit does not report an error after +Subject: [PATCH 066/138] lxc: Pids limit does not report an error after executing the limit in the background Signed-off-by: wujing @@ -11,7 +11,7 @@ Signed-off-by: LiFeng 1 file changed, 2 insertions(+) diff --git a/src/lxc/tools/lxc_attach.c b/src/lxc/tools/lxc_attach.c -index 88569344..acdf8a01 100644 +index 8856934..acdf8a0 100644 --- a/src/lxc/tools/lxc_attach.c +++ b/src/lxc/tools/lxc_attach.c @@ -378,6 +378,8 @@ static int do_attach_background(struct lxc_container *c, lxc_attach_command_t *c @@ -24,5 +24,5 @@ index 88569344..acdf8a01 100644 msgpipe[1] = -1; ret = -1; -- -2.23.0 +1.8.3.1 diff --git a/0067-lxc-report-error-when-remove-directory-failed.patch b/0067-lxc-report-error-when-remove-directory-failed.patch index c53de513756c9d2068b6dd63c115782cffef0d5c..8f4d93c6fbb811da0e3af00f24cf3808e4a55219 100644 --- a/0067-lxc-report-error-when-remove-directory-failed.patch +++ b/0067-lxc-report-error-when-remove-directory-failed.patch @@ -1,7 +1,7 @@ -From 5e13dd95a5e96b3d9bc9e28b6d8912625b92ce20 Mon Sep 17 00:00:00 2001 +From 44a5db6680dd81a11cd1afe87fae9ad63dc30f34 Mon Sep 17 00:00:00 2001 From: tanyifeng Date: Sat, 16 Mar 2019 10:06:13 +0800 -Subject: [PATCH 067/131] lxc: report error when remove directory failed +Subject: [PATCH 067/138] lxc: report error when remove directory failed Signed-off-by: tanyifeng Signed-off-by: LiFeng @@ -11,7 +11,7 @@ Signed-off-by: LiFeng 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c -index bfbf223b..3fd1a66c 100644 +index bfbf223..3fd1a66 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -3148,8 +3148,11 @@ static bool container_destroy(struct lxc_container *c, @@ -27,7 +27,7 @@ index bfbf223b..3fd1a66c 100644 } INFO("Destroyed directory \"%s\" for \"%s\"", path, c->name); diff --git a/src/lxc/utils.c b/src/lxc/utils.c -index 91ba4935..480e6d0a 100644 +index 91ba493..480e6d0 100644 --- a/src/lxc/utils.c +++ b/src/lxc/utils.c @@ -88,6 +88,7 @@ static int _recursive_rmdir(const char *dirname, dev_t pdev, @@ -68,5 +68,5 @@ index 91ba4935..480e6d0a 100644 } -- -2.23.0 +1.8.3.1 diff --git a/0068-support-record-stdout-stderr-log-of-container-consol.patch b/0068-support-record-stdout-stderr-log-of-container-consol.patch index a2dc5d6098f29bcda763e31cd9085bf54cab4c9a..f6e54fcae3d0987d6d0eded21fe1ebed025f2c3e 100644 --- a/0068-support-record-stdout-stderr-log-of-container-consol.patch +++ b/0068-support-record-stdout-stderr-log-of-container-consol.patch @@ -1,7 +1,7 @@ -From a2682d0a53a373585ad99d24d245e5c009127ea3 Mon Sep 17 00:00:00 2001 +From 1c4b55f4bb5d7b9720153073e78facb69fe220d1 Mon Sep 17 00:00:00 2001 From: tanyifeng Date: Thu, 21 Feb 2019 20:27:47 +0800 -Subject: [PATCH 068/131] support record stdout, stderr log of container +Subject: [PATCH 068/138] support record stdout, stderr log of container console Signed-off-by: tanyifeng @@ -11,12 +11,12 @@ Signed-off-by: LiFeng src/lxc/attach_options.h | 2 +- src/lxc/commands.c | 15 +- src/lxc/commands.h | 2 +- - src/lxc/conf.c | 33 ++-- - src/lxc/lxccontainer.c | 79 +++++++-- - src/lxc/lxccontainer.h | 35 +++- - src/lxc/start.c | 67 ++++++- + src/lxc/conf.c | 33 +++-- + src/lxc/lxccontainer.c | 79 +++++++--- + src/lxc/lxccontainer.h | 35 ++++- + src/lxc/start.c | 67 ++++++++- src/lxc/start.h | 5 + - src/lxc/terminal.c | 351 +++++++++++++++++++++++++++---------- + src/lxc/terminal.c | 351 ++++++++++++++++++++++++++++++++------------- src/lxc/terminal.h | 7 +- src/lxc/tools/arguments.h | 14 +- src/lxc/tools/lxc_attach.c | 7 +- @@ -24,7 +24,7 @@ Signed-off-by: LiFeng 14 files changed, 502 insertions(+), 152 deletions(-) diff --git a/src/lxc/attach.c b/src/lxc/attach.c -index 97688971..c979c85a 100644 +index 9768897..c979c85 100644 --- a/src/lxc/attach.c +++ b/src/lxc/attach.c @@ -1052,15 +1052,18 @@ static int lxc_attach_terminal(struct lxc_conf *conf, @@ -53,7 +53,7 @@ index 97688971..c979c85a 100644 ret = lxc_terminal_create(terminal); if (ret < 0) { diff --git a/src/lxc/attach_options.h b/src/lxc/attach_options.h -index 7b0a8cb3..71c1739d 100644 +index 7b0a8cb..71c1739 100644 --- a/src/lxc/attach_options.h +++ b/src/lxc/attach_options.h @@ -136,7 +136,7 @@ typedef struct lxc_attach_options_t { @@ -66,7 +66,7 @@ index 7b0a8cb3..71c1739d 100644 /*! Default attach options to use */ diff --git a/src/lxc/commands.c b/src/lxc/commands.c -index 46b28053..f0c95df7 100644 +index 46b2805..f0c95df 100644 --- a/src/lxc/commands.c +++ b/src/lxc/commands.c @@ -1064,21 +1064,22 @@ reap_client_fd: @@ -100,7 +100,7 @@ index 46b28053..f0c95df7 100644 struct lxc_cmd_rr cmd = { .req = { diff --git a/src/lxc/commands.h b/src/lxc/commands.h -index 0c64544e..6b64849c 100644 +index 0c64544..6b64849 100644 --- a/src/lxc/commands.h +++ b/src/lxc/commands.h @@ -127,6 +127,6 @@ extern int lxc_cmd_console_log(const char *name, const char *lxcpath, @@ -112,7 +112,7 @@ index 0c64544e..6b64849c 100644 #endif /* __commands_h */ diff --git a/src/lxc/conf.c b/src/lxc/conf.c -index e139dffe..a6b97975 100644 +index e139dff..a6b9797 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -2067,20 +2067,22 @@ static int lxc_setup_ttydir_console(const struct lxc_rootfs *rootfs, @@ -165,7 +165,7 @@ index e139dffe..a6b97975 100644 new->errmsg = NULL; diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c -index 3fd1a66c..8a3724c6 100644 +index 3fd1a66..8a3724c 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -702,6 +702,40 @@ static bool do_lxcapi_want_daemonize(struct lxc_container *c, bool state) @@ -318,7 +318,7 @@ index 3fd1a66c..8a3724c6 100644 c->start = lxcapi_start; c->startl = lxcapi_startl; diff --git a/src/lxc/lxccontainer.h b/src/lxc/lxccontainer.h -index c1d83ba7..c3368e4f 100644 +index c1d83ba..c3368e4 100644 --- a/src/lxc/lxccontainer.h +++ b/src/lxc/lxccontainer.h @@ -137,6 +137,15 @@ struct lxc_container { @@ -337,11 +337,10 @@ index c1d83ba7..c3368e4f 100644 /*! Full path to configuration file */ char *config_path; -@@ -243,6 +252,28 @@ struct lxc_container { - */ +@@ -244,6 +253,28 @@ struct lxc_container { bool (*stop)(struct lxc_container *c); -+ /*! + /*! + * \brief Change whether the container wants to create pty or pipes + * from the console log. + * @@ -363,9 +362,10 @@ index c1d83ba7..c3368e4f 100644 + */ + bool (*want_open_stdin)(struct lxc_container *c, bool state); + - /*! ++ /*! * \brief Change whether the container wants to run disconnected * from the terminal. + * @@ -875,7 +906,7 @@ struct lxc_container { * * \return \c true on success, else \c false. @@ -385,7 +385,7 @@ index c1d83ba7..c3368e4f 100644 /*! isulad add * \brief An API call to set the path of info file diff --git a/src/lxc/start.c b/src/lxc/start.c -index 816b4a2d..cad0d769 100644 +index 816b4a2..cad0d76 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -635,6 +635,13 @@ int lxc_poll(const char *name, struct lxc_handler *handler) @@ -505,7 +505,7 @@ index 816b4a2d..cad0d769 100644 if (handler->conf->container_info_file) { if (lxc_save_container_info(handler->conf->container_info_file, handler->pid)) { diff --git a/src/lxc/start.h b/src/lxc/start.h -index ab72e6e0..02989919 100644 +index ab72e6e..0298991 100644 --- a/src/lxc/start.h +++ b/src/lxc/start.h @@ -99,6 +99,11 @@ struct lxc_handler { @@ -521,7 +521,7 @@ index ab72e6e0..02989919 100644 pid_t pid; diff --git a/src/lxc/terminal.c b/src/lxc/terminal.c -index 602d43d7..dfce92ed 100644 +index 602d43d..dfce92e 100644 --- a/src/lxc/terminal.c +++ b/src/lxc/terminal.c @@ -432,7 +432,7 @@ static bool get_now_time_buffer(char *timebuffer, size_t maxsize) @@ -1080,7 +1080,7 @@ index 602d43d7..dfce92ed 100644 ret = -1; goto free_out; diff --git a/src/lxc/terminal.h b/src/lxc/terminal.h -index 0c9653c5..9bb341f0 100644 +index 0c9653c..9bb341f 100644 --- a/src/lxc/terminal.h +++ b/src/lxc/terminal.h @@ -115,16 +115,21 @@ struct lxc_terminal { @@ -1107,7 +1107,7 @@ index 0c9653c5..9bb341f0 100644 }; diff --git a/src/lxc/tools/arguments.h b/src/lxc/tools/arguments.h -index afab9f54..d03f8a42 100644 +index afab9f5..d03f8a4 100644 --- a/src/lxc/tools/arguments.h +++ b/src/lxc/tools/arguments.h @@ -51,6 +51,8 @@ struct lxc_arguments { @@ -1146,7 +1146,7 @@ index afab9f54..d03f8a42 100644 extern int lxc_arguments_parse(struct lxc_arguments *args, int argc, diff --git a/src/lxc/tools/lxc_attach.c b/src/lxc/tools/lxc_attach.c -index acdf8a01..674050de 100644 +index acdf8a0..674050d 100644 --- a/src/lxc/tools/lxc_attach.c +++ b/src/lxc/tools/lxc_attach.c @@ -77,6 +77,7 @@ static const struct option my_longopts[] = { @@ -1180,7 +1180,7 @@ index acdf8a01..674050de 100644 } else if (stdfd_is_pty()) { attach_options.attach_flags |= LXC_ATTACH_TERMINAL; diff --git a/src/lxc/tools/lxc_start.c b/src/lxc/tools/lxc_start.c -index ec487018..183fafcb 100644 +index ec48701..183fafc 100644 --- a/src/lxc/tools/lxc_start.c +++ b/src/lxc/tools/lxc_start.c @@ -73,9 +73,12 @@ static const struct option my_longopts[] = { @@ -1240,5 +1240,5 @@ index ec487018..183fafcb 100644 if (args == default_args) err = c->start(c, 0, NULL) ? EXIT_SUCCESS : EXIT_FAILURE; -- -2.23.0 +1.8.3.1 diff --git a/0069-lxc-killall-processes-if-container-shared-pid-namesp.patch b/0069-lxc-killall-processes-if-container-shared-pid-namesp.patch index 6376f50e1318911f4e73d690545abb3ca722bc03..b03933a001bdfe7df38a43cdf2264cb25276ae42 100644 --- a/0069-lxc-killall-processes-if-container-shared-pid-namesp.patch +++ b/0069-lxc-killall-processes-if-container-shared-pid-namesp.patch @@ -1,18 +1,18 @@ -From ce57a45c1132b1595b43751f86f3be505107dae8 Mon Sep 17 00:00:00 2001 +From 59e028b4aeb70a9c9897e0ecfea79e455799937d Mon Sep 17 00:00:00 2001 From: tanyifeng Date: Thu, 21 Mar 2019 15:48:02 +0800 -Subject: [PATCH 069/131] lxc: killall processes if container shared pid +Subject: [PATCH 069/138] lxc: killall processes if container shared pid namespace Signed-off-by: tanyifeng Signed-off-by: LiFeng --- src/lxc/cgroups/cgfsng.c | 2 +- - src/lxc/start.c | 160 +++++++++++++++++++++++++++++++++++++++ + src/lxc/start.c | 160 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 161 insertions(+), 1 deletion(-) diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c -index e5132182..ab7ca35e 100644 +index e513218..ab7ca35 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -1056,7 +1056,7 @@ static int cgroup_rmdir(struct hierarchy **hierarchies, @@ -25,7 +25,7 @@ index e5132182..ab7ca35e 100644 } diff --git a/src/lxc/start.c b/src/lxc/start.c -index cad0d769..1c9eb0ab 100644 +index cad0d76..1c9eb0a 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -2494,6 +2494,162 @@ static void clean_resource_set_env(struct lxc_handler *handler) @@ -203,5 +203,5 @@ index cad0d769..1c9eb0ab 100644 char* oci_hook_args[1]; oci_hook_args[0] = alloca(strlen(handler->lxcpath) + 1); -- -2.23.0 +1.8.3.1 diff --git a/0070-lxc-signal-all-process-for-shared-container-when-con.patch b/0070-lxc-signal-all-process-for-shared-container-when-con.patch index c6b56124712e0e997b21b33b7aee9c9c30cd1c6e..8602874b92cd24ff246b66eb0260033a44fbe5c9 100644 --- a/0070-lxc-signal-all-process-for-shared-container-when-con.patch +++ b/0070-lxc-signal-all-process-for-shared-container-when-con.patch @@ -1,18 +1,18 @@ -From a372a2af0b3bcf8d1045d679cbbf8166ef3bb352 Mon Sep 17 00:00:00 2001 +From e54379b65d19ab25dbe69cf16d3180ae923bf27b Mon Sep 17 00:00:00 2001 From: tanyifeng Date: Thu, 21 Mar 2019 17:21:44 +0800 -Subject: [PATCH 070/131] lxc: signal all process for shared container when +Subject: [PATCH 070/138] lxc: signal all process for shared container when container init exited Signed-off-by: tanyifeng Signed-off-by: LiFeng --- src/lxc/cgroups/cgfsng.c | 2 +- - src/lxc/start.c | 332 ++++++++++++++++++++------------------- + src/lxc/start.c | 332 +++++++++++++++++++++++++---------------------- 2 files changed, 175 insertions(+), 159 deletions(-) diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c -index ab7ca35e..5ceb06b0 100644 +index ab7ca35..5ceb06b 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -1056,7 +1056,7 @@ static int cgroup_rmdir(struct hierarchy **hierarchies, @@ -25,7 +25,7 @@ index ab7ca35e..5ceb06b0 100644 } diff --git a/src/lxc/start.c b/src/lxc/start.c -index 1c9eb0ab..b14e46fd 100644 +index 1c9eb0a..b14e46f 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -941,6 +941,162 @@ out_close_maincmd_fd: @@ -396,5 +396,5 @@ index 1c9eb0ab..b14e46fd 100644 } -- -2.23.0 +1.8.3.1 diff --git a/0071-lxc-get-cgroup-path-according-to-cgroup-mountpoint.patch b/0071-lxc-get-cgroup-path-according-to-cgroup-mountpoint.patch index 841350ac1278f49c0670ab81c59caf2f53002577..b48472a5b2ab1f9220f6addf7d0b078e66fb1dbb 100644 --- a/0071-lxc-get-cgroup-path-according-to-cgroup-mountpoint.patch +++ b/0071-lxc-get-cgroup-path-according-to-cgroup-mountpoint.patch @@ -1,7 +1,7 @@ -From bbcab25bf3ade437e41728d6e5e2daf27bf637c3 Mon Sep 17 00:00:00 2001 +From 256621e2c0e0840a78dced3042b161d62dfa4e36 Mon Sep 17 00:00:00 2001 From: tanyifeng Date: Thu, 21 Mar 2019 22:05:09 +0800 -Subject: [PATCH 071/131] lxc: get cgroup path according to cgroup mountpoint +Subject: [PATCH 071/138] lxc: get cgroup path according to cgroup mountpoint Signed-off-by: tanyifeng Signed-off-by: LiFeng @@ -14,7 +14,7 @@ Signed-off-by: LiFeng 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c -index 5ceb06b0..62d58f9a 100644 +index 5ceb06b..62d58f9 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -1852,7 +1852,7 @@ __cgfsng_ops static bool cgfsng_unfreeze(struct cgroup_ops *ops) @@ -38,7 +38,7 @@ index 5ceb06b0..62d58f9a 100644 /* Given a cgroup path returned from lxc_cmd_get_cgroup_path, build a full path, diff --git a/src/lxc/cgroups/cgroup.h b/src/lxc/cgroups/cgroup.h -index b6116f68..edbb1e39 100644 +index b6116f6..edbb1e3 100644 --- a/src/lxc/cgroups/cgroup.h +++ b/src/lxc/cgroups/cgroup.h @@ -129,7 +129,7 @@ struct cgroup_ops { @@ -51,7 +51,7 @@ index b6116f68..edbb1e39 100644 int (*num_hierarchies)(struct cgroup_ops *ops); bool (*get_hierarchies)(struct cgroup_ops *ops, int n, char ***out); diff --git a/src/lxc/commands.c b/src/lxc/commands.c -index f0c95df7..c74b8c1f 100644 +index f0c95df..c74b8c1 100644 --- a/src/lxc/commands.c +++ b/src/lxc/commands.c @@ -481,9 +481,9 @@ static int lxc_cmd_get_cgroup_callback(int fd, struct lxc_cmd_req *req, @@ -76,7 +76,7 @@ index f0c95df7..c74b8c1f 100644 if (cgroup_ops->unfreeze(cgroup_ops)) diff --git a/src/lxc/criu.c b/src/lxc/criu.c -index bb97859b..5c779790 100644 +index bb97859..5c77979 100644 --- a/src/lxc/criu.c +++ b/src/lxc/criu.c @@ -332,7 +332,7 @@ static void exec_criu(struct cgroup_ops *cgroup_ops, struct lxc_conf *conf, @@ -89,7 +89,7 @@ index bb97859b..5c779790 100644 ERROR("failed to get cgroup path for %s", controllers[0]); goto err; diff --git a/src/lxc/start.c b/src/lxc/start.c -index b14e46fd..9243a6d5 100644 +index b14e46f..9243a6d 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -1032,17 +1032,15 @@ static int _recursive_read_cgroup_procs(const char *dirpath, pid_t **pids, size_ @@ -122,5 +122,5 @@ index b14e46fd..9243a6d5 100644 free(fullpath); return ret; -- -2.23.0 +1.8.3.1 diff --git a/0072-lxc-adapt-to-docker-18.09.patch b/0072-lxc-adapt-to-docker-18.09.patch index 5293a63d2eb2206b017a6a0a69f65e795520c158..08e1f0f10e28592b1b4db77d07b668af43c4acd9 100644 --- a/0072-lxc-adapt-to-docker-18.09.patch +++ b/0072-lxc-adapt-to-docker-18.09.patch @@ -1,7 +1,7 @@ -From 0aadbbe890ac6d558b037308a9522ef3bd5f5f17 Mon Sep 17 00:00:00 2001 +From 925d583b2ca80a2352ebe70ce3320b3085bb37a6 Mon Sep 17 00:00:00 2001 From: liuhao Date: Mon, 25 Mar 2019 18:03:23 +0800 -Subject: [PATCH 072/131] lxc: adapt to docker-18.09 +Subject: [PATCH 072/138] lxc: adapt to docker-18.09 1. adapt to docker-18.09 2. fix strlcpy bug @@ -14,7 +14,7 @@ Signed-off-by: LiFeng 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lxc/conf.c b/src/lxc/conf.c -index a6b97975..abfba042 100644 +index a6b9797..abfba04 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -4382,9 +4382,9 @@ static char* generate_json_str(const char *name, const char *lxcpath, const char @@ -40,7 +40,7 @@ index a6b97975..abfba042 100644 if (rc < 0 || rc >= size) { ERROR("Create json string failed"); diff --git a/src/lxc/start.c b/src/lxc/start.c -index 9243a6d5..2fca4e1a 100644 +index 9243a6d..2fca4e1 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -2186,7 +2186,7 @@ static int lxc_spawn(struct lxc_handler *handler) @@ -62,5 +62,5 @@ index 9243a6d5..2fca4e1a 100644 if (run_lxc_hooks(handler->name, "oci-poststop", handler->conf, oci_hook_args)) { ERROR("Failed to run lxc.hook.post-stop for container \"%s\".", handler->name); -- -2.23.0 +1.8.3.1 diff --git a/0073-lxc-support-set-additional-groups.patch b/0073-lxc-support-set-additional-groups.patch index 43ba34e48de6b60d1bc4676a4c6768000324fb6f..e94a05090cc63a0852fe247c129b9ed0965fb940 100644 --- a/0073-lxc-support-set-additional-groups.patch +++ b/0073-lxc-support-set-additional-groups.patch @@ -1,20 +1,20 @@ -From 4557f7475bb4000dfb19de4a5e85f1577f793955 Mon Sep 17 00:00:00 2001 +From 4cc2721541aad1ee3a446c3582eaa3c963161d09 Mon Sep 17 00:00:00 2001 From: tanyifeng Date: Mon, 25 Mar 2019 17:17:00 +0800 -Subject: [PATCH 073/131] lxc: support set additional groups +Subject: [PATCH 073/138] lxc: support set additional groups Signed-off-by: tanyifeng Signed-off-by: LiFeng --- - src/lxc/attach.c | 8 +++--- - src/lxc/conf.c | 12 +++++++++ + src/lxc/attach.c | 8 ++++--- + src/lxc/conf.c | 12 ++++++++++ src/lxc/conf.h | 3 +++ - src/lxc/confile.c | 66 ++++++++++++++++++++++++++++++++++++++++++++++- - src/lxc/start.c | 25 +++++++++++------- + src/lxc/confile.c | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- + src/lxc/start.c | 25 ++++++++++++--------- 5 files changed, 100 insertions(+), 14 deletions(-) diff --git a/src/lxc/attach.c b/src/lxc/attach.c -index c979c85a..618f2f1c 100644 +index c979c85..618f2f1 100644 --- a/src/lxc/attach.c +++ b/src/lxc/attach.c @@ -903,9 +903,6 @@ static int attach_child_main(struct attach_clone_payload *payload) @@ -40,7 +40,7 @@ index c979c85a..618f2f1c 100644 goto on_error; diff --git a/src/lxc/conf.c b/src/lxc/conf.c -index abfba042..58fc059c 100644 +index abfba04..58fc059 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -5184,10 +5184,21 @@ int lxc_clear_init_args(struct lxc_conf *lxc_conf) @@ -74,7 +74,7 @@ index abfba042..58fc059c 100644 lxc_clear_rootfs_masked_paths(conf); lxc_clear_rootfs_ro_paths(conf); diff --git a/src/lxc/conf.h b/src/lxc/conf.h -index 93cf15dd..11cf5960 100644 +index 93cf15d..11cf596 100644 --- a/src/lxc/conf.h +++ b/src/lxc/conf.h @@ -418,6 +418,8 @@ struct lxc_conf { @@ -95,7 +95,7 @@ index 93cf15dd..11cf5960 100644 int lxc_clear_rootfs_masked_paths(struct lxc_conf *c); int lxc_clear_rootfs_ro_paths(struct lxc_conf *c); diff --git a/src/lxc/confile.c b/src/lxc/confile.c -index 3940b328..60e6c462 100644 +index 3940b32..60e6c46 100644 --- a/src/lxc/confile.c +++ b/src/lxc/confile.c @@ -154,6 +154,7 @@ lxc_config_define(sysctl); @@ -200,7 +200,7 @@ index 3940b328..60e6c462 100644 static inline int clr_config_populate_device(const char *key, struct lxc_conf *c, void *data) diff --git a/src/lxc/start.c b/src/lxc/start.c -index 2fca4e1a..ae92c133 100644 +index 2fca4e1..ae92c13 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -1666,6 +1666,20 @@ static int do_start(void *data) @@ -243,5 +243,5 @@ index 2fca4e1a..ae92c133 100644 ret = lxc_ambient_caps_down(); if (ret < 0) { -- -2.23.0 +1.8.3.1 diff --git a/0074-lxc-only-add-valid-fd-to-mainloop.patch b/0074-lxc-only-add-valid-fd-to-mainloop.patch index 2555e967d3ba7e84896a4aa33bf7b7e3b76617da..252587c0f635ce233849f3f49ec1306c18855a0c 100644 --- a/0074-lxc-only-add-valid-fd-to-mainloop.patch +++ b/0074-lxc-only-add-valid-fd-to-mainloop.patch @@ -1,7 +1,7 @@ -From 0db36a212db180c7370adaddb427ec5d0a192486 Mon Sep 17 00:00:00 2001 +From 45c8390dc7f725365eabe1f9e63bad0e913a15d1 Mon Sep 17 00:00:00 2001 From: tanyifeng Date: Tue, 26 Mar 2019 16:11:13 +0800 -Subject: [PATCH 074/131] lxc: only add valid fd to mainloop +Subject: [PATCH 074/138] lxc: only add valid fd to mainloop Signed-off-by: tanyifeng Signed-off-by: LiFeng @@ -10,7 +10,7 @@ Signed-off-by: LiFeng 1 file changed, 3 insertions(+) diff --git a/src/lxc/mainloop.c b/src/lxc/mainloop.c -index b169aa6f..9603d1ee 100644 +index b169aa6..9603d1e 100644 --- a/src/lxc/mainloop.c +++ b/src/lxc/mainloop.c @@ -85,6 +85,9 @@ int lxc_mainloop_add_handler(struct lxc_epoll_descr *descr, int fd, @@ -24,5 +24,5 @@ index b169aa6f..9603d1ee 100644 if (!handler) return -1; -- -2.23.0 +1.8.3.1 diff --git a/0075-lxc-add-timeout-for-attach.patch b/0075-lxc-add-timeout-for-attach.patch index f1189cbee0799b0576cc033bbae7be07f1c7f6c4..2c82acbaefe4f74e1ab326b65956e24c706eb841 100644 --- a/0075-lxc-add-timeout-for-attach.patch +++ b/0075-lxc-add-timeout-for-attach.patch @@ -1,22 +1,22 @@ -From 7ac4cd6176a273a8e7cd146fd189dc2e07d582c8 Mon Sep 17 00:00:00 2001 +From 070fe7892e591a7c5836511dd2d0b9e969a18798 Mon Sep 17 00:00:00 2001 From: tanyifeng Date: Wed, 3 Apr 2019 19:54:36 +0800 -Subject: [PATCH 075/131] lxc: add timeout for attach +Subject: [PATCH 075/138] lxc: add timeout for attach Signed-off-by: wujing Signed-off-by: LiFeng --- - src/lxc/attach.c | 79 ++++++++++++++++++++++++++++++++++++++ + src/lxc/attach.c | 79 ++++++++++++++++++++++++++++++++++++++++++++++ src/lxc/attach_options.h | 1 + - src/lxc/tools/arguments.h | 4 ++ - src/lxc/tools/lxc_attach.c | 11 ++++++ - src/lxc/tools/lxc_start.c | 13 +------ - src/lxc/utils.c | 13 +++++++ - src/lxc/utils.h | 2 + + src/lxc/tools/arguments.h | 4 +++ + src/lxc/tools/lxc_attach.c | 11 +++++++ + src/lxc/tools/lxc_start.c | 13 +------- + src/lxc/utils.c | 13 ++++++++ + src/lxc/utils.h | 2 ++ 7 files changed, 111 insertions(+), 12 deletions(-) diff --git a/src/lxc/attach.c b/src/lxc/attach.c -index 618f2f1c..79049c3d 100644 +index 618f2f1..79049c3 100644 --- a/src/lxc/attach.c +++ b/src/lxc/attach.c @@ -69,6 +69,20 @@ @@ -127,7 +127,7 @@ index 618f2f1c..79049c3d 100644 if (options->attach_flags & LXC_ATTACH_TERMINAL) lxc_mainloop_close(&descr); diff --git a/src/lxc/attach_options.h b/src/lxc/attach_options.h -index 71c1739d..5e279baf 100644 +index 71c1739..5e279ba 100644 --- a/src/lxc/attach_options.h +++ b/src/lxc/attach_options.h @@ -137,6 +137,7 @@ typedef struct lxc_attach_options_t { @@ -139,7 +139,7 @@ index 71c1739d..5e279baf 100644 /*! Default attach options to use */ diff --git a/src/lxc/tools/arguments.h b/src/lxc/tools/arguments.h -index d03f8a42..2fc90ad9 100644 +index d03f8a4..2fc90ad 100644 --- a/src/lxc/tools/arguments.h +++ b/src/lxc/tools/arguments.h @@ -69,6 +69,9 @@ struct lxc_arguments { @@ -161,7 +161,7 @@ index d03f8a42..2fc90ad9 100644 /* isulad add end*/ diff --git a/src/lxc/tools/lxc_attach.c b/src/lxc/tools/lxc_attach.c -index 674050de..2861ef4d 100644 +index 674050d..2861ef4 100644 --- a/src/lxc/tools/lxc_attach.c +++ b/src/lxc/tools/lxc_attach.c @@ -62,6 +62,7 @@ static char **extra_env; @@ -211,7 +211,7 @@ index 674050de..2861ef4d 100644 if (my_args.argc > 0) { command.program = my_args.argv[0]; diff --git a/src/lxc/tools/lxc_start.c b/src/lxc/tools/lxc_start.c -index 183fafcb..af63f581 100644 +index 183fafc..af63f58 100644 --- a/src/lxc/tools/lxc_start.c +++ b/src/lxc/tools/lxc_start.c @@ -49,6 +49,7 @@ @@ -242,7 +242,7 @@ index 183fafcb..af63f581 100644 { switch (c) { diff --git a/src/lxc/utils.c b/src/lxc/utils.c -index 480e6d0a..69eb3e52 100644 +index 480e6d0..69eb3e5 100644 --- a/src/lxc/utils.c +++ b/src/lxc/utils.c @@ -2069,3 +2069,16 @@ out: @@ -263,7 +263,7 @@ index 480e6d0a..69eb3e52 100644 +} + diff --git a/src/lxc/utils.h b/src/lxc/utils.h -index 73ffdd97..20407af8 100644 +index 73ffdd9..20407af 100644 --- a/src/lxc/utils.h +++ b/src/lxc/utils.h @@ -322,4 +322,6 @@ extern void lxc_write_error_message(int errfd, const char *format, ...); @@ -274,5 +274,5 @@ index 73ffdd97..20407af8 100644 + #endif /* __LXC_UTILS_H */ -- -2.23.0 +1.8.3.1 diff --git a/0076-lxc-delete-unused-variable.patch b/0076-lxc-delete-unused-variable.patch index 0cecd0b96c5bef38b5c60708ca6acd923bc0b5e7..405b6bbd7f6eac336749bf3bcbef09ac0b43dbc4 100644 --- a/0076-lxc-delete-unused-variable.patch +++ b/0076-lxc-delete-unused-variable.patch @@ -1,7 +1,7 @@ -From 1c9ffd2e51f0c525125103b172f2b03fc6a9aa83 Mon Sep 17 00:00:00 2001 +From 2321335b3482472b0aad5b97ac981ed876e145ba Mon Sep 17 00:00:00 2001 From: tanyifeng Date: Thu, 4 Apr 2019 11:19:48 +0800 -Subject: [PATCH 076/131] lxc: delete unused variable +Subject: [PATCH 076/138] lxc: delete unused variable Signed-off-by: wujing Signed-off-by: LiFeng @@ -10,7 +10,7 @@ Signed-off-by: LiFeng 1 file changed, 1 deletion(-) diff --git a/src/lxc/tools/lxc_attach.c b/src/lxc/tools/lxc_attach.c -index 2861ef4d..440c0bcb 100644 +index 2861ef4..440c0bc 100644 --- a/src/lxc/tools/lxc_attach.c +++ b/src/lxc/tools/lxc_attach.c @@ -62,7 +62,6 @@ static char **extra_env; @@ -22,5 +22,5 @@ index 2861ef4d..440c0bcb 100644 static const struct option my_longopts[] = { {"elevated-privileges", optional_argument, 0, 'e'}, -- -2.23.0 +1.8.3.1 diff --git a/0077-lxc-set-negative-files.limit-to-max-and-fix-bug-of-s.patch b/0077-lxc-set-negative-files.limit-to-max-and-fix-bug-of-s.patch index 02e833e4c0e43a378395f68307639c7f88c60524..0f845cd0c502f84a12ff0953851f922cdade50c4 100644 --- a/0077-lxc-set-negative-files.limit-to-max-and-fix-bug-of-s.patch +++ b/0077-lxc-set-negative-files.limit-to-max-and-fix-bug-of-s.patch @@ -1,7 +1,7 @@ -From 885080c17444f473d65b9f9298eb0042b65d1421 Mon Sep 17 00:00:00 2001 +From 121263ea5ba1302e259320c1a4497f2a549ef4db Mon Sep 17 00:00:00 2001 From: tanyifeng Date: Tue, 2 Apr 2019 23:59:20 -0400 -Subject: [PATCH 077/131] lxc: set negative files.limit to max and fix bug of +Subject: [PATCH 077/138] lxc: set negative files.limit to max and fix bug of setting homedir Signed-off-by: tanyifeng @@ -13,7 +13,7 @@ Signed-off-by: LiFeng 3 files changed, 37 insertions(+), 16 deletions(-) diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c -index 62d58f9a..cc087375 100644 +index 62d58f9..cc08737 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -2259,19 +2259,30 @@ static bool __cg_legacy_setup_limits(struct cgroup_ops *ops, @@ -52,7 +52,7 @@ index 62d58f9a..cc087375 100644 if (strcmp(cg->subsystem, "cpu.shares") == 0) { if (cg_legacy_get_data(ops, cg->subsystem, value, sizeof(value)) < 0) { diff --git a/src/lxc/storage/storage.c b/src/lxc/storage/storage.c -index 88ed7884..fa797628 100644 +index 88ed788..fa79762 100644 --- a/src/lxc/storage/storage.c +++ b/src/lxc/storage/storage.c @@ -611,9 +611,8 @@ bool storage_destroy(struct lxc_conf *conf) @@ -68,7 +68,7 @@ index 88ed7884..fa797628 100644 destroy_rv = r->ops->destroy(r); diff --git a/src/lxc/utils.c b/src/lxc/utils.c -index 69eb3e52..7b82d060 100644 +index 69eb3e5..7b82d06 100644 --- a/src/lxc/utils.c +++ b/src/lxc/utils.c @@ -1873,20 +1873,31 @@ int lxc_setup_keyring(void) @@ -113,5 +113,5 @@ index 69eb3e52..7b82d060 100644 if (setenv("HOME", homedir, 0) < 0) { SYSERROR("Unable to set env 'HOME'"); -- -2.23.0 +1.8.3.1 diff --git a/0078-Run-pre-start-hook-before-chroot.patch b/0078-Run-pre-start-hook-before-chroot.patch index a2130933cfb746888f2ab3272d870e7206f71064..74d8382b9190c29fe67efb982c7f249d3455d36b 100644 --- a/0078-Run-pre-start-hook-before-chroot.patch +++ b/0078-Run-pre-start-hook-before-chroot.patch @@ -1,7 +1,7 @@ -From 59ee57ce2c6b7d8b3054a2c52657b6667faf868c Mon Sep 17 00:00:00 2001 +From f4802de0f33c70fa299d5fb8f73c179eb457a7e4 Mon Sep 17 00:00:00 2001 From: LiFeng Date: Wed, 3 Apr 2019 23:36:04 -0400 -Subject: [PATCH 078/131] Run pre-start hook before chroot +Subject: [PATCH 078/138] Run pre-start hook before chroot Signed-off-by: LiFeng --- @@ -11,7 +11,7 @@ Signed-off-by: LiFeng 3 files changed, 15 insertions(+) diff --git a/src/lxc/conf.c b/src/lxc/conf.c -index 58fc059c..a9421c5f 100644 +index 58fc059..a9421c5 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -82,6 +82,7 @@ @@ -36,7 +36,7 @@ index 58fc059c..a9421c5f 100644 if (ret < 0) { ERROR("Failed to pivot root into rootfs"); diff --git a/src/lxc/start.c b/src/lxc/start.c -index ae92c133..10f922d0 100644 +index ae92c13..10f922d 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -2204,6 +2204,12 @@ static int lxc_spawn(struct lxc_handler *handler) @@ -53,7 +53,7 @@ index ae92c133..10f922d0 100644 * or return an error. (The child will never return * LXC_SYNC_READY_START+1. It will either close the sync pipe, causing diff --git a/src/lxc/sync.h b/src/lxc/sync.h -index 5c0fb343..787911dd 100644 +index 5c0fb34..787911d 100644 --- a/src/lxc/sync.h +++ b/src/lxc/sync.h @@ -31,6 +31,8 @@ enum { @@ -66,5 +66,5 @@ index 5c0fb343..787911dd 100644 LXC_SYNC_READY_START, LXC_SYNC_RESTART, -- -2.23.0 +1.8.3.1 diff --git a/0079-inherid-env-from-parent-in-oci-hooks.patch b/0079-inherid-env-from-parent-in-oci-hooks.patch index 12ae9526129af4f958b47f27d1f522ec444b9f60..83d45deed6da471fe9e081ec2992e9a506a249d6 100644 --- a/0079-inherid-env-from-parent-in-oci-hooks.patch +++ b/0079-inherid-env-from-parent-in-oci-hooks.patch @@ -1,7 +1,7 @@ -From b7c3e38d912794fcbba5a3fc4ed185adff58c72d Mon Sep 17 00:00:00 2001 +From 68184e1b144b0ce9bb39534d712f022773819173 Mon Sep 17 00:00:00 2001 From: liuhao Date: Thu, 4 Apr 2019 17:21:56 +0800 -Subject: [PATCH 079/131] inherid env from parent in oci hooks +Subject: [PATCH 079/138] inherid env from parent in oci hooks env: LD_LIBRAY_PAHT and PATH @@ -12,7 +12,7 @@ Signed-off-by: LiFeng 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lxc/conf.c b/src/lxc/conf.c -index a9421c5f..20eb8408 100644 +index a9421c5..20eb840 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -4420,7 +4420,7 @@ static char **merge_ocihook_env(char **oldenvs, size_t env_len, size_t *merge_en @@ -25,5 +25,5 @@ index a9421c5f..20eb8408 100644 char *lxcenv_buf; -- -2.23.0 +1.8.3.1 diff --git a/0080-lxc-fix-compile-error.patch b/0080-lxc-fix-compile-error.patch index a7fe60f56c94ca3774047a3bb285b7a35ad1b696..e9d6f6abb1a91e3b0a2317fa04dd384c1116a06c 100644 --- a/0080-lxc-fix-compile-error.patch +++ b/0080-lxc-fix-compile-error.patch @@ -1,7 +1,7 @@ -From b088aaa97b760914234c8a16d89cea86ddb20cbd Mon Sep 17 00:00:00 2001 +From fd14c1b679220e7b4554afcca3de7d7cd9588997 Mon Sep 17 00:00:00 2001 From: tanyifeng Date: Mon, 8 Apr 2019 08:29:46 -0400 -Subject: [PATCH 080/131] lxc: fix compile error +Subject: [PATCH 080/138] lxc: fix compile error Signed-off-by: tanyifeng Signed-off-by: LiFeng @@ -10,7 +10,7 @@ Signed-off-by: LiFeng 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/lxc/utils.c b/src/lxc/utils.c -index 7b82d060..fd6075f8 100644 +index 7b82d06..fd6075f 100644 --- a/src/lxc/utils.c +++ b/src/lxc/utils.c @@ -1874,7 +1874,6 @@ int lxc_setup_keyring(void) @@ -31,5 +31,5 @@ index 7b82d060..fd6075f8 100644 } -- -2.23.0 +1.8.3.1 diff --git a/0081-lxc-Change-the-range-of-attach-timeout.patch b/0081-lxc-Change-the-range-of-attach-timeout.patch index 20f053c4572c03185b92be7f20b141f6c06795c3..3fc854390215c16f22a2138fba7349bdef4b69b0 100644 --- a/0081-lxc-Change-the-range-of-attach-timeout.patch +++ b/0081-lxc-Change-the-range-of-attach-timeout.patch @@ -1,7 +1,7 @@ -From 567715dd8df8468d292da02720b210e2972e6f8e Mon Sep 17 00:00:00 2001 +From 1c0c1b59116fde86d5bbaff143c1678a0c7414b0 Mon Sep 17 00:00:00 2001 From: tanyifeng Date: Mon, 8 Apr 2019 16:42:43 +0800 -Subject: [PATCH 081/131] lxc: Change the range of attach timeout +Subject: [PATCH 081/138] lxc: Change the range of attach timeout Signed-off-by: wujing Signed-off-by: LiFeng @@ -13,7 +13,7 @@ Signed-off-by: LiFeng 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lxc/attach.c b/src/lxc/attach.c -index 79049c3d..6480eb99 100644 +index 79049c3..6480eb9 100644 --- a/src/lxc/attach.c +++ b/src/lxc/attach.c @@ -78,7 +78,7 @@ typedef enum { @@ -35,7 +35,7 @@ index 79049c3d..6480eb99 100644 int ret = 0; pthread_t ptid; diff --git a/src/lxc/attach_options.h b/src/lxc/attach_options.h -index 5e279baf..9744a2e4 100644 +index 5e279ba..9744a2e 100644 --- a/src/lxc/attach_options.h +++ b/src/lxc/attach_options.h @@ -137,7 +137,7 @@ typedef struct lxc_attach_options_t { @@ -48,7 +48,7 @@ index 5e279baf..9744a2e4 100644 /*! Default attach options to use */ diff --git a/src/lxc/tools/arguments.h b/src/lxc/tools/arguments.h -index 2fc90ad9..de02aeb0 100644 +index 2fc90ad..de02aeb 100644 --- a/src/lxc/tools/arguments.h +++ b/src/lxc/tools/arguments.h @@ -70,7 +70,7 @@ struct lxc_arguments { @@ -61,7 +61,7 @@ index 2fc90ad9..de02aeb0 100644 /* for lxc-console */ unsigned int ttynum; diff --git a/src/lxc/tools/lxc_attach.c b/src/lxc/tools/lxc_attach.c -index 440c0bcb..854b3a2c 100644 +index 440c0bc..854b3a2 100644 --- a/src/lxc/tools/lxc_attach.c +++ b/src/lxc/tools/lxc_attach.c @@ -212,7 +212,7 @@ static int my_parser(struct lxc_arguments *args, int c, char *arg) @@ -74,5 +74,5 @@ index 440c0bcb..854b3a2c 100644 } -- -2.23.0 +1.8.3.1 diff --git a/0082-lxc-fix-memory-leak-cause-by-setenv.patch b/0082-lxc-fix-memory-leak-cause-by-setenv.patch index dc0b68c624b6a6495162e09db7703aae4064f94e..61686f28f3e66bcb92da13c8a7c02784fb7bb27b 100644 --- a/0082-lxc-fix-memory-leak-cause-by-setenv.patch +++ b/0082-lxc-fix-memory-leak-cause-by-setenv.patch @@ -1,7 +1,7 @@ -From 89a39ea2597bb5e6f3c4cad04828337c717ea30d Mon Sep 17 00:00:00 2001 +From 0ba955160234c68f8db801111618551e6303627b Mon Sep 17 00:00:00 2001 From: liuhao Date: Thu, 11 Apr 2019 15:27:31 +0800 -Subject: [PATCH 082/131] lxc: fix memory leak cause by setenv +Subject: [PATCH 082/138] lxc: fix memory leak cause by setenv isulad will call do_lxcapi_clean_resource(), so setenv at here, will change env of isulad. @@ -9,11 +9,11 @@ change env of isulad. Signed-off-by: liuhao Signed-off-by: LiFeng --- - src/lxc/start.c | 107 ++++++++++++++++++++++++++++++++++-------------- + src/lxc/start.c | 107 ++++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 76 insertions(+), 31 deletions(-) diff --git a/src/lxc/start.c b/src/lxc/start.c -index 10f922d0..87e07d33 100644 +index 10f922d..87e07d3 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -2635,44 +2635,85 @@ on_error: @@ -146,5 +146,5 @@ index 10f922d0..87e07d33 100644 if (handler->conf->ns_share[LXC_NS_PID] != NULL) { signal_all_processes(handler); -- -2.23.0 +1.8.3.1 diff --git a/0083-lxc-free-lxc-handler.patch b/0083-lxc-free-lxc-handler.patch index 824c629f6323b23319b46a17a4905de71c464c5b..9a192b93e647062673d9bc58f465c3f2b8a54bd3 100644 --- a/0083-lxc-free-lxc-handler.patch +++ b/0083-lxc-free-lxc-handler.patch @@ -1,7 +1,7 @@ -From f853d85dfb6625f1e97a9b908377886af993e327 Mon Sep 17 00:00:00 2001 +From 3b253a4a69bc3e239244f7ed0aaab7d8d2bf4187 Mon Sep 17 00:00:00 2001 From: liuhao Date: Thu, 11 Apr 2019 20:34:51 +0800 -Subject: [PATCH 083/131] lxc: free lxc-handler +Subject: [PATCH 083/138] lxc: free lxc-handler free handler if failed @@ -12,7 +12,7 @@ Signed-off-by: LiFeng 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lxc/start.c b/src/lxc/start.c -index 87e07d33..f1cd7fa3 100644 +index 87e07d3..f1cd7fa 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -695,6 +695,10 @@ void lxc_zero_handler(struct lxc_handler *handler) @@ -37,5 +37,5 @@ index 87e07d33..f1cd7fa3 100644 } -- -2.23.0 +1.8.3.1 diff --git a/0084-lxc-memory-leak-of-lxc_grow_array.patch b/0084-lxc-memory-leak-of-lxc_grow_array.patch index 84de9ca2d36c2be75e86376f55306816ee9970db..eaa3f47d4c013524710a61e403a8c770ec0cd08e 100644 --- a/0084-lxc-memory-leak-of-lxc_grow_array.patch +++ b/0084-lxc-memory-leak-of-lxc_grow_array.patch @@ -1,7 +1,7 @@ -From 2f31e50aa14fccd46387e40c312ea59c96dbc678 Mon Sep 17 00:00:00 2001 +From 1cdc72bef5e05efbbd29b92212deeb16e6fe3457 Mon Sep 17 00:00:00 2001 From: liuhao Date: Thu, 11 Apr 2019 22:36:42 +0800 -Subject: [PATCH 084/131] lxc: memory leak of lxc_grow_array +Subject: [PATCH 084/138] lxc: memory leak of lxc_grow_array fix memory leak of lxc_grow_array @@ -12,7 +12,7 @@ Signed-off-by: LiFeng 1 file changed, 1 insertion(+) diff --git a/src/lxc/string_utils.c b/src/lxc/string_utils.c -index 0d7538c1..31c43407 100644 +index 0d7538c..31c4340 100644 --- a/src/lxc/string_utils.c +++ b/src/lxc/string_utils.c @@ -523,6 +523,7 @@ int lxc_grow_array(void ***array, size_t *capacity, size_t new_size, size_t capa @@ -24,5 +24,5 @@ index 0d7538c1..31c43407 100644 *capacity = 0; } -- -2.23.0 +1.8.3.1 diff --git a/0085-lxc-update-json-file-from-isulad.patch b/0085-lxc-update-json-file-from-isulad.patch index 497295e37b16c05d8b0fa63ee94a4cfd001e28ae..d4217bb83edc637e7372bc3c29ab645204b3ef36 100644 --- a/0085-lxc-update-json-file-from-isulad.patch +++ b/0085-lxc-update-json-file-from-isulad.patch @@ -1,21 +1,21 @@ -From 4b5e1b21b30deeb9744066bda231c3bdd1b1fdb6 Mon Sep 17 00:00:00 2001 +From a8fbe4a4242932aec877ac051bec80ee15a9763b Mon Sep 17 00:00:00 2001 From: tanyifeng Date: Fri, 12 Apr 2019 06:06:12 -0400 -Subject: [PATCH 085/131] lxc: update json file from isulad +Subject: [PATCH 085/138] lxc: update json file from isulad Signed-off-by: tanyifeng Signed-off-by: LiFeng --- - src/lxc/json/defs.c | 38 ++++---- - src/lxc/json/json_common.c | 160 +++++++++++++++---------------- + src/lxc/json/defs.c | 38 +++++----- + src/lxc/json/json_common.c | 160 +++++++++++++++++++-------------------- src/lxc/json/json_common.h | 2 +- - src/lxc/json/logger_json_file.c | 50 +++++----- + src/lxc/json/logger_json_file.c | 50 ++++++------ src/lxc/json/oci_runtime_hooks.c | 3 +- - src/lxc/json/oci_runtime_spec.c | 32 +++---- + src/lxc/json/oci_runtime_spec.c | 32 ++++---- 6 files changed, 142 insertions(+), 143 deletions(-) diff --git a/src/lxc/json/defs.c b/src/lxc/json/defs.c -index 38df2f7a..e7d9a092 100644 +index 38df2f7..e7d9a09 100644 --- a/src/lxc/json/defs.c +++ b/src/lxc/json/defs.c @@ -15,20 +15,20 @@ defs_hook *make_defs_hook(yajl_val tree, struct parser_context *ctx, parser_erro @@ -158,7 +158,7 @@ index 38df2f7a..e7d9a092 100644 } stat = reformat_int(g, num); diff --git a/src/lxc/json/json_common.c b/src/lxc/json/json_common.c -index e339ab3a..54b7b610 100755 +index e339ab3..54b7b61 100755 --- a/src/lxc/json/json_common.c +++ b/src/lxc/json/json_common.c @@ -111,7 +111,7 @@ int common_safe_double(const char *numstr, double *converted) { @@ -763,7 +763,7 @@ index e339ab3a..54b7b610 100755 } diff --git a/src/lxc/json/json_common.h b/src/lxc/json/json_common.h -index eb8281c7..218a8371 100755 +index eb8281c..218a837 100755 --- a/src/lxc/json/json_common.h +++ b/src/lxc/json/json_common.h @@ -27,7 +27,7 @@ extern "C" { @@ -776,7 +776,7 @@ index eb8281c7..218a8371 100755 *(err) = safe_strdup("error allocating memory"); \ } \ diff --git a/src/lxc/json/logger_json_file.c b/src/lxc/json/logger_json_file.c -index 4d781032..6433b042 100644 +index 4d78103..6433b04 100644 --- a/src/lxc/json/logger_json_file.c +++ b/src/lxc/json/logger_json_file.c @@ -15,32 +15,32 @@ logger_json_file *make_logger_json_file(yajl_val tree, struct parser_context *ct @@ -955,7 +955,7 @@ index 4d781032..6433b042 100644 goto free_out; } diff --git a/src/lxc/json/oci_runtime_hooks.c b/src/lxc/json/oci_runtime_hooks.c -index 3aa134ef..43ff8d7f 100644 +index 3aa134e..43ff8d7 100644 --- a/src/lxc/json/oci_runtime_hooks.c +++ b/src/lxc/json/oci_runtime_hooks.c @@ -46,8 +46,7 @@ oci_runtime_spec_hooks *oci_runtime_spec_hooks_parse_file(const char *filename, @@ -969,7 +969,7 @@ index 3aa134ef..43ff8d7f 100644 return ptr; } diff --git a/src/lxc/json/oci_runtime_spec.c b/src/lxc/json/oci_runtime_spec.c -index 1f6073c9..4ccb6358 100644 +index 1f6073c..4ccb635 100644 --- a/src/lxc/json/oci_runtime_spec.c +++ b/src/lxc/json/oci_runtime_spec.c @@ -15,7 +15,7 @@ oci_runtime_spec_hooks *make_oci_runtime_spec_hooks(yajl_val tree, struct parser @@ -1085,5 +1085,5 @@ index 1f6073c9..4ccb6358 100644 } if (!len && !(ctx->options & GEN_OPTIONS_SIMPLIFY)) -- -2.23.0 +1.8.3.1 diff --git a/0086-confile-add-support-systemd.patch b/0086-confile-add-support-systemd.patch index de4479097cef91b9463c6851b0149a260dffd064..3dbb4ce4900c3ae8fed3ec35aa9e53526b4fa6f1 100644 --- a/0086-confile-add-support-systemd.patch +++ b/0086-confile-add-support-systemd.patch @@ -1,7 +1,7 @@ -From 994b69da275c77f060e9247f9fdf401a357af280 Mon Sep 17 00:00:00 2001 +From a717837708d91574471645822071d349e60d0678 Mon Sep 17 00:00:00 2001 From: tanyifeng Date: Sat, 20 Apr 2019 22:40:18 +0800 -Subject: [PATCH 086/131] confile: add support systemd +Subject: [PATCH 086/138] confile: add support systemd lxc.isulad.systemd=true remount systemd cgroup path to rw @@ -15,7 +15,7 @@ Signed-off-by: LiFeng 4 files changed, 48 insertions(+) diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c -index cc087375..b1f56b07 100644 +index cc08737..b1f56b0 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -1567,6 +1567,7 @@ __cgfsng_ops static bool cgfsng_mount(struct cgroup_ops *ops, @@ -53,7 +53,7 @@ index cc087375..b1f56b07 100644 return retval; } diff --git a/src/lxc/conf.c b/src/lxc/conf.c -index 20eb8408..8cdccf13 100644 +index 20eb840..8cdccf1 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -5320,6 +5320,7 @@ void lxc_conf_free(struct lxc_conf *conf) @@ -65,7 +65,7 @@ index 20eb8408..8cdccf13 100644 /* isulad add end */ free(conf); diff --git a/src/lxc/conf.h b/src/lxc/conf.h -index 11cf5960..fb3c1560 100644 +index 11cf596..fb3c156 100644 --- a/src/lxc/conf.h +++ b/src/lxc/conf.h @@ -430,6 +430,7 @@ struct lxc_conf { @@ -77,7 +77,7 @@ index 11cf5960..fb3c1560 100644 }; diff --git a/src/lxc/confile.c b/src/lxc/confile.c -index 60e6c462..93936ccd 100644 +index 60e6c46..93936cc 100644 --- a/src/lxc/confile.c +++ b/src/lxc/confile.c @@ -157,6 +157,7 @@ lxc_config_define(init_args); @@ -146,5 +146,5 @@ index 60e6c462..93936ccd 100644 struct lxc_conf *c, void *data) { -- -2.23.0 +1.8.3.1 diff --git a/0087-lxc-adapt-to-spec-of-oci-hook.patch b/0087-lxc-adapt-to-spec-of-oci-hook.patch index 2161fd1d7860cd6480a0cf58a1e631bed8edad8b..7b71fb22d417abffb700df14229e7f79472b5e75 100644 --- a/0087-lxc-adapt-to-spec-of-oci-hook.patch +++ b/0087-lxc-adapt-to-spec-of-oci-hook.patch @@ -1,7 +1,7 @@ -From e58415ad4f1e118a54c5d773e9873f65aa4f44c9 Mon Sep 17 00:00:00 2001 +From 65d32efd1e3165badbfc731a0750e6e895be4fb7 Mon Sep 17 00:00:00 2001 From: liuhao Date: Wed, 24 Apr 2019 22:22:55 +0800 -Subject: [PATCH 087/131] lxc: adapt to spec of oci hook +Subject: [PATCH 087/138] lxc: adapt to spec of oci hook poststart failed do not cause run failed @@ -12,7 +12,7 @@ Signed-off-by: LiFeng 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/lxc/conf.c b/src/lxc/conf.c -index 8cdccf13..a1d77ebc 100644 +index 8cdccf1..a1d77eb 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -4782,6 +4782,7 @@ static int run_oci_hooks(const char *name, const char *lxcpath, struct lxc_conf @@ -37,5 +37,5 @@ index 8cdccf13..a1d77ebc 100644 break; case OCI_HOOK_POSTSTOP: -- -2.23.0 +1.8.3.1 diff --git a/0088-fix-lxc-build-error.patch b/0088-fix-lxc-build-error.patch index 041f8bb8098ef4ab444e67e5af06413f471eeb15..577f36dd4f9b7e41a9bcefd07b4f9fc308a97e45 100644 --- a/0088-fix-lxc-build-error.patch +++ b/0088-fix-lxc-build-error.patch @@ -1,7 +1,7 @@ -From 845d28355b85578a0ebc0d8aff3bb405d63ff8a3 Mon Sep 17 00:00:00 2001 +From 0c0588bd00878eaf2add137bb29bf225eaa8d904 Mon Sep 17 00:00:00 2001 From: liuhao Date: Thu, 25 Apr 2019 10:12:16 +0800 -Subject: [PATCH 088/131] fix lxc build error +Subject: [PATCH 088/138] fix lxc build error cause by invalid print format @@ -12,7 +12,7 @@ Signed-off-by: LiFeng 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lxc/conf.c b/src/lxc/conf.c -index a1d77ebc..14d5d807 100644 +index a1d77eb..14d5d80 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -4814,7 +4814,7 @@ static int run_oci_hooks(const char *name, const char *lxcpath, struct lxc_conf @@ -25,5 +25,5 @@ index a1d77ebc..14d5d807 100644 break; case OCI_HOOK_POSTSTOP: -- -2.23.0 +1.8.3.1 diff --git a/0089-lxc-add-get-container-processes-pids-func.patch b/0089-lxc-add-get-container-processes-pids-func.patch index 789476048c76b5dfb04bb5859d59b6615611531f..3c3e6f9df792e171af659dddd183fb91f746dbd5 100644 --- a/0089-lxc-add-get-container-processes-pids-func.patch +++ b/0089-lxc-add-get-container-processes-pids-func.patch @@ -1,18 +1,18 @@ -From bdc424289b3ad959bf55af176f5466b56a447e09 Mon Sep 17 00:00:00 2001 +From 4b7a4621c0dfd5545c4b2e77a6c805b0d38d3d38 Mon Sep 17 00:00:00 2001 From: maoweiyong Date: Tue, 23 Apr 2019 12:12:55 +0800 -Subject: [PATCH 089/131] lxc:add get container processes pids func +Subject: [PATCH 089/138] lxc:add get container processes pids func Signed-off-by: maoweiyong --- - src/lxc/lxccontainer.c | 18 ++++++++++ - src/lxc/lxccontainer.h | 11 ++++++ - src/lxc/start.c | 76 ++++++++++++++++++++++++++++++++++++++++++ + src/lxc/lxccontainer.c | 18 ++++++++++++ + src/lxc/lxccontainer.h | 11 ++++++++ + src/lxc/start.c | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++ src/lxc/start.h | 2 ++ 4 files changed, 107 insertions(+) diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c -index 8a3724c6..fa13e522 100644 +index 8a3724c..fa13e52 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -5212,6 +5212,23 @@ static bool do_lxcapi_clean_container_resource(struct lxc_container *c, pid_t pi @@ -48,7 +48,7 @@ index 8a3724c6..fa13e522 100644 return c; diff --git a/src/lxc/lxccontainer.h b/src/lxc/lxccontainer.h -index c3368e4f..608f8158 100644 +index c3368e4..608f815 100644 --- a/src/lxc/lxccontainer.h +++ b/src/lxc/lxccontainer.h @@ -947,6 +947,17 @@ struct lxc_container { @@ -70,7 +70,7 @@ index c3368e4f..608f8158 100644 /*! diff --git a/src/lxc/start.c b/src/lxc/start.c -index f1cd7fa3..2b0d43ea 100644 +index f1cd7fa..2b0d43e 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -2638,6 +2638,55 @@ on_error: @@ -161,7 +161,7 @@ index f1cd7fa3..2b0d43ea 100644 +} + diff --git a/src/lxc/start.h b/src/lxc/start.h -index 02989919..20e667c1 100644 +index 0298991..20e667c 100644 --- a/src/lxc/start.h +++ b/src/lxc/start.h @@ -188,5 +188,7 @@ extern int resolve_clone_flags(struct lxc_handler *handler); @@ -173,5 +173,5 @@ index 02989919..20e667c1 100644 #endif -- -2.23.0 +1.8.3.1 diff --git a/0090-lxc-remove-unused-variable.patch b/0090-lxc-remove-unused-variable.patch index c21ffc303b8c2b9123fc4dc137bb272423fcf061..61562cfb736f19aa62b91d97183781b1484a9d94 100644 --- a/0090-lxc-remove-unused-variable.patch +++ b/0090-lxc-remove-unused-variable.patch @@ -1,7 +1,7 @@ -From 720b4a937fcd74bfdd1bd07e68b80eaa566bd6ee Mon Sep 17 00:00:00 2001 +From 9e36bb4d725edd77b84e2d9f2d0e07db69d6af33 Mon Sep 17 00:00:00 2001 From: maoweiyong Date: Thu, 25 Apr 2019 21:21:12 +0800 -Subject: [PATCH 090/131] lxc: remove unused variable +Subject: [PATCH 090/138] lxc: remove unused variable Signed-off-by: maoweiyong --- @@ -9,7 +9,7 @@ Signed-off-by: maoweiyong 1 file changed, 2 deletions(-) diff --git a/src/lxc/start.c b/src/lxc/start.c -index 2b0d43ea..3657d4eb 100644 +index 2b0d43e..3657d4e 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -2824,8 +2824,6 @@ int do_lxcapi_get_pids(char *name, char *lxcpath, struct lxc_conf *conf, pid_t * @@ -22,5 +22,5 @@ index 2b0d43ea..3657d4eb 100644 handler = lxc_init_pids_handler(name, lxcpath, conf); -- -2.23.0 +1.8.3.1 diff --git a/0091-lxc-support-namespaced-kernel-params-can-be-changed-.patch b/0091-lxc-support-namespaced-kernel-params-can-be-changed-.patch index fb8ef5fffc01b9b95b393097149224ebc2adbc3e..3b6f364ad9ec1f03bba3a5ed6b252d08c6fbe82d 100644 --- a/0091-lxc-support-namespaced-kernel-params-can-be-changed-.patch +++ b/0091-lxc-support-namespaced-kernel-params-can-be-changed-.patch @@ -1,18 +1,18 @@ -From 542fd40b355d670ad5beadb06ee5b4bfe01fa8d8 Mon Sep 17 00:00:00 2001 +From 6091a808d2eca19f7e7f1ac11dae8f2ca9574a9e Mon Sep 17 00:00:00 2001 From: liuhao Date: Fri, 26 Apr 2019 07:13:53 +0800 -Subject: [PATCH 091/131] lxc: support namespaced kernel params can be changed +Subject: [PATCH 091/138] lxc: support namespaced kernel params can be changed in system container support namespaced kernel params can be changed in system container Signed-off-by: yangchenliang --- - src/lxc/conf.c | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++ + src/lxc/conf.c | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) diff --git a/src/lxc/conf.c b/src/lxc/conf.c -index 14d5d807..0f227aa1 100644 +index 14d5d80..0f227aa 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -1516,6 +1516,66 @@ error: @@ -114,5 +114,5 @@ index 14d5d807..0f227aa1 100644 if (!lxc_list_empty(&lxc_conf->caps)) { ERROR("Container requests lxc.cap.drop and " -- -2.23.0 +1.8.3.1 diff --git a/0092-lxc-add-output-error-when-create-unified-cgroup.patch b/0092-lxc-add-output-error-when-create-unified-cgroup.patch index 857c9ff4467f4b0ad197d326811c699f4413fb6b..7f8f749459346c82b64fe301ee42c3d999daa992 100644 --- a/0092-lxc-add-output-error-when-create-unified-cgroup.patch +++ b/0092-lxc-add-output-error-when-create-unified-cgroup.patch @@ -1,7 +1,7 @@ -From 5f78820667b5b19368d7d2255de95a4f1f4a0561 Mon Sep 17 00:00:00 2001 +From 7ba873cf2e58458f4faf58ec98912d7d635f73b5 Mon Sep 17 00:00:00 2001 From: LiFeng Date: Mon, 29 Apr 2019 04:13:52 -0400 -Subject: [PATCH 092/131] lxc: add output error when create unified cgroup +Subject: [PATCH 092/138] lxc: add output error when create unified cgroup Signed-off-by: LiFeng --- @@ -9,7 +9,7 @@ Signed-off-by: LiFeng 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c -index b1f56b07..2bf142f9 100644 +index b1f56b0..2bf142f 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -1132,7 +1132,7 @@ __cgfsng_ops static bool cgfsng_payload_destroy(struct cgroup_ops *ops, @@ -41,5 +41,5 @@ index b1f56b07..2bf142f9 100644 /* isulad: create hierarchies path, if fail, return the error */ -- -2.23.0 +1.8.3.1 diff --git a/0093-optimize-isulad_kit-operator.patch b/0093-optimize-isulad_kit-operator.patch index b1c54e9e8c61dcb572a8c26a4c610c9f12c603db..2aa9c0281f66dfcc0cd04f18b5a609fb0b692cb9 100644 --- a/0093-optimize-isulad_kit-operator.patch +++ b/0093-optimize-isulad_kit-operator.patch @@ -1,23 +1,23 @@ -From fc2fc11d6985f14aea41021f9c4e85b664bcbbaf Mon Sep 17 00:00:00 2001 +From 97241ee73a975fb4234d8e83c79d539f41ee348c Mon Sep 17 00:00:00 2001 From: liuhao Date: Thu, 2 May 2019 11:23:50 +0800 -Subject: [PATCH 093/131] optimize isulad_kit operator +Subject: [PATCH 093/138] optimize isulad_kit operator parse group add start container Signed-off-by: liuhao Signed-off-by: LiFeng --- - src/lxc/Makefile.am | 2 + - .../json/container_start_generate_config.c | 245 ++++++++++++++++++ - .../json/container_start_generate_config.h | 43 +++ - src/lxc/tools/lxc_start.c | 58 +++++ + src/lxc/Makefile.am | 2 + + src/lxc/json/container_start_generate_config.c | 245 +++++++++++++++++++++++++ + src/lxc/json/container_start_generate_config.h | 43 +++++ + src/lxc/tools/lxc_start.c | 58 ++++++ 4 files changed, 348 insertions(+) create mode 100644 src/lxc/json/container_start_generate_config.c create mode 100644 src/lxc/json/container_start_generate_config.h diff --git a/src/lxc/Makefile.am b/src/lxc/Makefile.am -index 698f8f95..4ec20812 100644 +index 698f8f9..4ec2081 100644 --- a/src/lxc/Makefile.am +++ b/src/lxc/Makefile.am @@ -45,6 +45,7 @@ noinst_HEADERS = attach.h \ @@ -38,7 +38,7 @@ index 698f8f95..4ec20812 100644 diff --git a/src/lxc/json/container_start_generate_config.c b/src/lxc/json/container_start_generate_config.c new file mode 100644 -index 00000000..5ec83114 +index 0000000..5ec8311 --- /dev/null +++ b/src/lxc/json/container_start_generate_config.c @@ -0,0 +1,245 @@ @@ -289,7 +289,7 @@ index 00000000..5ec83114 +} diff --git a/src/lxc/json/container_start_generate_config.h b/src/lxc/json/container_start_generate_config.h new file mode 100644 -index 00000000..e1dcf56f +index 0000000..e1dcf56 --- /dev/null +++ b/src/lxc/json/container_start_generate_config.h @@ -0,0 +1,43 @@ @@ -337,7 +337,7 @@ index 00000000..e1dcf56f + +#endif diff --git a/src/lxc/tools/lxc_start.c b/src/lxc/tools/lxc_start.c -index af63f581..4069204f 100644 +index af63f58..4069204 100644 --- a/src/lxc/tools/lxc_start.c +++ b/src/lxc/tools/lxc_start.c @@ -50,6 +50,7 @@ @@ -420,5 +420,5 @@ index af63f581..4069204f 100644 if (my_args.exit_monitor_fifo != NULL) { c->exit_fifo = strdup(my_args.exit_monitor_fifo); -- -2.23.0 +1.8.3.1 diff --git a/0094-exec-load-uid-gid-and-groups.patch b/0094-exec-load-uid-gid-and-groups.patch index 5d1b41d8d99e8cf8c42a284e60d8435e193f6ee7..da3bc122dc55f09c6975f6a8532a3e88312c4940 100644 --- a/0094-exec-load-uid-gid-and-groups.patch +++ b/0094-exec-load-uid-gid-and-groups.patch @@ -1,19 +1,19 @@ -From 11edc9a59a72540f06ccb1bcfb43cc2d81b7e873 Mon Sep 17 00:00:00 2001 +From db3c02168cb0a378c98c9f36ca37dc690d348b68 Mon Sep 17 00:00:00 2001 From: liuhao Date: Tue, 7 May 2019 12:55:03 +0800 -Subject: [PATCH 094/131] exec load uid gid and groups +Subject: [PATCH 094/138] exec load uid gid and groups exec load uid gid and groups Signed-off-by: liuhao Signed-off-by: LiFeng --- - src/lxc/lxccontainer.c | 69 +++++++++++++++++++++++++++++++++++++-- - src/lxc/tools/lxc_start.c | 58 -------------------------------- + src/lxc/lxccontainer.c | 69 +++++++++++++++++++++++++++++++++++++++++++++-- + src/lxc/tools/lxc_start.c | 58 --------------------------------------- 2 files changed, 67 insertions(+), 60 deletions(-) diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c -index fa13e522..e0c4de3e 100644 +index fa13e52..e0c4de3 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -74,6 +74,7 @@ @@ -110,7 +110,7 @@ index fa13e522..e0c4de3e 100644 if (ongoing_create(c) == 2) { diff --git a/src/lxc/tools/lxc_start.c b/src/lxc/tools/lxc_start.c -index 4069204f..af63f581 100644 +index 4069204..af63f58 100644 --- a/src/lxc/tools/lxc_start.c +++ b/src/lxc/tools/lxc_start.c @@ -50,7 +50,6 @@ @@ -193,5 +193,5 @@ index 4069204f..af63f581 100644 if (my_args.exit_monitor_fifo != NULL) { c->exit_fifo = strdup(my_args.exit_monitor_fifo); -- -2.23.0 +1.8.3.1 diff --git a/0095-lxc-don-t-use-the-unified-hierarchy-for-the-systemd-.patch b/0095-lxc-don-t-use-the-unified-hierarchy-for-the-systemd-.patch index c69cf1dbc79cb416fc248a94f5cc382e75a80665..16075fc5fd8bf04fb055ee43b986394395772149 100644 --- a/0095-lxc-don-t-use-the-unified-hierarchy-for-the-systemd-.patch +++ b/0095-lxc-don-t-use-the-unified-hierarchy-for-the-systemd-.patch @@ -1,7 +1,7 @@ -From 8e6ee8123309cc04ebd55b9088cd01c396cd5739 Mon Sep 17 00:00:00 2001 +From 5fe1c6fec0943d6eda9a937a0832c66dd8860a1c Mon Sep 17 00:00:00 2001 From: liuhao Date: Fri, 10 May 2019 11:05:42 +0800 -Subject: [PATCH 095/131] lxc: don't use the unified hierarchy for the systemd +Subject: [PATCH 095/138] lxc: don't use the unified hierarchy for the systemd cgroup reason:don't use the unified hierarchy for the systemd cgroup @@ -13,7 +13,7 @@ Signed-off-by: LiFeng 1 file changed, 14 insertions(+) diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c -index 2bf142f9..eee7ed6a 100644 +index 2bf142f..eee7ed6 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -1571,6 +1571,7 @@ __cgfsng_ops static bool cgfsng_mount(struct cgroup_ops *ops, @@ -52,5 +52,5 @@ index 2bf142f9..eee7ed6a 100644 return retval; } -- -2.23.0 +1.8.3.1 diff --git a/0096-close-inherited-fd-in-hook-process.patch b/0096-close-inherited-fd-in-hook-process.patch index 4e2818d90a7e82d0c90e4cb163735dacd1c97ff0..268dbac8fe4c7f7992eada7849bf71692c72fddd 100644 --- a/0096-close-inherited-fd-in-hook-process.patch +++ b/0096-close-inherited-fd-in-hook-process.patch @@ -1,7 +1,7 @@ -From 95b371b3a04e99c63d8dab26c9c9e5f340a46f12 Mon Sep 17 00:00:00 2001 +From 409fe518357440d5c25886587932b8bec207fa9c Mon Sep 17 00:00:00 2001 From: liuhao Date: Mon, 13 May 2019 16:45:50 +0800 -Subject: [PATCH 096/131] close inherited fd in hook process +Subject: [PATCH 096/138] close inherited fd in hook process close inherited fd in hook process @@ -12,7 +12,7 @@ Signed-off-by: LiFeng 1 file changed, 7 insertions(+) diff --git a/src/lxc/conf.c b/src/lxc/conf.c -index 0f227aa1..6cf86a4e 100644 +index 0f227aa..6cf86a4 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -4560,6 +4560,13 @@ static struct lxc_popen_FILE *lxc_popen_ocihook(char *commandpath, char **args, @@ -30,5 +30,5 @@ index 0f227aa1..6cf86a4e 100644 close(pipe_msg[1]); if (pipe_msg[0] != STDIN_FILENO) -- -2.23.0 +1.8.3.1 diff --git a/0097-lxc-report-error-when-fork-exec-error-for-hooks.patch b/0097-lxc-report-error-when-fork-exec-error-for-hooks.patch index adcef2447ebd6c648a6178af601168f9634df6ef..7755d9c7d5fc5c3287af3b257e471df9f99e2145 100644 --- a/0097-lxc-report-error-when-fork-exec-error-for-hooks.patch +++ b/0097-lxc-report-error-when-fork-exec-error-for-hooks.patch @@ -1,7 +1,7 @@ -From 05cf3e2c1b015175be82d4040e2d2f421494ac57 Mon Sep 17 00:00:00 2001 +From 386ea470d2371fb7916135e801e0d7f5e3c5b8fa Mon Sep 17 00:00:00 2001 From: tanyifeng Date: Wed, 15 May 2019 00:53:49 -0400 -Subject: [PATCH 097/131] lxc: report error when fork/exec error for hooks +Subject: [PATCH 097/138] lxc: report error when fork/exec error for hooks Signed-off-by: tanyifeng Signed-off-by: LiFeng @@ -10,7 +10,7 @@ Signed-off-by: LiFeng 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/src/lxc/conf.c b/src/lxc/conf.c -index 6cf86a4e..341fdab5 100644 +index 6cf86a4..341fdab 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -4559,21 +4559,12 @@ static struct lxc_popen_FILE *lxc_popen_ocihook(char *commandpath, char **args, @@ -68,5 +68,5 @@ index 6cf86a4e..341fdab5 100644 (conf->which >= NUM_LXC_HOOKS) ? "invalid type" : lxchook_names[conf->which], WEXITSTATUS(ret), output); -- -2.23.0 +1.8.3.1 diff --git a/0098-lxc-make-dev-bind-mount-from-host-tmpfs-for-system-c.patch b/0098-lxc-make-dev-bind-mount-from-host-tmpfs-for-system-c.patch index 70cec0de17507c4be3db3704c0e4e5dee250432a..100e6753020780fb690f30eb838244f732ae5183 100644 --- a/0098-lxc-make-dev-bind-mount-from-host-tmpfs-for-system-c.patch +++ b/0098-lxc-make-dev-bind-mount-from-host-tmpfs-for-system-c.patch @@ -1,7 +1,7 @@ -From 59487c2d1aeee28af0c74004196b5fa0f3da613c Mon Sep 17 00:00:00 2001 +From 28a3fe0efea9a99a01e91b593be941505162cf1f Mon Sep 17 00:00:00 2001 From: tanyifeng Date: Wed, 15 May 2019 12:42:08 +0800 -Subject: [PATCH 098/131] lxc: make /dev bind mount from host tmpfs for system +Subject: [PATCH 098/138] lxc: make /dev bind mount from host tmpfs for system container reason:make /dev bind mount from host tmpfs for system container @@ -13,7 +13,7 @@ Signed-off-by: LiFeng 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/src/lxc/conf.c b/src/lxc/conf.c -index 341fdab5..3780966a 100644 +index 341fdab..3780966 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -1122,7 +1122,7 @@ on_error: @@ -63,5 +63,5 @@ index 341fdab5..3780966a 100644 ERROR("Failed to mount \"/dev\""); goto on_error; -- -2.23.0 +1.8.3.1 diff --git a/0099-terminal-do-not-close-the-master-fd-of-pty.patch b/0099-terminal-do-not-close-the-master-fd-of-pty.patch index 3f1132ad7f7819bcfcccb192b5ef4bad3e1f1dcb..d5b432693e594fdbab2b5d84a29f2bd1199d56d8 100644 --- a/0099-terminal-do-not-close-the-master-fd-of-pty.patch +++ b/0099-terminal-do-not-close-the-master-fd-of-pty.patch @@ -1,7 +1,7 @@ -From 604a90c65668840645abfc852e26b35d4e24b81d Mon Sep 17 00:00:00 2001 +From bb22a4c3d79d2ad60e00e77cdea7bc782414cf56 Mon Sep 17 00:00:00 2001 From: LiFeng Date: Tue, 21 May 2019 04:53:16 -0400 -Subject: [PATCH 099/131] terminal: do not close the master fd of pty +Subject: [PATCH 099/138] terminal: do not close the master fd of pty Signed-off-by: LiFeng --- @@ -9,7 +9,7 @@ Signed-off-by: LiFeng 1 file changed, 4 insertions(+) diff --git a/src/lxc/terminal.c b/src/lxc/terminal.c -index dfce92ed..88653b4f 100644 +index dfce92e..88653b4 100644 --- a/src/lxc/terminal.c +++ b/src/lxc/terminal.c @@ -595,6 +595,10 @@ int lxc_terminal_io_cb(int fd, uint32_t events, void *data, @@ -24,5 +24,5 @@ index dfce92ed..88653b4f 100644 if (terminal->tty_state) { lxc_terminal_signal_fini(terminal->tty_state); -- -2.23.0 +1.8.3.1 diff --git a/0100-start-add-check-save-pid-info-file.patch b/0100-start-add-check-save-pid-info-file.patch index 708245dd0363cbda4fa3af158473d9d85d825c27..0f906e2ad233f94fa52d4239fbd6f0b9643b4c37 100644 --- a/0100-start-add-check-save-pid-info-file.patch +++ b/0100-start-add-check-save-pid-info-file.patch @@ -1,17 +1,17 @@ -From 259f249756e9e67827ab1d53ac31cd985cd7d539 Mon Sep 17 00:00:00 2001 +From 8072ed7597edb3773ba26cd3940ae1ef5f879ae4 Mon Sep 17 00:00:00 2001 From: LiFeng Date: Wed, 22 May 2019 23:00:17 -0400 -Subject: [PATCH 100/131] start: add check save pid info file +Subject: [PATCH 100/138] start: add check save pid info file Signed-off-by: LiFeng --- - src/lxc/start.c | 72 ++++++++++++++++++++++++++++++++++++++++++------- + src/lxc/start.c | 72 +++++++++++++++++++++++++++++++++++++++++++++++++-------- src/lxc/utils.c | 2 +- src/lxc/utils.h | 1 + 3 files changed, 64 insertions(+), 11 deletions(-) diff --git a/src/lxc/start.c b/src/lxc/start.c -index 3657d4eb..45417930 100644 +index 3657d4e..4541793 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -1850,14 +1850,10 @@ static inline int do_share_ns(void *arg) @@ -111,7 +111,7 @@ index 3657d4eb..45417930 100644 * exec()s the requested container binary. * Note that lxc_spawn() runs in the parent namespaces. Any operations performed diff --git a/src/lxc/utils.c b/src/lxc/utils.c -index fd6075f8..dc0e6c51 100644 +index fd6075f..dc0e6c5 100644 --- a/src/lxc/utils.c +++ b/src/lxc/utils.c @@ -1909,7 +1909,7 @@ set_env: @@ -124,7 +124,7 @@ index fd6075f8..dc0e6c51 100644 int fd, num_read; diff --git a/src/lxc/utils.h b/src/lxc/utils.h -index 20407af8..4410ff22 100644 +index 20407af..4410ff2 100644 --- a/src/lxc/utils.h +++ b/src/lxc/utils.h @@ -323,5 +323,6 @@ extern void lxc_write_error_message(int errfd, const char *format, ...); @@ -135,5 +135,5 @@ index 20407af8..4410ff22 100644 #endif /* __LXC_UTILS_H */ -- -2.23.0 +1.8.3.1 diff --git a/0101-lxc-fix-code-error.patch b/0101-lxc-fix-code-error.patch index a46fe55990b42e281c5b10fc90c422efaa5c81f2..e8dff2bbd136b0f00d89afaa78882beb5fc632d7 100644 --- a/0101-lxc-fix-code-error.patch +++ b/0101-lxc-fix-code-error.patch @@ -1,32 +1,32 @@ -From 187a14aa91f9b3c6ca6447f2de3b9df1f20ccf09 Mon Sep 17 00:00:00 2001 +From 4eb6383318a8e3beb1c632553a77b4f86e78dd20 Mon Sep 17 00:00:00 2001 From: LiFeng Date: Mon, 3 Jun 2019 05:14:46 -0400 -Subject: [PATCH 101/131] lxc: fix code error +Subject: [PATCH 101/138] lxc: fix code error Signed-off-by: LiFeng --- src/lxc/af_unix.c | 28 +- - src/lxc/cgroups/cgfsng.c | 263 +++++----- - src/lxc/conf.c | 575 ++++++++++---------- + src/lxc/cgroups/cgfsng.c | 263 ++++++------ + src/lxc/conf.c | 575 ++++++++++++++------------ src/lxc/conf.h | 28 +- - src/lxc/confile.c | 897 ++++++++++++++++---------------- + src/lxc/confile.c | 897 ++++++++++++++++++++-------------------- src/lxc/confile_utils.c | 42 +- - src/lxc/json/logger_json_file.c | 422 +++++++-------- - src/lxc/json/read-file.c | 139 ++--- - src/lxc/log.c | 48 +- - src/lxc/lxccontainer.c | 239 +++++---- + src/lxc/json/logger_json_file.c | 422 +++++++++---------- + src/lxc/json/read-file.c | 139 +++---- + src/lxc/log.c | 48 +-- + src/lxc/lxccontainer.c | 239 ++++++----- src/lxc/mainloop.c | 8 +- - src/lxc/path.c | 584 ++++++++++++--------- + src/lxc/path.c | 584 +++++++++++++++----------- src/lxc/path.h | 18 +- - src/lxc/start.c | 194 +++---- + src/lxc/start.c | 194 ++++----- src/lxc/storage/block.c | 3 +- - src/lxc/terminal.c | 129 ++--- - src/lxc/utils.c | 159 ++++-- + src/lxc/terminal.c | 129 +++--- + src/lxc/utils.c | 159 ++++--- src/lxc/utils.h | 11 +- 18 files changed, 2019 insertions(+), 1768 deletions(-) diff --git a/src/lxc/af_unix.c b/src/lxc/af_unix.c -index 24500a8f..4c45946d 100644 +index 24500a8..4c45946 100644 --- a/src/lxc/af_unix.c +++ b/src/lxc/af_unix.c @@ -47,7 +47,7 @@ @@ -138,7 +138,7 @@ index 24500a8f..4c45946d 100644 errno = EACCES; return -1; diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c -index eee7ed6a..67c7a0ee 100644 +index eee7ed6..67c7a0e 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -149,7 +149,7 @@ static char *cg_legacy_must_prefix_named(char *entry) @@ -869,7 +869,7 @@ index eee7ed6a..67c7a0ee 100644 tmp = lxc_string_replace("%n", handler->name, ops->cgroup_pattern); if (!tmp) { diff --git a/src/lxc/conf.c b/src/lxc/conf.c -index 3780966a..ec1667d4 100644 +index 3780966..ec1667d 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -351,8 +351,8 @@ static int run_buffer(char *buffer) @@ -2382,7 +2382,7 @@ index 3780966a..ec1667d4 100644 * before lxc.cgroup.memory.limit_in_bytes, swap these * two items */ diff --git a/src/lxc/conf.h b/src/lxc/conf.h -index fb3c1560..26bb70fa 100644 +index fb3c156..26bb70f 100644 --- a/src/lxc/conf.h +++ b/src/lxc/conf.h @@ -70,14 +70,14 @@ typedef void * scmp_filter_ctx; @@ -2466,7 +2466,7 @@ index fb3c1560..26bb70fa 100644 extern int setup_sysctl_parameters(struct lxc_list *sysctls); extern int lxc_clear_sysctls(struct lxc_conf *c, const char *key); diff --git a/src/lxc/confile.c b/src/lxc/confile.c -index 93936ccd..216a6883 100644 +index 93936cc..216a688 100644 --- a/src/lxc/confile.c +++ b/src/lxc/confile.c @@ -270,7 +270,7 @@ struct lxc_config_t *lxc_get_config(const char *key) @@ -5088,7 +5088,7 @@ index 93936ccd..216a6883 100644 int len; int fulllen = 0; diff --git a/src/lxc/confile_utils.c b/src/lxc/confile_utils.c -index 9049ce82..8c5208f1 100644 +index 9049ce8..8c5208f 100644 --- a/src/lxc/confile_utils.c +++ b/src/lxc/confile_utils.c @@ -46,7 +46,7 @@ @@ -5234,7 +5234,7 @@ index 9049ce82..8c5208f1 100644 return -EINVAL; diff --git a/src/lxc/json/logger_json_file.c b/src/lxc/json/logger_json_file.c -index 6433b042..409ea119 100644 +index 6433b04..409ea11 100644 --- a/src/lxc/json/logger_json_file.c +++ b/src/lxc/json/logger_json_file.c @@ -8,236 +8,236 @@ @@ -5686,7 +5686,7 @@ index 6433b042..409ea119 100644 + return json_buf; } diff --git a/src/lxc/json/read-file.c b/src/lxc/json/read-file.c -index ad0eda1e..70e73e51 100644 +index ad0eda1..70e73e5 100644 --- a/src/lxc/json/read-file.c +++ b/src/lxc/json/read-file.c @@ -16,79 +16,80 @@ @@ -5840,7 +5840,7 @@ index ad0eda1e..70e73e51 100644 + return buf; } diff --git a/src/lxc/log.c b/src/lxc/log.c -index 91fb7efa..e598a5fb 100644 +index 91fb7ef..e598a5f 100644 --- a/src/lxc/log.c +++ b/src/lxc/log.c @@ -157,7 +157,7 @@ static int isulad_open_fifo(const char *file_path) @@ -5975,7 +5975,7 @@ index 91fb7efa..e598a5fb 100644 if (!log) return -1; diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c -index e0c4de3e..e32f524d 100644 +index e0c4de3..e32f524 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -111,7 +111,7 @@ static const char *lxcapi_get_config_path(struct lxc_container *c); @@ -6813,7 +6813,7 @@ index e0c4de3e..e32f524d 100644 int i, ret, active_cnt, ct_cnt, ct_list_cnt; char **active_name; diff --git a/src/lxc/mainloop.c b/src/lxc/mainloop.c -index 9603d1ee..a127a13e 100644 +index 9603d1e..a127a13 100644 --- a/src/lxc/mainloop.c +++ b/src/lxc/mainloop.c @@ -65,7 +65,7 @@ int lxc_mainloop(struct lxc_epoll_descr *descr, int timeout_ms) @@ -6841,7 +6841,7 @@ index 9603d1ee..a127a13e 100644 if (fd < 0) return 0; diff --git a/src/lxc/path.c b/src/lxc/path.c -index e917dcb8..45ab4c3b 100644 +index e917dcb..45ab4c3 100644 --- a/src/lxc/path.c +++ b/src/lxc/path.c @@ -10,6 +10,7 @@ @@ -7578,7 +7578,7 @@ index e917dcb8..45ab4c3b 100644 \ No newline at end of file +} diff --git a/src/lxc/path.h b/src/lxc/path.h -index e3a04cc5..51009413 100644 +index e3a04cc..5100941 100644 --- a/src/lxc/path.h +++ b/src/lxc/path.h @@ -13,7 +13,7 @@ bool has_traling_path_separator(const char *path); @@ -7622,7 +7622,7 @@ index e3a04cc5..51009413 100644 // Rel returns a relative path that is lexically equivalent to targpath when // joined to basepath with an intervening separator. That is, diff --git a/src/lxc/start.c b/src/lxc/start.c -index 45417930..ccdd844c 100644 +index 4541793..ccdd844 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -93,7 +93,7 @@ extern void mod_all_rdeps(struct lxc_container *c, bool inc); @@ -8259,7 +8259,7 @@ index 45417930..ccdd844c 100644 ret = -1; } diff --git a/src/lxc/storage/block.c b/src/lxc/storage/block.c -index eb75e706..89989233 100644 +index eb75e70..8998923 100644 --- a/src/lxc/storage/block.c +++ b/src/lxc/storage/block.c @@ -62,7 +62,8 @@ bool blk_detect(const char *path) @@ -8273,7 +8273,7 @@ index eb75e706..89989233 100644 return -22; diff --git a/src/lxc/terminal.c b/src/lxc/terminal.c -index 88653b4f..802bf392 100644 +index 88653b4..802bf39 100644 --- a/src/lxc/terminal.c +++ b/src/lxc/terminal.c @@ -113,7 +113,7 @@ void lxc_terminal_sigwinch(int sig) @@ -8638,7 +8638,7 @@ index 88653b4f..802bf392 100644 lxc_terminal_delete_fifo(fifofd_in, &terminal->fifos); ret = -1; diff --git a/src/lxc/utils.c b/src/lxc/utils.c -index dc0e6c51..9ce24739 100644 +index dc0e6c5..9ce2473 100644 --- a/src/lxc/utils.c +++ b/src/lxc/utils.c @@ -56,6 +56,7 @@ @@ -8945,7 +8945,7 @@ index dc0e6c51..9ce24739 100644 +} + diff --git a/src/lxc/utils.h b/src/lxc/utils.h -index 4410ff22..2406ee15 100644 +index 4410ff2..2406ee1 100644 --- a/src/lxc/utils.h +++ b/src/lxc/utils.h @@ -229,8 +229,8 @@ extern bool switch_to_ns(pid_t pid, const char *ns); @@ -8979,5 +8979,5 @@ index 4410ff22..2406ee15 100644 +extern FILE *lxc_fopen(const char *filename, const char *mode); #endif /* __LXC_UTILS_H */ -- -2.23.0 +1.8.3.1 diff --git a/0102-lxc-fix-compile-warnings.patch b/0102-lxc-fix-compile-warnings.patch index 706e343d2aa2e6c75058ec652fa799e61d8226f5..4b83d9f49998516ffbee7b073d97ec4f53592108 100644 --- a/0102-lxc-fix-compile-warnings.patch +++ b/0102-lxc-fix-compile-warnings.patch @@ -1,7 +1,7 @@ -From 7fbfd6a0e45744d9f779da857ddcf82e5eb92a30 Mon Sep 17 00:00:00 2001 +From abcb5c5bdd46cb83deff2d2af95c26221ef51a8e Mon Sep 17 00:00:00 2001 From: LiFeng Date: Mon, 3 Jun 2019 06:19:07 -0400 -Subject: [PATCH 102/131] lxc: fix compile warnings +Subject: [PATCH 102/138] lxc: fix compile warnings Signed-off-by: LiFeng --- @@ -11,7 +11,7 @@ Signed-off-by: LiFeng 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/lxc/conf.c b/src/lxc/conf.c -index ec1667d4..e7df3363 100644 +index ec1667d..e7df336 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -4992,7 +4992,6 @@ int run_lxc_hooks(const char *name, char *hookname, struct lxc_conf *conf, @@ -23,7 +23,7 @@ index ec1667d4..e7df3363 100644 if (strcmp(hookname, "oci-prestart") == 0) { diff --git a/src/lxc/path.c b/src/lxc/path.c -index 45ab4c3b..92692dea 100644 +index 45ab4c3..92692de 100644 --- a/src/lxc/path.c +++ b/src/lxc/path.c @@ -141,7 +141,6 @@ int do_clean_path(const char *respath, const char *limit_respath, @@ -67,7 +67,7 @@ index 45ab4c3b..92692dea 100644 if (fullpath == NULL || rootpath == NULL) { return NULL; diff --git a/src/lxc/utils.c b/src/lxc/utils.c -index 9ce24739..e6749471 100644 +index 9ce2473..e674947 100644 --- a/src/lxc/utils.c +++ b/src/lxc/utils.c @@ -2106,7 +2106,7 @@ void *lxc_common_calloc_s(size_t size) @@ -80,5 +80,5 @@ index 9ce24739..e6749471 100644 goto err_out; } -- -2.23.0 +1.8.3.1 diff --git a/0103-lxc-fix-code-error-in-conf.c.patch b/0103-lxc-fix-code-error-in-conf.c.patch index f241f02b8657796073c172cdfb31788f7f0b62d3..0a94927c79385ae489480df7bd1c573d1f4f2dbb 100644 --- a/0103-lxc-fix-code-error-in-conf.c.patch +++ b/0103-lxc-fix-code-error-in-conf.c.patch @@ -1,7 +1,7 @@ -From ea13ba8a5d6958f6302482ca5a3d718381bca657 Mon Sep 17 00:00:00 2001 +From ca3e9e36f1d6d37ad6688f6550374c26fc44845c Mon Sep 17 00:00:00 2001 From: LiFeng Date: Mon, 3 Jun 2019 11:14:22 -0400 -Subject: [PATCH 103/131] lxc: fix code error in conf.c +Subject: [PATCH 103/138] lxc: fix code error in conf.c Signed-off-by: LiFeng --- @@ -10,7 +10,7 @@ Signed-off-by: LiFeng 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/src/lxc/conf.c b/src/lxc/conf.c -index e7df3363..127ef77b 100644 +index e7df336..127ef77 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -2446,7 +2446,8 @@ static int check_mount_destination(const char *rootfs, const char *dest) @@ -92,7 +92,7 @@ index e7df3363..127ef77b 100644 return 0; diff --git a/src/lxc/conf.h b/src/lxc/conf.h -index 26bb70fa..e4bfc48f 100644 +index 26bb70f..e4bfc48 100644 --- a/src/lxc/conf.h +++ b/src/lxc/conf.h @@ -445,7 +445,7 @@ extern struct lxc_conf *current_config; @@ -105,5 +105,5 @@ index 26bb70fa..e4bfc48f 100644 extern int detect_shared_rootfs(void); extern struct lxc_conf *lxc_conf_init(void); -- -2.23.0 +1.8.3.1 diff --git a/0104-lxc-fix-code-error.patch b/0104-lxc-fix-code-error.patch index 291e8b6eb17a845d67fb1e1a50a46b4466a95c3a..1376c6738b5c3f4132a90c618cf3c65fe2532c62 100644 --- a/0104-lxc-fix-code-error.patch +++ b/0104-lxc-fix-code-error.patch @@ -1,7 +1,7 @@ -From 79a38af7d57e0ec7e527d1d28e8575c3fcfa4a45 Mon Sep 17 00:00:00 2001 +From a66a6ed6220c13187150ab33560df76cdf4e15b6 Mon Sep 17 00:00:00 2001 From: tanyifeng Date: Mon, 3 Jun 2019 11:27:34 -0400 -Subject: [PATCH 104/131] lxc: fix code error +Subject: [PATCH 104/138] lxc: fix code error Signed-off-by: tanyifeng Signed-off-by: LiFeng @@ -15,7 +15,7 @@ Signed-off-by: LiFeng 6 files changed, 31 insertions(+), 14 deletions(-) diff --git a/src/lxc/af_unix.c b/src/lxc/af_unix.c -index 4c45946d..1fc8ab0e 100644 +index 4c45946..1fc8ab0 100644 --- a/src/lxc/af_unix.c +++ b/src/lxc/af_unix.c @@ -204,12 +204,18 @@ int lxc_abstract_unix_recv_fds_timeout(int fd, int *recvfds, int num_recvfds, @@ -39,7 +39,7 @@ index 4c45946d..1fc8ab0e 100644 if (!cmsgbuf) { errno = ENOMEM; diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c -index 67c7a0ee..46f13f4d 100644 +index 67c7a0e..46f13f4 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -1688,7 +1688,7 @@ __cgfsng_ops static bool cgfsng_mount(struct cgroup_ops *ops, @@ -68,7 +68,7 @@ index 67c7a0ee..46f13f4d 100644 p = strchr(controller, '.'); diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c -index e32f524d..72417ed6 100644 +index e32f524..72417ed 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -1208,6 +1208,7 @@ static bool do_lxcapi_start(struct lxc_container *c, int useinit, char * const a @@ -88,7 +88,7 @@ index e32f524d..72417ed6 100644 on_error: if (c->pidfile) { diff --git a/src/lxc/path.c b/src/lxc/path.c -index 92692dea..36d5e0be 100644 +index 92692de..36d5e0b 100644 --- a/src/lxc/path.c +++ b/src/lxc/path.c @@ -31,6 +31,7 @@ bool specify_current_dir(const char *path) @@ -100,7 +100,7 @@ index 92692dea..36d5e0be 100644 return false; } diff --git a/src/lxc/terminal.c b/src/lxc/terminal.c -index 802bf392..a8a0dc97 100644 +index 802bf39..a8a0dc9 100644 --- a/src/lxc/terminal.c +++ b/src/lxc/terminal.c @@ -231,7 +231,7 @@ static int lxc_terminal_truncate_log_file(struct lxc_terminal *terminal) @@ -145,7 +145,7 @@ index 802bf392..a8a0dc97 100644 } diff --git a/src/lxc/utils.c b/src/lxc/utils.c -index e6749471..9db762fb 100644 +index e674947..9db762f 100644 --- a/src/lxc/utils.c +++ b/src/lxc/utils.c @@ -1769,11 +1769,11 @@ int fd_cloexec(int fd, bool cloexec) @@ -175,5 +175,5 @@ index e6749471..9db762fb 100644 } -- -2.23.0 +1.8.3.1 diff --git a/0105-lxc-fix-code-error-warnings.patch b/0105-lxc-fix-code-error-warnings.patch index b588958e8f576b7d5e0dc20fee9e1156d6dd2359..8e9af1a9c6cac30d9a06830893187dbb9bc35871 100644 --- a/0105-lxc-fix-code-error-warnings.patch +++ b/0105-lxc-fix-code-error-warnings.patch @@ -1,7 +1,7 @@ -From 9f0429283bfb550036831afcc19026963d42a4e8 Mon Sep 17 00:00:00 2001 +From 24364817d7ba5efc33de345547e0413df9dc756d Mon Sep 17 00:00:00 2001 From: LiFeng Date: Mon, 3 Jun 2019 23:02:50 -0400 -Subject: [PATCH 105/131] lxc: fix code error warnings +Subject: [PATCH 105/138] lxc: fix code error warnings Signed-off-by: LiFeng --- @@ -11,7 +11,7 @@ Signed-off-by: LiFeng 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/lxc/conf.c b/src/lxc/conf.c -index 127ef77b..83117238 100644 +index 127ef77..8311723 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -5325,9 +5325,12 @@ int lxc_clear_init_args(struct lxc_conf *lxc_conf) @@ -29,7 +29,7 @@ index 127ef77b..83117238 100644 return 0; diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c -index 72417ed6..a09e066a 100644 +index 72417ed..a09e066 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -1180,6 +1180,7 @@ static bool do_lxcapi_start(struct lxc_container *c, int useinit, char * const a @@ -57,7 +57,7 @@ index 72417ed6..a09e066a 100644 on_error: if (c->pidfile) { diff --git a/src/lxc/start.c b/src/lxc/start.c -index ccdd844c..2380581f 100644 +index ccdd844..2380581 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -2421,7 +2421,7 @@ int __lxc_start(const char *name, struct lxc_handler *handler, @@ -70,5 +70,5 @@ index ccdd844c..2380581f 100644 handler->ops = ops; handler->data = data; -- -2.23.0 +1.8.3.1 diff --git a/0106-set-timeout-to-1s-for-cmds-send-to-lxc-monitor.patch b/0106-set-timeout-to-1s-for-cmds-send-to-lxc-monitor.patch index 7f7724dd134a313ac238224e6dc547c17d13d01f..cfe7d716d5a5534435764d8b8ee64185ac329dfb 100644 --- a/0106-set-timeout-to-1s-for-cmds-send-to-lxc-monitor.patch +++ b/0106-set-timeout-to-1s-for-cmds-send-to-lxc-monitor.patch @@ -1,7 +1,7 @@ -From 412831f8677bfe78a9e473a473c29e1441cf7fe9 Mon Sep 17 00:00:00 2001 +From a57a384e7d39498a2d70027f67aa9dc1d1db2ea4 Mon Sep 17 00:00:00 2001 From: LiFeng Date: Thu, 6 Jun 2019 22:48:38 -0400 -Subject: [PATCH 106/131] set timeout to 1s for cmds send to [lxc monitor] +Subject: [PATCH 106/138] set timeout to 1s for cmds send to [lxc monitor] Signed-off-by: LiFeng --- @@ -9,7 +9,7 @@ Signed-off-by: LiFeng 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lxc/commands.c b/src/lxc/commands.c -index c74b8c1f..0802a167 100644 +index c74b8c1..0802a16 100644 --- a/src/lxc/commands.c +++ b/src/lxc/commands.c @@ -127,10 +127,10 @@ static int lxc_cmd_rsp_recv(int sock, struct lxc_cmd_rr *cmd) @@ -27,5 +27,5 @@ index c74b8c1f..0802a167 100644 if (errno == ECONNRESET || errno == EAGAIN || errno == EWOULDBLOCK) { -- -2.23.0 +1.8.3.1 diff --git a/0107-add-log-for-failure-of-rename-file.patch b/0107-add-log-for-failure-of-rename-file.patch index 3a4d188982994021d3a9c6b3b06b5d15421dc69f..ff37d8bca3fe1439e893c79f7782558ad9163bc0 100644 --- a/0107-add-log-for-failure-of-rename-file.patch +++ b/0107-add-log-for-failure-of-rename-file.patch @@ -1,7 +1,7 @@ -From ab769b5cde6f65355eb395b7477acda3c5fbd381 Mon Sep 17 00:00:00 2001 +From 8285ecc2065505e869f92b74934abee2249eaac5 Mon Sep 17 00:00:00 2001 From: liuhao Date: Mon, 17 Jun 2019 20:17:37 +0800 -Subject: [PATCH 107/131] add log for failure of rename file +Subject: [PATCH 107/138] add log for failure of rename file 1. add log message of rename operator 2. if rename console file failed, reopen terminal fd @@ -13,7 +13,7 @@ Signed-off-by: LiFeng 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lxc/terminal.c b/src/lxc/terminal.c -index a8a0dc97..778a0abd 100644 +index a8a0dc9..778a0ab 100644 --- a/src/lxc/terminal.c +++ b/src/lxc/terminal.c @@ -293,8 +293,9 @@ static int lxc_terminal_rotate_log_file(struct lxc_terminal *terminal) @@ -29,5 +29,5 @@ index a8a0dc97..778a0abd 100644 return lxc_terminal_create_log_file(terminal); } -- -2.23.0 +1.8.3.1 diff --git a/0108-check-calloc-input-valid.patch b/0108-check-calloc-input-valid.patch index 80a3e3da22e8cb7d76430c43c64b2a0c7b43b48c..dc67f735a4b5177ba973c04c8c361a8f024c546f 100644 --- a/0108-check-calloc-input-valid.patch +++ b/0108-check-calloc-input-valid.patch @@ -1,7 +1,7 @@ -From b00c15567bc0fedc87f5e31106fadc5fbea1ca54 Mon Sep 17 00:00:00 2001 +From b23823f7acf224be1c4e99dbc8959b7adb1bcc11 Mon Sep 17 00:00:00 2001 From: liuhao Date: Tue, 18 Jun 2019 23:16:09 +0800 -Subject: [PATCH 108/131] check calloc input valid +Subject: [PATCH 108/138] check calloc input valid check calloc input valid @@ -12,7 +12,7 @@ Signed-off-by: LiFeng 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lxc/terminal.c b/src/lxc/terminal.c -index 778a0abd..6b117de7 100644 +index 778a0ab..6b117de 100644 --- a/src/lxc/terminal.c +++ b/src/lxc/terminal.c @@ -444,8 +444,11 @@ static ssize_t lxc_logger_write(struct lxc_terminal *terminal, const char *type, @@ -29,5 +29,5 @@ index 778a0abd..6b117de7 100644 } msg->log = calloc(bytes_read, 1); -- -2.23.0 +1.8.3.1 diff --git a/0109-add-secure-compile-flags-to-lxc.patch b/0109-add-secure-compile-flags-to-lxc.patch index 6465940242e450ddd2e98297b8ebdd35b5b1ba71..c8017a1befc3f1baec2493edb3d980e1ffcf1854 100644 --- a/0109-add-secure-compile-flags-to-lxc.patch +++ b/0109-add-secure-compile-flags-to-lxc.patch @@ -1,7 +1,7 @@ -From 75df0fd2adec8d697fc3d96df21dcdd74cb6f98e Mon Sep 17 00:00:00 2001 +From 87d3b15c4b8c4070470f2491c0811cc6e6385de3 Mon Sep 17 00:00:00 2001 From: liuhao Date: Thu, 20 Jun 2019 17:46:40 +0800 -Subject: [PATCH 109/131] add secure compile flags to lxc +Subject: [PATCH 109/138] add secure compile flags to lxc add secure compile flags to lxc @@ -13,7 +13,7 @@ Signed-off-by: LiFeng 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac -index 4da52a27..a7147794 100644 +index 4da52a2..a714779 100644 --- a/configure.ac +++ b/configure.ac @@ -44,6 +44,7 @@ AM_INIT_AUTOMAKE([-Wall -Werror -Wno-portability subdir-objects]) @@ -78,7 +78,7 @@ index 4da52a27..a7147794 100644 [AC_HELP_STRING([--enable-thread-safety], [enforce thread-safety otherwise fail the build [default=yes]])], [], [enable_thread_safety=yes]) diff --git a/src/lxc/Makefile.am b/src/lxc/Makefile.am -index 4ec20812..b24fcfdb 100644 +index 4ec2081..b24fcfd 100644 --- a/src/lxc/Makefile.am +++ b/src/lxc/Makefile.am @@ -233,12 +233,17 @@ endif @@ -100,5 +100,5 @@ index 4ec20812..b24fcfdb 100644 -version-info @LXC_ABI_MAJOR@ @YAJL_LIBS@ -- -2.23.0 +1.8.3.1 diff --git a/0110-add-doc-for-lxc.patch b/0110-add-doc-for-lxc.patch index 6d3df243ba141f665bc1b96ca91c81bf6de8041f..29b7e7a8576d625c41e247e7a3c79603d4aed719 100644 --- a/0110-add-doc-for-lxc.patch +++ b/0110-add-doc-for-lxc.patch @@ -1,7 +1,7 @@ -From 25640fa1a09fade4ae15ba9a14a110f4a36cd0c8 Mon Sep 17 00:00:00 2001 +From 1cfa6b9e317c3a259f6960058bd3d0daa1f06b6c Mon Sep 17 00:00:00 2001 From: liuhao Date: Fri, 21 Jun 2019 17:20:43 +0800 -Subject: [PATCH 110/131] add doc for lxc +Subject: [PATCH 110/138] add doc for lxc add doc for lxc @@ -12,7 +12,7 @@ Signed-off-by: LiFeng 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac -index a7147794..5963fab1 100644 +index a714779..5963fab 100644 --- a/configure.ac +++ b/configure.ac @@ -206,8 +206,8 @@ AM_CONDITIONAL([ENABLE_RPATH], [test "x$enable_rpath" = "xyes"]) @@ -27,5 +27,5 @@ index a7147794..5963fab1 100644 if test "x$enable_doc" = "xyes" -o "x$enable_doc" = "xauto"; then db2xman="" -- -2.23.0 +1.8.3.1 diff --git a/0111-lxc-use-safe_strdup-instead-of-strdup.patch b/0111-lxc-use-safe_strdup-instead-of-strdup.patch index a7788bff6b505ec6d05684c364012720b33615d9..898caa71be77f16fbf2fd1528bb6f1348b939097 100644 --- a/0111-lxc-use-safe_strdup-instead-of-strdup.patch +++ b/0111-lxc-use-safe_strdup-instead-of-strdup.patch @@ -1,31 +1,31 @@ -From eb7e43a1814f9c1a3a02a4a17fd231ea1b31e3ab Mon Sep 17 00:00:00 2001 +From 20567796e28b406e13e0ec745fbbe4860a39a666 Mon Sep 17 00:00:00 2001 From: LiFeng Date: Wed, 3 Jul 2019 23:41:15 -0400 -Subject: [PATCH 111/131] lxc: use safe_strdup instead of strdup +Subject: [PATCH 111/138] lxc: use safe_strdup instead of strdup Signed-off-by: LiFeng --- - src/lxc/attach.c | 14 ++++------- - src/lxc/conf.c | 32 +++++++------------------ - src/lxc/confile.c | 32 +++++++------------------ + src/lxc/attach.c | 14 +++++--------- + src/lxc/conf.c | 32 +++++++++---------------------- + src/lxc/confile.c | 32 +++++++++---------------------- src/lxc/json/defs.c | 1 - - src/lxc/json/json_common.c | 41 ++++++++++---------------------- + src/lxc/json/json_common.c | 41 ++++++++++++---------------------------- src/lxc/json/json_common.h | 4 +--- src/lxc/json/logger_json_file.c | 1 - src/lxc/json/oci_runtime_hooks.c | 4 ++-- src/lxc/json/oci_runtime_spec.c | 1 - - src/lxc/lxccontainer.c | 16 ++++++------- - src/lxc/path.c | 20 ++++------------ - src/lxc/start.c | 18 +++++++------- - src/lxc/terminal.c | 18 ++++++-------- + src/lxc/lxccontainer.c | 16 +++++++--------- + src/lxc/path.c | 20 +++++--------------- + src/lxc/start.c | 18 +++++++++--------- + src/lxc/terminal.c | 18 +++++++----------- src/lxc/tools/lxc_attach.c | 4 ++-- src/lxc/tools/lxc_start.c | 2 +- - src/lxc/utils.c | 16 +++++++++++++ + src/lxc/utils.c | 16 ++++++++++++++++ src/lxc/utils.h | 2 ++ 17 files changed, 87 insertions(+), 139 deletions(-) diff --git a/src/lxc/attach.c b/src/lxc/attach.c -index 6480eb99..d7b16e34 100644 +index 6480eb9..d7b16e3 100644 --- a/src/lxc/attach.c +++ b/src/lxc/attach.c @@ -1070,15 +1070,15 @@ static int lxc_attach_terminal(struct lxc_conf *conf, @@ -70,7 +70,7 @@ index 6480eb99..d7b16e34 100644 close_mainloop: if (options->attach_flags & LXC_ATTACH_TERMINAL) diff --git a/src/lxc/conf.c b/src/lxc/conf.c -index 83117238..1dfdaf31 100644 +index 8311723..1dfdaf3 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -1356,9 +1356,7 @@ static int rootfs_parent_mount_private(char *rootfs) @@ -166,7 +166,7 @@ index 83117238..1dfdaf31 100644 } diff --git a/src/lxc/confile.c b/src/lxc/confile.c -index 216a6883..8262d1e3 100644 +index 216a688..8262d1e 100644 --- a/src/lxc/confile.c +++ b/src/lxc/confile.c @@ -1011,9 +1011,7 @@ static int set_config_group(const char *key, const char *value, @@ -259,7 +259,7 @@ index 216a6883..8262d1e3 100644 } diff --git a/src/lxc/json/defs.c b/src/lxc/json/defs.c -index e7d9a092..8a052a88 100644 +index e7d9a09..8a052a8 100644 --- a/src/lxc/json/defs.c +++ b/src/lxc/json/defs.c @@ -4,7 +4,6 @@ @@ -271,7 +271,7 @@ index e7d9a092..8a052a88 100644 defs_hook *make_defs_hook(yajl_val tree, struct parser_context *ctx, parser_error *err) { diff --git a/src/lxc/json/json_common.c b/src/lxc/json/json_common.c -index 54b7b610..bea9b14d 100755 +index 54b7b61..bea9b14 100755 --- a/src/lxc/json/json_common.c +++ b/src/lxc/json/json_common.c @@ -381,23 +381,6 @@ int common_safe_int(const char *numstr, int *converted) { @@ -389,7 +389,7 @@ index 54b7b610..bea9b14d 100755 free(vals); return -1; diff --git a/src/lxc/json/json_common.h b/src/lxc/json/json_common.h -index 218a8371..60aa5fd9 100755 +index 218a837..60aa5fd 100755 --- a/src/lxc/json/json_common.h +++ b/src/lxc/json/json_common.h @@ -9,7 +9,7 @@ @@ -411,7 +411,7 @@ index 218a8371..60aa5fd9 100755 int *keys; int *values; diff --git a/src/lxc/json/logger_json_file.c b/src/lxc/json/logger_json_file.c -index 409ea119..842d35b5 100644 +index 409ea11..842d35b 100644 --- a/src/lxc/json/logger_json_file.c +++ b/src/lxc/json/logger_json_file.c @@ -4,7 +4,6 @@ @@ -423,7 +423,7 @@ index 409ea119..842d35b5 100644 logger_json_file *make_logger_json_file(yajl_val tree, struct parser_context *ctx, parser_error *err) { diff --git a/src/lxc/json/oci_runtime_hooks.c b/src/lxc/json/oci_runtime_hooks.c -index 43ff8d7f..41ddb672 100644 +index 43ff8d7..41ddb67 100644 --- a/src/lxc/json/oci_runtime_hooks.c +++ b/src/lxc/json/oci_runtime_hooks.c @@ -34,7 +34,7 @@ oci_runtime_spec_hooks *oci_runtime_spec_hooks_parse_file(const char *filename, @@ -445,7 +445,7 @@ index 43ff8d7f..41ddb672 100644 return NULL; } diff --git a/src/lxc/json/oci_runtime_spec.c b/src/lxc/json/oci_runtime_spec.c -index 4ccb6358..fd342deb 100644 +index 4ccb635..fd342de 100644 --- a/src/lxc/json/oci_runtime_spec.c +++ b/src/lxc/json/oci_runtime_spec.c @@ -4,7 +4,6 @@ @@ -457,7 +457,7 @@ index 4ccb6358..fd342deb 100644 oci_runtime_spec_hooks *make_oci_runtime_spec_hooks(yajl_val tree, struct parser_context *ctx, parser_error *err) { diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c -index a09e066a..ede4c885 100644 +index a09e066..ede4c88 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -1055,9 +1055,7 @@ static bool do_lxcapi_start(struct lxc_container *c, int useinit, char * const a @@ -520,7 +520,7 @@ index a09e066a..ede4c885 100644 if (!c->config_path) { fprintf(stderr, "Failed to allocate memory for %s\n", name); diff --git a/src/lxc/path.c b/src/lxc/path.c -index 36d5e0be..c545887a 100644 +index 36d5e0b..c545887 100644 --- a/src/lxc/path.c +++ b/src/lxc/path.c @@ -23,11 +23,7 @@ bool specify_current_dir(const char *path) @@ -577,7 +577,7 @@ index 36d5e0be..c545887a 100644 + return safe_strdup(targ + t0); } diff --git a/src/lxc/start.c b/src/lxc/start.c -index 2380581f..d6c706e7 100644 +index 2380581..d6c706e 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -2795,35 +2795,35 @@ static int clean_resource_set_env(struct lxc_handler *handler) @@ -626,7 +626,7 @@ index 2380581f..d6c706e7 100644 conf->ocihooks->poststop[i]->env_len = j; /* End of environment variable setup for hooks. */ diff --git a/src/lxc/terminal.c b/src/lxc/terminal.c -index 6b117de7..970db694 100644 +index 6b117de..970db69 100644 --- a/src/lxc/terminal.c +++ b/src/lxc/terminal.c @@ -246,7 +246,7 @@ static int lxc_terminal_rename_old_log_file(struct lxc_terminal *terminal) @@ -678,7 +678,7 @@ index 6b117de7..970db694 100644 in = strtok_r(tmp, "&&&&", &saveptr); if (!in) { diff --git a/src/lxc/tools/lxc_attach.c b/src/lxc/tools/lxc_attach.c -index 854b3a2c..7d51ad72 100644 +index 854b3a2..7d51ad7 100644 --- a/src/lxc/tools/lxc_attach.c +++ b/src/lxc/tools/lxc_attach.c @@ -309,7 +309,7 @@ static int do_attach_foreground(struct lxc_container *c, lxc_attach_command_t *c @@ -700,7 +700,7 @@ index 854b3a2c..7d51ad72 100644 } diff --git a/src/lxc/tools/lxc_start.c b/src/lxc/tools/lxc_start.c -index af63f581..e48e5b3e 100644 +index af63f58..e48e5b3 100644 --- a/src/lxc/tools/lxc_start.c +++ b/src/lxc/tools/lxc_start.c @@ -360,7 +360,7 @@ int main(int argc, char *argv[]) @@ -713,7 +713,7 @@ index af63f581..e48e5b3e 100644 /* isulad: add start timeout */ diff --git a/src/lxc/utils.c b/src/lxc/utils.c -index 9db762fb..e6e8905b 100644 +index 9db762f..e6e8905 100644 --- a/src/lxc/utils.c +++ b/src/lxc/utils.c @@ -2157,3 +2157,19 @@ FILE *lxc_fopen(const char *filename, const char *mode) @@ -737,7 +737,7 @@ index 9db762fb..e6e8905b 100644 +} + diff --git a/src/lxc/utils.h b/src/lxc/utils.h -index 2406ee15..0b33f690 100644 +index 2406ee1..0b33f69 100644 --- a/src/lxc/utils.h +++ b/src/lxc/utils.h @@ -328,4 +328,6 @@ extern int lxc_mem_realloc(void **newptr, size_t newsize, void *oldptr, size_t o @@ -748,5 +748,5 @@ index 2406ee15..0b33f690 100644 + #endif /* __LXC_UTILS_H */ -- -2.23.0 +1.8.3.1 diff --git a/0112-fix-secure-errors.patch b/0112-fix-secure-errors.patch index f01430a345476c44921eb23acec531f0a4ee48e3..57586305435f6ff20735cafc630605b0d240a34c 100644 --- a/0112-fix-secure-errors.patch +++ b/0112-fix-secure-errors.patch @@ -1,7 +1,7 @@ -From 0398da2058282e3627ec7fc3922b439c1541078c Mon Sep 17 00:00:00 2001 +From 6153cd585089e51b3a6f2f2f982e864a3270e868 Mon Sep 17 00:00:00 2001 From: liuhao Date: Thu, 4 Jul 2019 11:08:26 +0800 -Subject: [PATCH 112/131] fix secure errors +Subject: [PATCH 112/138] fix secure errors 1. use snprintf replace sprintf 2. use malloc replace alloca @@ -17,7 +17,7 @@ Signed-off-by: LiFeng 5 files changed, 64 insertions(+), 31 deletions(-) diff --git a/src/lxc/conf.c b/src/lxc/conf.c -index 1dfdaf31..996d2671 100644 +index 1dfdaf3..996d267 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -4543,18 +4543,20 @@ static char **merge_ocihook_env(char **oldenvs, size_t env_len, size_t *merge_en @@ -44,7 +44,7 @@ index 1dfdaf31..996d2671 100644 continue; } diff --git a/src/lxc/confile.c b/src/lxc/confile.c -index 8262d1e3..8a082d55 100644 +index 8262d1e..8a082d5 100644 --- a/src/lxc/confile.c +++ b/src/lxc/confile.c @@ -3802,9 +3802,11 @@ static int get_config_no_new_privs(const char *key, char *retv, int inlen, @@ -115,7 +115,7 @@ index 8262d1e3..8a082d55 100644 strprint(retv, inlen, "%s", buf); } diff --git a/src/lxc/json/json_common.c b/src/lxc/json/json_common.c -index bea9b14d..5da1e6de 100755 +index bea9b14..5da1e6d 100755 --- a/src/lxc/json/json_common.c +++ b/src/lxc/json/json_common.c @@ -16,7 +16,7 @@ yajl_gen_status reformat_uint(void *ctx, long long unsigned int num) { @@ -171,7 +171,7 @@ index bea9b14d..5da1e6de 100755 \ No newline at end of file +} diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c -index ede4c885..3b2c5af2 100644 +index ede4c88..3b2c5af 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -3196,7 +3196,11 @@ static bool container_destroy(struct lxc_container *c, @@ -197,7 +197,7 @@ index ede4c885..3b2c5af2 100644 return -1; } diff --git a/src/lxc/terminal.c b/src/lxc/terminal.c -index 970db694..b9b65c6f 100644 +index 970db69..b9b65c6 100644 --- a/src/lxc/terminal.c +++ b/src/lxc/terminal.c @@ -241,13 +241,13 @@ static int lxc_terminal_rename_old_log_file(struct lxc_terminal *terminal) @@ -274,5 +274,5 @@ index 970db694..b9b65c6f 100644 return true; } -- -2.23.0 +1.8.3.1 diff --git a/0113-Malloc-parameter-check-and-judgment.patch b/0113-Malloc-parameter-check-and-judgment.patch index 87ff59d95e28d0de362a179d46bd9b9e11bfe4f6..ace508a6cebca3904b95adad9c6345fb60ae03ab 100644 --- a/0113-Malloc-parameter-check-and-judgment.patch +++ b/0113-Malloc-parameter-check-and-judgment.patch @@ -1,28 +1,28 @@ -From c9bcf39716f166bc44e3d1d1cd65a246646a7bb4 Mon Sep 17 00:00:00 2001 +From f7edf9518a6b11de69d8cfe2c1dbf9bf3a1dacbb Mon Sep 17 00:00:00 2001 From: liuhao Date: Thu, 4 Jul 2019 12:08:17 +0800 -Subject: [PATCH 113/131] Malloc parameter check and judgment +Subject: [PATCH 113/138] Malloc parameter check and judgment Signed-off-by: wujing Signed-off-by: LiFeng --- - src/lxc/attach.c | 2 +- - src/lxc/commands.c | 9 +- - src/lxc/conf.c | 20 ++-- - src/lxc/confile.c | 8 +- - .../json/container_start_generate_config.c | 12 ++- - src/lxc/json/defs.c | 8 ++ - src/lxc/json/json_common.c | 97 +++++++------------ - src/lxc/json/logger_json_file.c | 6 +- - src/lxc/lxccontainer.c | 12 ++- - src/lxc/path.c | 8 +- - src/lxc/start.c | 6 +- - src/lxc/terminal.c | 2 +- - src/lxc/utils.c | 4 +- + src/lxc/attach.c | 2 +- + src/lxc/commands.c | 9 ++- + src/lxc/conf.c | 20 ++++-- + src/lxc/confile.c | 8 +-- + src/lxc/json/container_start_generate_config.c | 12 +++- + src/lxc/json/defs.c | 8 +++ + src/lxc/json/json_common.c | 97 +++++++++----------------- + src/lxc/json/logger_json_file.c | 6 +- + src/lxc/lxccontainer.c | 12 +++- + src/lxc/path.c | 8 ++- + src/lxc/start.c | 6 +- + src/lxc/terminal.c | 2 +- + src/lxc/utils.c | 4 +- 13 files changed, 104 insertions(+), 90 deletions(-) diff --git a/src/lxc/attach.c b/src/lxc/attach.c -index d7b16e34..ac4bd390 100644 +index d7b16e3..ac4bd39 100644 --- a/src/lxc/attach.c +++ b/src/lxc/attach.c @@ -1188,7 +1188,7 @@ static int create_attach_timeout_thread(int64_t attach_timeout, pid_t pid) @@ -35,7 +35,7 @@ index d7b16e34..ac4bd390 100644 ret = -1; goto out; diff --git a/src/lxc/commands.c b/src/lxc/commands.c -index 0802a167..fa02a4b7 100644 +index 0802a16..fa02a4b 100644 --- a/src/lxc/commands.c +++ b/src/lxc/commands.c @@ -1075,11 +1075,16 @@ int lxc_cmd_set_terminal_fifos(const char *name, const char *lxcpath, const char @@ -58,7 +58,7 @@ index 0802a167..fa02a4b7 100644 struct lxc_cmd_rr cmd = { .req = { diff --git a/src/lxc/conf.c b/src/lxc/conf.c -index 996d2671..3ecccbd6 100644 +index 996d267..3ecccbd 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -4393,7 +4393,11 @@ int lxc_drop_caps(struct lxc_conf *conf) @@ -126,7 +126,7 @@ index 996d2671..3ecccbd6 100644 goto on_error; } diff --git a/src/lxc/confile.c b/src/lxc/confile.c -index 8a082d55..a75e023b 100644 +index 8a082d5..a75e023 100644 --- a/src/lxc/confile.c +++ b/src/lxc/confile.c @@ -2318,13 +2318,13 @@ static int set_config_populate_device(const char *key, const char *value, @@ -164,7 +164,7 @@ index 8a082d55..a75e023b 100644 list_item->elem = safe_strdup(value); diff --git a/src/lxc/json/container_start_generate_config.c b/src/lxc/json/container_start_generate_config.c -index 5ec83114..3748973c 100644 +index 5ec8311..3748973 100644 --- a/src/lxc/json/container_start_generate_config.c +++ b/src/lxc/json/container_start_generate_config.c @@ -41,6 +41,11 @@ container_start_generate_config *make_container_start_generate_config(yajl_val t @@ -195,7 +195,7 @@ index 5ec83114..3748973c 100644 free_out: diff --git a/src/lxc/json/defs.c b/src/lxc/json/defs.c -index 8a052a88..4bf569a4 100644 +index 8a052a8..4bf569a 100644 --- a/src/lxc/json/defs.c +++ b/src/lxc/json/defs.c @@ -24,6 +24,10 @@ defs_hook *make_defs_hook(yajl_val tree, struct parser_context *ctx, parser_erro @@ -221,7 +221,7 @@ index 8a052a88..4bf569a4 100644 for (i = 0; i < YAJL_GET_ARRAY(tmp)->len; i++) { yajl_val val = YAJL_GET_ARRAY(tmp)->values[i]; diff --git a/src/lxc/json/json_common.c b/src/lxc/json/json_common.c -index 5da1e6de..ed2fe834 100755 +index 5da1e6d..ed2fe83 100755 --- a/src/lxc/json/json_common.c +++ b/src/lxc/json/json_common.c @@ -445,6 +445,9 @@ json_map_int_int *make_json_map_int_int(yajl_val src, struct parser_context *ctx @@ -420,7 +420,7 @@ index 5da1e6de..ed2fe834 100755 free(map->keys); map->keys = keys; diff --git a/src/lxc/json/logger_json_file.c b/src/lxc/json/logger_json_file.c -index 842d35b5..6abeef45 100644 +index 842d35b..6abeef4 100644 --- a/src/lxc/json/logger_json_file.c +++ b/src/lxc/json/logger_json_file.c @@ -230,8 +230,12 @@ char *logger_json_file_generate_json(logger_json_file *ptr, struct parser_contex @@ -438,7 +438,7 @@ index 842d35b5..6abeef45 100644 free_out: diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c -index 3b2c5af2..5a724838 100644 +index 3b2c5af..5a72483 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -928,6 +928,9 @@ static char **use_init_args(char **init_argv, size_t init_args) @@ -480,7 +480,7 @@ index 3b2c5af2..5a724838 100644 if (snprintf(fpath, PATH_MAX, "%s/%s/%s", c->config_path, c->name, START_GENERATE_CONFIG) < 0) { fprintf(stderr, "Sprintf config path failed\n"); diff --git a/src/lxc/path.c b/src/lxc/path.c -index c545887a..df285f54 100644 +index c545887..df285f5 100644 --- a/src/lxc/path.c +++ b/src/lxc/path.c @@ -58,7 +58,7 @@ char *preserve_trailing_dot_or_separator(const char *cleanedpath, @@ -511,7 +511,7 @@ index c545887a..df285f54 100644 return false; } diff --git a/src/lxc/start.c b/src/lxc/start.c -index d6c706e7..00d478c4 100644 +index d6c706e..00d478c 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -2383,7 +2383,7 @@ static int create_start_timeout_thread(struct lxc_conf *conf, unsigned int start @@ -542,7 +542,7 @@ index d6c706e7..00d478c4 100644 memset(handler, 0, sizeof(*handler)); diff --git a/src/lxc/terminal.c b/src/lxc/terminal.c -index b9b65c6f..1fee6516 100644 +index b9b65c6..1fee651 100644 --- a/src/lxc/terminal.c +++ b/src/lxc/terminal.c @@ -1330,7 +1330,7 @@ static int lxc_terminal_set_fifo(struct lxc_terminal *console, const char *in, c @@ -555,7 +555,7 @@ index b9b65c6f..1fee6516 100644 close(fifofd_in); if (fifofd_out >= 0) diff --git a/src/lxc/utils.c b/src/lxc/utils.c -index e6e8905b..656df4a3 100644 +index e6e8905..656df4a 100644 --- a/src/lxc/utils.c +++ b/src/lxc/utils.c @@ -1945,9 +1945,9 @@ static proc_t *lxc_stat2proc(const char *S) @@ -571,5 +571,5 @@ index e6e8905b..656df4a3 100644 /* parse these two strings separately, skipping the leading "(". */ num = sscanf(S, "%d (%15c", &P->pid, P->cmd); /* comm[16] in kernel */ -- -2.23.0 +1.8.3.1 diff --git a/0114-lxc-fix-code-errors.patch b/0114-lxc-fix-code-errors.patch index ba106ee34fdde751e1584b38403927cb556b3b5d..f91b579f1529723d5ef0c9b714f16417b9230b47 100644 --- a/0114-lxc-fix-code-errors.patch +++ b/0114-lxc-fix-code-errors.patch @@ -1,7 +1,7 @@ -From 703f8955560af26e5390f7e3ee493c3c8204cacb Mon Sep 17 00:00:00 2001 +From 0abcc74b3e18615af1ce0659a496f7a388efe8ae Mon Sep 17 00:00:00 2001 From: LiFeng Date: Thu, 4 Jul 2019 05:10:00 -0400 -Subject: [PATCH 114/131] lxc: fix code errors +Subject: [PATCH 114/138] lxc: fix code errors Signed-off-by: LiFeng --- @@ -12,7 +12,7 @@ Signed-off-by: LiFeng 4 files changed, 15 insertions(+), 24 deletions(-) diff --git a/src/lxc/attach.c b/src/lxc/attach.c -index ac4bd390..1f14eb45 100644 +index ac4bd39..1f14eb4 100644 --- a/src/lxc/attach.c +++ b/src/lxc/attach.c @@ -841,7 +841,7 @@ static int attach_child_main(struct attach_clone_payload *payload) @@ -65,7 +65,7 @@ index ac4bd390..1f14eb45 100644 goto on_error; } diff --git a/src/lxc/conf.c b/src/lxc/conf.c -index 3ecccbd6..e22e13e8 100644 +index 3ecccbd..e22e13e 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -4790,6 +4790,7 @@ static int run_ocihook_buffer(struct oci_hook_conf *oconf, const char *inmsg) @@ -108,7 +108,7 @@ index 3ecccbd6..e22e13e8 100644 free(err_args_msg); free(err_envs_msg); diff --git a/src/lxc/confile.c b/src/lxc/confile.c -index a75e023b..0537ebcf 100644 +index a75e023..0537ebc 100644 --- a/src/lxc/confile.c +++ b/src/lxc/confile.c @@ -3828,9 +3828,7 @@ static int get_config_prlimit(const char *key, char *retv, int inlen, @@ -134,7 +134,7 @@ index a75e023b..0537ebcf 100644 nret = snprintf(buf + partlen, (MAX_LIMIT_BUF_LEN - partlen), ":%" PRIu64, (uint64_t)lim->limit.rlim_max); if (nret < 0) { diff --git a/src/lxc/terminal.c b/src/lxc/terminal.c -index 1fee6516..32c69a49 100644 +index 1fee651..32c69a4 100644 --- a/src/lxc/terminal.c +++ b/src/lxc/terminal.c @@ -289,10 +289,8 @@ static int lxc_terminal_rotate_log_file(struct lxc_terminal *terminal) @@ -151,5 +151,5 @@ index 1fee6516..32c69a49 100644 ret = snprintf(tmp, len, "%s.1", terminal->log_path); if (ret < 0 || (size_t)ret >= len) { -- -2.23.0 +1.8.3.1 diff --git a/0115-fix-compile-error-on-ubuntu.patch b/0115-fix-compile-error-on-ubuntu.patch index a5590e5e6c138e9d947a913829c0bbaccf98a1a7..8cba5074efb2effc9e5e8f4c2f85e8642864fa4f 100644 --- a/0115-fix-compile-error-on-ubuntu.patch +++ b/0115-fix-compile-error-on-ubuntu.patch @@ -1,7 +1,7 @@ -From b1f801be29895369ae393b334005ad3bf87e371f Mon Sep 17 00:00:00 2001 +From 5ac103afa3420eb2d6c74c1502e274812d186db0 Mon Sep 17 00:00:00 2001 From: liuhao Date: Thu, 11 Jul 2019 17:42:00 +0800 -Subject: [PATCH 115/131] fix compile error on ubuntu +Subject: [PATCH 115/138] fix compile error on ubuntu fix compile error on ubuntu @@ -9,20 +9,20 @@ Signed-off-by: liuhao Signed-off-by: LiFeng --- configure.ac | 1 - - src/lxc/Makefile.am | 10 ++++- + src/lxc/Makefile.am | 10 ++++-- src/lxc/conf.c | 2 +- src/lxc/confile.c | 2 +- - src/lxc/isulad_utils.c | 87 ++++++++++++++++++++++++++++++++++++++++++ - src/lxc/isulad_utils.h | 13 +++++++ + src/lxc/isulad_utils.c | 87 ++++++++++++++++++++++++++++++++++++++++++++++++++ + src/lxc/isulad_utils.h | 13 ++++++++ src/lxc/path.c | 2 +- - src/lxc/utils.c | 82 +-------------------------------------- - src/lxc/utils.h | 6 +-- + src/lxc/utils.c | 82 +---------------------------------------------- + src/lxc/utils.h | 6 +--- 9 files changed, 113 insertions(+), 92 deletions(-) create mode 100644 src/lxc/isulad_utils.c create mode 100644 src/lxc/isulad_utils.h diff --git a/configure.ac b/configure.ac -index 5963fab1..dc85f746 100644 +index 5963fab..dc85f74 100644 --- a/configure.ac +++ b/configure.ac @@ -706,7 +706,6 @@ AX_CHECK_LINK_FLAG([-z relro], [LDFLAGS="$LDFLAGS -z relro"],,[]) @@ -34,7 +34,7 @@ index 5963fab1..dc85f746 100644 CFLAGS="$CFLAGS -Wvla -std=gnu11 -D_FORTIFY_SOURCE=2 -Wall -fPIC -fPIE -pie" if test "x$enable_werror" = "xyes"; then diff --git a/src/lxc/Makefile.am b/src/lxc/Makefile.am -index b24fcfdb..27240cc4 100644 +index b24fcfd..27240cc 100644 --- a/src/lxc/Makefile.am +++ b/src/lxc/Makefile.am @@ -50,6 +50,7 @@ noinst_HEADERS = attach.h \ @@ -96,7 +96,7 @@ index b24fcfdb..27240cc4 100644 namespace.c namespace.h \ string_utils.c string_utils.h diff --git a/src/lxc/conf.c b/src/lxc/conf.c -index e22e13e8..d9a7aae1 100644 +index e22e13e..d9a7aae 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -4934,7 +4934,7 @@ static int do_run_oci_hooks(const char *name, const char *lxcpath, struct lxc_co @@ -109,7 +109,7 @@ index e22e13e8..d9a7aae1 100644 break; case OCI_HOOK_POSTSTOP: diff --git a/src/lxc/confile.c b/src/lxc/confile.c -index 0537ebcf..01fc9443 100644 +index 0537ebc..01fc944 100644 --- a/src/lxc/confile.c +++ b/src/lxc/confile.c @@ -2212,7 +2212,7 @@ static int set_config_init_args(const char *key, const char *value, @@ -123,7 +123,7 @@ index 0537ebcf..01fc9443 100644 ret = set_config_string_item(&new_value, value); diff --git a/src/lxc/isulad_utils.c b/src/lxc/isulad_utils.c new file mode 100644 -index 00000000..66516a80 +index 0000000..66516a8 --- /dev/null +++ b/src/lxc/isulad_utils.c @@ -0,0 +1,87 @@ @@ -216,7 +216,7 @@ index 00000000..66516a80 +} diff --git a/src/lxc/isulad_utils.h b/src/lxc/isulad_utils.h new file mode 100644 -index 00000000..852d9562 +index 0000000..852d956 --- /dev/null +++ b/src/lxc/isulad_utils.h @@ -0,0 +1,13 @@ @@ -234,7 +234,7 @@ index 00000000..852d9562 + +#endif diff --git a/src/lxc/path.c b/src/lxc/path.c -index df285f54..7a5dce95 100644 +index df285f5..7a5dce9 100644 --- a/src/lxc/path.c +++ b/src/lxc/path.c @@ -10,7 +10,7 @@ @@ -247,7 +247,7 @@ index df285f54..7a5dce95 100644 lxc_log_define(lxc_path_ui, lxc); diff --git a/src/lxc/utils.c b/src/lxc/utils.c -index 656df4a3..1d2e9ee4 100644 +index 656df4a..1d2e9ee 100644 --- a/src/lxc/utils.c +++ b/src/lxc/utils.c @@ -57,6 +57,7 @@ @@ -344,7 +344,7 @@ index 656df4a3..1d2e9ee4 100644 -} - diff --git a/src/lxc/utils.h b/src/lxc/utils.h -index 0b33f690..1c9bf418 100644 +index 0b33f69..1c9bf41 100644 --- a/src/lxc/utils.h +++ b/src/lxc/utils.h @@ -42,6 +42,7 @@ @@ -367,5 +367,5 @@ index 0b33f690..1c9bf418 100644 #endif /* __LXC_UTILS_H */ -- -2.23.0 +1.8.3.1 diff --git a/0116-lxc-set-base-cgroup-path-to.patch b/0116-lxc-set-base-cgroup-path-to.patch index 0795fb91611d12be58fb5c2f63dad1f3f6045293..6aac9a6762f4a617d4c9a775bbd5d32183074c2e 100644 --- a/0116-lxc-set-base-cgroup-path-to.patch +++ b/0116-lxc-set-base-cgroup-path-to.patch @@ -1,7 +1,7 @@ -From e384c4e2a1088b2456ef58ed932218f5be77d349 Mon Sep 17 00:00:00 2001 +From 09e9d64eda0979b581e6941f7152643909a9a95c Mon Sep 17 00:00:00 2001 From: liuhao Date: Wed, 19 Jun 2019 16:48:50 +0800 -Subject: [PATCH 116/131] lxc: set base cgroup path to '/' +Subject: [PATCH 116/138] lxc: set base cgroup path to '/' reason:base cgroup may be started with /system.slice when cg_hybrid_init read /proc/1/cgroup on host, and cgroup init will set all containers @@ -16,7 +16,7 @@ Signed-off-by: LiFeng 1 file changed, 3 insertions(+) diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c -index 46f13f4d..7c92abe6 100644 +index 46f13f4..7c92abe 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -2545,6 +2545,9 @@ static bool cg_hybrid_init(struct cgroup_ops *ops) @@ -30,5 +30,5 @@ index 46f13f4d..7c92abe6 100644 char *cgv2_ctrl_path; -- -2.23.0 +1.8.3.1 diff --git a/0117-pupulate-device-with-dir-mode-750-and-set-uid-gid.patch b/0117-pupulate-device-with-dir-mode-750-and-set-uid-gid.patch index 85d7285cf670cce99a91db52af63be2327de059a..0494506c0ccd6012b1f8b504d693a65b6709a1cf 100644 --- a/0117-pupulate-device-with-dir-mode-750-and-set-uid-gid.patch +++ b/0117-pupulate-device-with-dir-mode-750-and-set-uid-gid.patch @@ -1,7 +1,7 @@ -From 6f4194128b0387e19f5e7ad65bfa157f52335871 Mon Sep 17 00:00:00 2001 +From 3d13f72c92b0a40b97cfd708a56d9abaad9c1610 Mon Sep 17 00:00:00 2001 From: LiFeng Date: Wed, 31 Jul 2019 05:24:11 -0400 -Subject: [PATCH 117/131] pupulate device with dir mode 750 and set uid/gid +Subject: [PATCH 117/138] pupulate device with dir mode 750 and set uid/gid Signed-off-by: LiFeng --- @@ -10,7 +10,7 @@ Signed-off-by: LiFeng 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/lxc/conf.c b/src/lxc/conf.c -index d9a7aae1..0b10a2dd 100644 +index d9a7aae..0b10a2d 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -4005,13 +4005,11 @@ static int setup_populate_devs(const struct lxc_rootfs *rootfs, struct lxc_list @@ -36,7 +36,7 @@ index d9a7aae1..0b10a2dd 100644 INFO("Populated devices into container /dev"); return 0; diff --git a/src/lxc/confile.c b/src/lxc/confile.c -index 01fc9443..3a02e099 100644 +index 01fc944..3a02e09 100644 --- a/src/lxc/confile.c +++ b/src/lxc/confile.c @@ -2335,6 +2335,8 @@ static int set_config_populate_device(const char *key, const char *value, @@ -49,5 +49,5 @@ index 01fc9443..3a02e099 100644 lxc_list_add_elem(dev_list, dev_elem); -- -2.23.0 +1.8.3.1 diff --git a/0118-fix-sscanf-return-value-check.patch b/0118-fix-sscanf-return-value-check.patch index b90523186be51d5aba1f5eac0d01b47b5a01ccf3..4c469f9d96f25a706cf2c01f551b2b786c45ec4f 100644 --- a/0118-fix-sscanf-return-value-check.patch +++ b/0118-fix-sscanf-return-value-check.patch @@ -1,7 +1,7 @@ -From 2c693d3ec05daf3c647bf87fdc4f1fcab2f43741 Mon Sep 17 00:00:00 2001 +From 5db3f150f53867f3b5e55bd3dd6b5b3f7d3916ab Mon Sep 17 00:00:00 2001 From: LiFeng Date: Mon, 2 Sep 2019 06:24:07 -0400 -Subject: [PATCH 118/131] fix sscanf return value check +Subject: [PATCH 118/138] fix sscanf return value check Signed-off-by: LiFeng --- @@ -10,7 +10,7 @@ Signed-off-by: LiFeng 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/lxc/start.c b/src/lxc/start.c -index 00d478c4..c1e0d5d2 100644 +index 00d478c..c1e0d5d 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -1904,7 +1904,7 @@ static int lxc_check_container_info(char *filename, pid_t pid, pid_t p_pid, unsi @@ -23,7 +23,7 @@ index 00d478c4..c1e0d5d2 100644 ret = -1; goto out; diff --git a/src/lxc/utils.c b/src/lxc/utils.c -index 1d2e9ee4..c83c7a38 100644 +index 1d2e9ee..c83c7a3 100644 --- a/src/lxc/utils.c +++ b/src/lxc/utils.c @@ -1952,8 +1952,8 @@ static proc_t *lxc_stat2proc(const char *S) @@ -51,5 +51,5 @@ index 1d2e9ee4..c83c7a38 100644 P->tty = -1; /* the old notty val, update elsewhere bef. moving to 0 */ return P; -- -2.23.0 +1.8.3.1 diff --git a/0119-remove-unuse-binary.patch b/0119-remove-unuse-binary.patch index 353838067cf3e4d2e32122cd729c4f3f36d10818..37ce44d2034a369e1d98c7b2f936e0504a2c67f9 100644 --- a/0119-remove-unuse-binary.patch +++ b/0119-remove-unuse-binary.patch @@ -1,7 +1,7 @@ -From 37d15f82b25e21c466b6632d8e56b50d60cb0444 Mon Sep 17 00:00:00 2001 +From 8a67511e42e7c6ebeb28df2feeb8ee0774995822 Mon Sep 17 00:00:00 2001 From: LiuHao Date: Wed, 4 Sep 2019 18:01:39 +0800 -Subject: [PATCH 119/131] remove unuse binary +Subject: [PATCH 119/138] remove unuse binary Signed-off-by: LiuHao --- @@ -9,7 +9,7 @@ Signed-off-by: LiuHao 1 file changed, 11 deletions(-) diff --git a/hooks/Makefile.am b/hooks/Makefile.am -index 5ae73d72..f55c4a90 100644 +index 5ae73d7..f55c4a9 100644 --- a/hooks/Makefile.am +++ b/hooks/Makefile.am @@ -10,15 +10,4 @@ hooks_SCRIPTS = \ @@ -29,5 +29,5 @@ index 5ae73d72..f55c4a90 100644 - EXTRA_DIST=$(hooks_SCRIPTS) -- -2.23.0 +1.8.3.1 diff --git a/0120-remove-unuse-unmount-namespace.patch b/0120-remove-unuse-unmount-namespace.patch index ba176e75b1a74881c0da2246c58a18bb6d5852b3..414d08e09b5f95d5862d3bf633d4900132bb6133 100644 --- a/0120-remove-unuse-unmount-namespace.patch +++ b/0120-remove-unuse-unmount-namespace.patch @@ -1,7 +1,7 @@ -From 57584932914c0979260573e6c599f59688629019 Mon Sep 17 00:00:00 2001 +From 762e925625752a52c30dd55d28b210c659869f9c Mon Sep 17 00:00:00 2001 From: LiuHao Date: Thu, 5 Sep 2019 11:48:57 +0800 -Subject: [PATCH 120/131] remove unuse unmount-namespace +Subject: [PATCH 120/138] remove unuse unmount-namespace Signed-off-by: LiuHao --- @@ -9,7 +9,7 @@ Signed-off-by: LiuHao 1 file changed, 1 deletion(-) diff --git a/lxc.spec.in b/lxc.spec.in -index 7fcd811f..2ca12fef 100644 +index 7fcd811..2ca12fe 100644 --- a/lxc.spec.in +++ b/lxc.spec.in @@ -259,7 +259,6 @@ fi @@ -21,5 +21,5 @@ index 7fcd811f..2ca12fef 100644 %{_libexecdir}/%{name}/lxc-monitord %attr(4111,root,root) %{_libexecdir}/%{name}/lxc-user-nic -- -2.23.0 +1.8.3.1 diff --git a/0121-optimize-log-when-root-path-is-invalid.patch b/0121-optimize-log-when-root-path-is-invalid.patch index a52c549535bc3b4e9d9b1b7ad005e90104b12ebb..a50ea649a2d5c6be18fb48b84ca6776c5b7bca4d 100644 --- a/0121-optimize-log-when-root-path-is-invalid.patch +++ b/0121-optimize-log-when-root-path-is-invalid.patch @@ -1,7 +1,7 @@ -From 326d45d73d0061431822040a37ced879f3c6b490 Mon Sep 17 00:00:00 2001 +From 3decb2d204e100397d97a32495d547ed0685756a Mon Sep 17 00:00:00 2001 From: TanYifeng Date: Sat, 21 Sep 2019 06:19:25 -0400 -Subject: [PATCH 121/131] optimize log when root path is invalid +Subject: [PATCH 121/138] optimize log when root path is invalid Signed-off-by: TanYifeng --- @@ -9,7 +9,7 @@ Signed-off-by: TanYifeng 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lxc/conf.c b/src/lxc/conf.c -index 0b10a2dd..5fd65e73 100644 +index 0b10a2d..5fd65e7 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -4881,7 +4881,7 @@ static char *get_root_path(const char *path, const char *backend) @@ -22,5 +22,5 @@ index 0b10a2dd..5fd65e73 100644 } tmp++; -- -2.23.0 +1.8.3.1 diff --git a/0122-lxc-fix-code-reivew-errors.patch b/0122-lxc-fix-code-reivew-errors.patch index ead32d7787c757ee8d2cf0c6ad994c3d9b39e7b8..6ee5f01cfe9be317e2f1a4b7d705f9e7183e81ca 100644 --- a/0122-lxc-fix-code-reivew-errors.patch +++ b/0122-lxc-fix-code-reivew-errors.patch @@ -1,7 +1,7 @@ -From 61e763bceb56821eb36b4c8efda510e1a55394ff Mon Sep 17 00:00:00 2001 +From afce33825ae2368d613617d3483000c7dc785930 Mon Sep 17 00:00:00 2001 From: LiFeng Date: Thu, 26 Sep 2019 07:47:19 -0400 -Subject: [PATCH 122/131] lxc: fix code reivew errors +Subject: [PATCH 122/138] lxc: fix code reivew errors Signed-off-by: LiFeng --- @@ -15,7 +15,7 @@ Signed-off-by: LiFeng 7 files changed, 19 insertions(+), 20 deletions(-) diff --git a/src/lxc/commands.c b/src/lxc/commands.c -index fa02a4b7..7d6cf6f3 100644 +index fa02a4b..7d6cf6f 100644 --- a/src/lxc/commands.c +++ b/src/lxc/commands.c @@ -1083,7 +1083,7 @@ int lxc_cmd_set_terminal_fifos(const char *name, const char *lxcpath, const char @@ -28,7 +28,7 @@ index fa02a4b7..7d6cf6f3 100644 struct lxc_cmd_rr cmd = { diff --git a/src/lxc/commands_utils.c b/src/lxc/commands_utils.c -index f48f1188..56ecce7d 100644 +index f48f118..56ecce7 100644 --- a/src/lxc/commands_utils.c +++ b/src/lxc/commands_utils.c @@ -144,7 +144,7 @@ int lxc_make_abstract_socket_name(char *path, size_t pathlen, @@ -41,7 +41,7 @@ index f48f1188..56ecce7d 100644 return -1; } diff --git a/src/lxc/confile.c b/src/lxc/confile.c -index 3a02e099..3eaae4a9 100644 +index 3a02e09..3eaae4a 100644 --- a/src/lxc/confile.c +++ b/src/lxc/confile.c @@ -3834,7 +3834,7 @@ static int get_config_prlimit(const char *key, char *retv, int inlen, @@ -63,7 +63,7 @@ index 3a02e099..3eaae4a9 100644 } } diff --git a/src/lxc/json/json_common.c b/src/lxc/json/json_common.c -index ed2fe834..ec20c598 100755 +index ed2fe83..ec20c59 100755 --- a/src/lxc/json/json_common.c +++ b/src/lxc/json/json_common.c @@ -17,7 +17,7 @@ yajl_gen_status reformat_uint(void *ctx, long long unsigned int num) { @@ -124,7 +124,7 @@ index ed2fe834..ec20c598 100755 *(err) = safe_strdup("error allocating memory"); } diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c -index 5a724838..9f9cbfc3 100644 +index 5a72483..9f9cbfc 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -3200,7 +3200,7 @@ static bool container_destroy(struct lxc_container *c, @@ -155,7 +155,7 @@ index 5a724838..9f9cbfc3 100644 return -1; } diff --git a/src/lxc/terminal.c b/src/lxc/terminal.c -index 32c69a49..e81f57ee 100644 +index 32c69a4..e81f57e 100644 --- a/src/lxc/terminal.c +++ b/src/lxc/terminal.c @@ -242,13 +242,13 @@ static int lxc_terminal_rename_old_log_file(struct lxc_terminal *terminal) @@ -193,7 +193,7 @@ index 32c69a49..e81f57ee 100644 } diff --git a/src/lxc/utils.c b/src/lxc/utils.c -index c83c7a38..31bcac71 100644 +index c83c7a3..31bcac7 100644 --- a/src/lxc/utils.c +++ b/src/lxc/utils.c @@ -2041,7 +2041,7 @@ void lxc_write_error_message(int errfd, const char *format, ...) @@ -206,5 +206,5 @@ index c83c7a38..31bcac71 100644 sret = write(errfd, errbuf, strlen(errbuf)); if (sret < 0) -- -2.23.0 +1.8.3.1 diff --git a/0123-in-accordance-with-hook-spec-in-oci.patch b/0123-in-accordance-with-hook-spec-in-oci.patch index 4cf430a78dbf9bed6ea51f7c677b313efe2ed1ef..0810c4b01a8715df2455470b4afd73aa3b7a5a63 100644 --- a/0123-in-accordance-with-hook-spec-in-oci.patch +++ b/0123-in-accordance-with-hook-spec-in-oci.patch @@ -1,7 +1,7 @@ -From eb283f2a97b6c409ba516a7ab29bb5ad4f86c0db Mon Sep 17 00:00:00 2001 +From 41a5e567cf02b18bf623e439a2457fb3ce95d8fb Mon Sep 17 00:00:00 2001 From: LiuHao Date: Mon, 25 Nov 2019 21:15:40 +0800 -Subject: [PATCH 123/131] in accordance with hook spec in oci +Subject: [PATCH 123/138] in accordance with hook spec in oci Signed-off-by: LiuHao --- @@ -11,7 +11,7 @@ Signed-off-by: LiuHao 3 files changed, 9 insertions(+), 15 deletions(-) diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c -index 7c92abe6..87b49b0f 100644 +index 7c92abe..87b49b0 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -2013,8 +2013,8 @@ __cgfsng_ops static bool cgfsng_attach(struct cgroup_ops *ops, const char *name, @@ -26,7 +26,7 @@ index 7c92abe6..87b49b0f 100644 fullpath = build_full_cgpath_from_monitorpath(h, path, "cgroup.procs"); free(path); diff --git a/src/lxc/conf.c b/src/lxc/conf.c -index 5fd65e73..21ec340f 100644 +index 5fd65e7..21ec340 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -4937,9 +4937,9 @@ static int do_run_oci_hooks(const char *name, const char *lxcpath, struct lxc_co @@ -43,7 +43,7 @@ index 5fd65e73..21ec340f 100644 break; default: diff --git a/src/lxc/start.c b/src/lxc/start.c -index c1e0d5d2..7246283e 100644 +index c1e0d5d..7246283 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -1185,14 +1185,11 @@ void lxc_fini(const char *name, struct lxc_handler *handler) @@ -77,5 +77,5 @@ index c1e0d5d2..7246283e 100644 if (run_oci_hooks(handler->name, "oci-poststop", handler->conf, handler->lxcpath)) { ERROR("Failed to run lxc.hook.post-stop for container \"%s\".", handler->name); -- -2.23.0 +1.8.3.1 diff --git a/0124-lxc-close-maincmd-fd-before-destroy-cgroup.patch b/0124-lxc-close-maincmd-fd-before-destroy-cgroup.patch index 001e65c2a522728a7be0fc5609c48a5c3af43be7..a44462c53013cfa26a50f5b940da506ded194188 100644 --- a/0124-lxc-close-maincmd-fd-before-destroy-cgroup.patch +++ b/0124-lxc-close-maincmd-fd-before-destroy-cgroup.patch @@ -1,7 +1,7 @@ -From 8f85eda569912dce488d2e951f853958ba800ada Mon Sep 17 00:00:00 2001 +From 754525a09827844e9b309c659f745509c3ae4ebc Mon Sep 17 00:00:00 2001 From: LiFeng Date: Wed, 27 Nov 2019 22:33:46 -0500 -Subject: [PATCH 124/131] lxc: close maincmd fd before destroy cgroup +Subject: [PATCH 124/138] lxc: close maincmd fd before destroy cgroup Signed-off-by: LiFeng --- @@ -10,7 +10,7 @@ Signed-off-by: LiFeng 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c -index 87b49b0f..c96285e1 100644 +index 87b49b0..c96285e 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -2013,8 +2013,10 @@ __cgfsng_ops static bool cgfsng_attach(struct cgroup_ops *ops, const char *name, @@ -27,7 +27,7 @@ index 87b49b0f..c96285e1 100644 fullpath = build_full_cgpath_from_monitorpath(h, path, "cgroup.procs"); free(path); diff --git a/src/lxc/start.c b/src/lxc/start.c -index 7246283e..63be4e3e 100644 +index 7246283..63be4e3 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -1185,19 +1185,6 @@ void lxc_fini(const char *name, struct lxc_handler *handler) @@ -98,5 +98,5 @@ index 7246283e..63be4e3e 100644 usleep(100 * 1000); /* 100 millisecond */ retry_count++; -- -2.23.0 +1.8.3.1 diff --git a/0125-lxc-fix-strcat-bug-in-cleanpath.patch b/0125-lxc-fix-strcat-bug-in-cleanpath.patch index 871d66f06d7adae7058dee2df50fa0d44693f17b..15663d54bd6c1bfbfb06a2dc3c1b47a5c445c842 100644 --- a/0125-lxc-fix-strcat-bug-in-cleanpath.patch +++ b/0125-lxc-fix-strcat-bug-in-cleanpath.patch @@ -1,7 +1,7 @@ -From b6bbee74d4021f0063fabf64be0dae7fcc6a480e Mon Sep 17 00:00:00 2001 +From e9481f7fe1bdd47b1df75c96654c88a606730a2f Mon Sep 17 00:00:00 2001 From: LiFeng Date: Fri, 29 Nov 2019 22:16:05 -0500 -Subject: [PATCH 125/131] lxc: fix strcat bug in cleanpath +Subject: [PATCH 125/138] lxc: fix strcat bug in cleanpath Signed-off-by: LiFeng --- @@ -9,7 +9,7 @@ Signed-off-by: LiFeng 1 file changed, 4 insertions(+) diff --git a/src/lxc/path.c b/src/lxc/path.c -index 7a5dce95..083893e7 100644 +index 7a5dce9..083893e 100644 --- a/src/lxc/path.c +++ b/src/lxc/path.c @@ -200,6 +200,10 @@ char *cleanpath(const char *path, char *realpath, size_t realpath_len) @@ -24,5 +24,5 @@ index 7a5dce95..083893e7 100644 stpos = path; } else { -- -2.23.0 +1.8.3.1 diff --git a/0126-add-user-option-for-lxc-attach.patch b/0126-add-user-option-for-lxc-attach.patch index d45d7d65d159c2a0d80486e28de33997e714ce08..505e2e8a3c6693a60103fc197f6b76fe45e714c8 100644 --- a/0126-add-user-option-for-lxc-attach.patch +++ b/0126-add-user-option-for-lxc-attach.patch @@ -1,15 +1,15 @@ -From 37a243271540f6f5be2a5cdd01460cf68b92bcf3 Mon Sep 17 00:00:00 2001 +From cab7334deeb38b530bdb37e52b5f3a6dc58562d7 Mon Sep 17 00:00:00 2001 From: wujing Date: Wed, 30 Oct 2019 18:41:02 +0800 -Subject: [PATCH 126/131] add user option for lxc-attach +Subject: [PATCH 126/138] add user option for lxc-attach Signed-off-by: wujing --- - src/lxc/tools/lxc_attach.c | 75 ++++++++++++++++++++++++++++++++++++++ + src/lxc/tools/lxc_attach.c | 75 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/src/lxc/tools/lxc_attach.c b/src/lxc/tools/lxc_attach.c -index 7d51ad72..0d401555 100644 +index 7d51ad7..0d40155 100644 --- a/src/lxc/tools/lxc_attach.c +++ b/src/lxc/tools/lxc_attach.c @@ -62,6 +62,8 @@ static char **extra_env; @@ -130,5 +130,5 @@ index 7d51ad72..0d401555 100644 if (my_args.argc > 0) { command.program = my_args.argv[0]; -- -2.23.0 +1.8.3.1 diff --git a/0127-log-only-write-size-begin-if-buffer-is-full.patch b/0127-log-only-write-size-begin-if-buffer-is-full.patch index 4e22780b9cd9141026d11a6b507d8dd0251065c7..fcb06b3d1b07b6e4652577c23bbabc51e0c03b6e 100644 --- a/0127-log-only-write-size-begin-if-buffer-is-full.patch +++ b/0127-log-only-write-size-begin-if-buffer-is-full.patch @@ -1,7 +1,7 @@ -From 331f06d4322e17db05949ee29cd1fe92217b73f5 Mon Sep 17 00:00:00 2001 +From 396928f93365c2eb6f19a3d0d87394fcd43dcef0 Mon Sep 17 00:00:00 2001 From: TanYifeng Date: Tue, 3 Dec 2019 22:43:25 -0500 -Subject: [PATCH 127/131] log: only write (size - begin) if buffer is full +Subject: [PATCH 127/138] log: only write (size - begin) if buffer is full Signed-off-by: TanYifeng --- @@ -9,7 +9,7 @@ Signed-off-by: TanYifeng 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lxc/terminal.c b/src/lxc/terminal.c -index e81f57ee..b547013c 100644 +index e81f57e..b547013 100644 --- a/src/lxc/terminal.c +++ b/src/lxc/terminal.c @@ -538,7 +538,7 @@ static int lxc_terminal_write_log_file(struct lxc_terminal *terminal, const char @@ -22,5 +22,5 @@ index e81f57ee..b547013c 100644 WARN("Failed to log msg"); } -- -2.23.0 +1.8.3.1 diff --git a/0128-link-proc-mounts-to-etc-mtab.patch b/0128-link-proc-mounts-to-etc-mtab.patch index 5f93003a560b986e478ce847d6dab41498e780ce..f9f7559f22db2cd01ab7142449a819823853c99d 100644 --- a/0128-link-proc-mounts-to-etc-mtab.patch +++ b/0128-link-proc-mounts-to-etc-mtab.patch @@ -1,7 +1,7 @@ -From 9735e11b3ecbaab9c3028d467c2b1706bcaff7bc Mon Sep 17 00:00:00 2001 +From a2c36d77465b337a2172ca7d1fee3b4918eaf550 Mon Sep 17 00:00:00 2001 From: wujing Date: Tue, 10 Dec 2019 21:28:47 +0800 -Subject: [PATCH 128/131] link /proc/mounts to /etc/mtab +Subject: [PATCH 128/138] link /proc/mounts to /etc/mtab Signed-off-by: wujing --- @@ -9,7 +9,7 @@ Signed-off-by: wujing 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/src/lxc/conf.c b/src/lxc/conf.c -index 21ec340f..b66e7bcf 100644 +index 21ec340..b66e7bc 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -4101,6 +4101,37 @@ static int setup_rootfs_mountopts(const struct lxc_rootfs *rootfs) @@ -73,5 +73,5 @@ index 21ec340f..b66e7bcf 100644 if (!lxc_list_empty(&lxc_conf->caps)) { ERROR("Container requests lxc.cap.drop and " -- -2.23.0 +1.8.3.1 diff --git a/0129-cgfsng-add-retry-for-enter-cgroup.patch b/0129-cgfsng-add-retry-for-enter-cgroup.patch index 90f39fdf9a397c824e528269a8c798aaeec5f531..5a88105a009c829d2bb7d6ebfa008a3850daec7d 100644 --- a/0129-cgfsng-add-retry-for-enter-cgroup.patch +++ b/0129-cgfsng-add-retry-for-enter-cgroup.patch @@ -1,7 +1,7 @@ -From 2e2f66f4d2dc0eec584cb701649e20d9cf6eebc5 Mon Sep 17 00:00:00 2001 +From aed5ecb69d2256933b431eac01e83e69bb72c753 Mon Sep 17 00:00:00 2001 From: LiFeng Date: Tue, 10 Dec 2019 05:40:20 -0500 -Subject: [PATCH 129/131] cgfsng: add retry for enter cgroup +Subject: [PATCH 129/138] cgfsng: add retry for enter cgroup Signed-off-by: LiFeng --- @@ -9,7 +9,7 @@ Signed-off-by: LiFeng 1 file changed, 25 insertions(+) diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c -index c96285e1..50bdc771 100644 +index c96285e..50bdc77 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -1300,11 +1300,23 @@ __cgfsng_ops static bool cgfsng_payload_enter(struct cgroup_ops *ops, pid_t pid) @@ -66,5 +66,5 @@ index c96285e1..50bdc771 100644 "%s:%d: setting cgroup config for ready process caused \"failed to write %s to %s: %s\".", __FILE__, __LINE__, value, fullpath, strerror(errno)); -- -2.23.0 +1.8.3.1 diff --git a/0130-fix-snprintf-create-abstract-socket-name-bug.patch b/0130-fix-snprintf-create-abstract-socket-name-bug.patch index 7f0818f00ed4cf6e86f88c921a43a2139ab9fafd..e71d09e436eb42840435117036f9b064584d193f 100644 --- a/0130-fix-snprintf-create-abstract-socket-name-bug.patch +++ b/0130-fix-snprintf-create-abstract-socket-name-bug.patch @@ -1,7 +1,7 @@ -From 022bf651ae6a068f7cbaa608432fd3c09d783e03 Mon Sep 17 00:00:00 2001 +From 54ca113d0c93b819ed20edf83ef85dccd584c87a Mon Sep 17 00:00:00 2001 From: wujing Date: Tue, 17 Dec 2019 21:24:24 +0800 -Subject: [PATCH 130/131] fix snprintf create abstract socket name bug +Subject: [PATCH 130/138] fix snprintf create abstract socket name bug Signed-off-by: wujing --- @@ -9,7 +9,7 @@ Signed-off-by: wujing 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lxc/commands_utils.c b/src/lxc/commands_utils.c -index 56ecce7d..f48f1188 100644 +index 56ecce7..f48f118 100644 --- a/src/lxc/commands_utils.c +++ b/src/lxc/commands_utils.c @@ -144,7 +144,7 @@ int lxc_make_abstract_socket_name(char *path, size_t pathlen, @@ -22,5 +22,5 @@ index 56ecce7d..f48f1188 100644 return -1; } -- -2.23.0 +1.8.3.1 diff --git a/0131-fix-commands-and-terminal-memory-leak-bug.patch b/0131-fix-commands-and-terminal-memory-leak-bug.patch index 32d808947f8cdd5f1dd683f92e15d17ae239a27e..49baeb98d9de6d01e8486f3ec3eb4fd0ec206a31 100644 --- a/0131-fix-commands-and-terminal-memory-leak-bug.patch +++ b/0131-fix-commands-and-terminal-memory-leak-bug.patch @@ -1,7 +1,7 @@ -From 6556417fa407074368a0b959fd478b8816d7c796 Mon Sep 17 00:00:00 2001 +From 6e5ce4f3e23cb7cb5ccfba058b6aca8829e2fa87 Mon Sep 17 00:00:00 2001 From: wujing Date: Wed, 18 Dec 2019 15:44:19 +0800 -Subject: [PATCH 131/131] fix commands and terminal memory leak bug +Subject: [PATCH 131/138] fix commands and terminal memory leak bug Signed-off-by: wujing --- @@ -10,7 +10,7 @@ Signed-off-by: wujing 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lxc/commands.c b/src/lxc/commands.c -index 7d6cf6f3..b70564fd 100644 +index 7d6cf6f..b70564f 100644 --- a/src/lxc/commands.c +++ b/src/lxc/commands.c @@ -1083,8 +1083,11 @@ int lxc_cmd_set_terminal_fifos(const char *name, const char *lxcpath, const char @@ -27,7 +27,7 @@ index 7d6cf6f3..b70564fd 100644 struct lxc_cmd_rr cmd = { .req = { diff --git a/src/lxc/terminal.c b/src/lxc/terminal.c -index b547013c..bccc23d9 100644 +index b547013..bccc23d 100644 --- a/src/lxc/terminal.c +++ b/src/lxc/terminal.c @@ -243,6 +243,7 @@ static int lxc_terminal_rename_old_log_file(struct lxc_terminal *terminal) @@ -39,5 +39,5 @@ index b547013c..bccc23d9 100644 } free(rename_fname); -- -2.23.0 +1.8.3.1 diff --git a/0132-lxc-fix-bug-in-cgroup-parent.patch b/0132-lxc-fix-bug-in-cgroup-parent.patch new file mode 100644 index 0000000000000000000000000000000000000000..6631b1133157a917db2a017fbf35948ac9b6dabc --- /dev/null +++ b/0132-lxc-fix-bug-in-cgroup-parent.patch @@ -0,0 +1,169 @@ +From 62b1de26a3b8bafbe3e3e2da56176dc7c82e4e25 Mon Sep 17 00:00:00 2001 +From: LiFeng +Date: Wed, 18 Dec 2019 06:00:58 -0500 +Subject: [PATCH 132/138] lxc: fix bug in cgroup-parent + +Signed-off-by: LiFeng +--- + src/lxc/cgroups/cgfsng.c | 78 ++++++++++++++++++++++++++++-------------------- + 1 file changed, 46 insertions(+), 32 deletions(-) + +diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c +index 50bdc77..2f86a66 100644 +--- a/src/lxc/cgroups/cgfsng.c ++++ b/src/lxc/cgroups/cgfsng.c +@@ -557,45 +557,24 @@ on_error: + return false; + } + +-/* Initialize the cpuset hierarchy in first directory of @gname and set +- * cgroup.clone_children so that children inherit settings. Since the +- * h->base_path is populated by init or ourselves, we know it is already +- * initialized. +- */ +-static bool cg_legacy_handle_cpuset_hierarchy(struct hierarchy *h, char *cgname) ++static bool build_sub_cpuset_cgroup_dir(char *cgpath) + { + int ret; + char v; +- char *cgpath, *clonechildrenpath, *slash; +- +- if (!string_in_list(h->controllers, "cpuset")) +- return true; +- +- if (*cgname == '/') +- cgname++; +- slash = strchr(cgname, '/'); +- if (slash) +- *slash = '\0'; +- +- cgpath = must_make_path(h->mountpoint, h->container_base_path, cgname, NULL); +- if (slash) +- *slash = '/'; ++ char *clonechildrenpath = NULL; + + ret = mkdir_p(cgpath, 0755); + if (ret < 0) { + if (errno != EEXIST) { + SYSERROR("Failed to create directory \"%s\"", cgpath); +- free(cgpath); + return false; + } + } + +- clonechildrenpath = +- must_make_path(cgpath, "cgroup.clone_children", NULL); ++ clonechildrenpath = must_make_path(cgpath, "cgroup.clone_children", NULL); + /* unified hierarchy doesn't have clone_children */ + if (!file_exists(clonechildrenpath)) { + free(clonechildrenpath); +- free(cgpath); + return true; + } + +@@ -603,7 +582,6 @@ static bool cg_legacy_handle_cpuset_hierarchy(struct hierarchy *h, char *cgname) + if (ret < 0) { + SYSERROR("Failed to read file \"%s\"", clonechildrenpath); + free(clonechildrenpath); +- free(cgpath); + return false; + } + +@@ -611,7 +589,6 @@ static bool cg_legacy_handle_cpuset_hierarchy(struct hierarchy *h, char *cgname) + if (!cg_legacy_filter_and_set_cpus(cgpath, v == '1')) { + SYSERROR("Failed to remove isolated cpus"); + free(clonechildrenpath); +- free(cgpath); + return false; + } + +@@ -619,18 +596,15 @@ static bool cg_legacy_handle_cpuset_hierarchy(struct hierarchy *h, char *cgname) + if (v == '1') { + DEBUG("\"cgroup.clone_children\" was already set to \"1\""); + free(clonechildrenpath); +- free(cgpath); + return true; + } + + /* copy parent's settings */ + if (!copy_parent_file(cgpath, "cpuset.mems")) { + SYSERROR("Failed to copy \"cpuset.mems\" settings"); +- free(cgpath); + free(clonechildrenpath); + return false; + } +- free(cgpath); + + ret = lxc_write_to_file(clonechildrenpath, "1", 1, false, 0666); + if (ret < 0) { +@@ -641,6 +615,48 @@ static bool cg_legacy_handle_cpuset_hierarchy(struct hierarchy *h, char *cgname) + } + free(clonechildrenpath); + return true; ++ ++} ++ ++/* Initialize the cpuset hierarchy in first directory of @gname and set ++ * cgroup.clone_children so that children inherit settings. Since the ++ * h->base_path is populated by init or ourselves, we know it is already ++ * initialized. ++ */ ++static bool cg_legacy_handle_cpuset_hierarchy(struct hierarchy *h, char *cgname) ++{ ++ char *cgpath, *slash; ++ bool sub_mk_success = false; ++ ++ if (!string_in_list(h->controllers, "cpuset")) ++ return true; ++ ++ cgname += strspn(cgname, "/"); ++ ++ slash = strchr(cgname, '/'); ++ ++ if (slash != NULL) { ++ while (slash) { ++ *slash = '\0'; ++ cgpath = must_make_path(h->mountpoint, h->container_base_path, cgname, NULL); ++ sub_mk_success = build_sub_cpuset_cgroup_dir(cgpath); ++ free(cgpath); ++ *slash = '/'; ++ if (!sub_mk_success) { ++ return false; ++ } ++ slash = strchr(slash + 1, '/'); ++ } ++ } else { ++ cgpath = must_make_path(h->mountpoint, h->container_base_path, cgname, NULL); ++ sub_mk_success = build_sub_cpuset_cgroup_dir(cgpath); ++ free(cgpath); ++ if (!sub_mk_success) { ++ return false; ++ } ++ } ++ ++ return true; + } + + /* Given two null-terminated lists of strings, return true if any string is in +@@ -1207,9 +1223,7 @@ static int mkdir_eexist_on_last(const char *dir, mode_t mode) + { + const char *tmp = dir; + const char *orig = dir; +- size_t orig_len; + +- orig_len = strlen(dir); + do { + int ret; + size_t cur_len; +@@ -1226,7 +1240,7 @@ static int mkdir_eexist_on_last(const char *dir, mode_t mode) + + ret = mkdir(makeme, mode); + if (ret < 0) { +- if ((errno != EEXIST) || (orig_len == cur_len)) { ++ if (errno != EEXIST) { + SYSERROR("Failed to create directory \"%s\"", makeme); + free(makeme); + return -1; +-- +1.8.3.1 + diff --git a/0133-lxc-fix-bug-in-cgfsng.patch b/0133-lxc-fix-bug-in-cgfsng.patch new file mode 100644 index 0000000000000000000000000000000000000000..227180d3db2bb5cf86794dfefd6389ae69bcb119 --- /dev/null +++ b/0133-lxc-fix-bug-in-cgfsng.patch @@ -0,0 +1,179 @@ +From ec306b448b42349c5c62e1639b25d257db438d7d Mon Sep 17 00:00:00 2001 +From: LiFeng +Date: Wed, 18 Dec 2019 09:01:25 -0500 +Subject: [PATCH 133/138] lxc: fix bug in cgfsng + +Signed-off-by: LiFeng +--- + src/lxc/cgroups/cgfsng.c | 100 +++++++++++++++++++++++------------------------ + 1 file changed, 50 insertions(+), 50 deletions(-) + +diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c +index 2f86a66..5908c31 100644 +--- a/src/lxc/cgroups/cgfsng.c ++++ b/src/lxc/cgroups/cgfsng.c +@@ -387,14 +387,8 @@ static bool cg_legacy_filter_and_set_cpus(char *path, bool am_initialized) + char *cpulist = NULL, *isolcpus = NULL, *posscpus = NULL; + uint32_t *isolmask = NULL, *possmask = NULL; + bool bret = false, flipped_bit = false; ++ bool need_read_parent = false; + +- lastslash = strrchr(path, '/'); +- if (!lastslash) { +- ERROR("Failed to detect \"/\" in \"%s\"", path); +- return bret; +- } +- oldv = *lastslash; +- *lastslash = '\0'; + fpath = must_make_path(path, "cpuset.cpus", NULL); + posscpus = read_file(fpath); + if (!posscpus) { +@@ -402,6 +396,25 @@ static bool cg_legacy_filter_and_set_cpus(char *path, bool am_initialized) + goto on_error; + } + ++ if (strcmp(posscpus, "\n") == 0) { ++ need_read_parent = true; ++ free(fpath); ++ free(posscpus); ++ lastslash = strrchr(path, '/'); ++ if (!lastslash) { ++ ERROR("Failed to detect \"/\" in \"%s\"", path); ++ return bret; ++ } ++ oldv = *lastslash; ++ *lastslash = '\0'; ++ fpath = must_make_path(path, "cpuset.cpus", NULL); ++ posscpus = read_file(fpath); ++ if (!posscpus) { ++ SYSERROR("Failed to read file \"%s\"", fpath); ++ goto on_error; ++ } ++ } ++ + /* Get maximum number of cpus found in possible cpuset. */ + maxposs = get_max_cpus(posscpus); + if (maxposs < 0 || maxposs >= INT_MAX - 1) +@@ -489,7 +502,9 @@ static bool cg_legacy_filter_and_set_cpus(char *path, bool am_initialized) + } + + copy_parent: +- *lastslash = oldv; ++ if (need_read_parent) { ++ *lastslash = oldv; ++ } + free(fpath); + fpath = must_make_path(path, "cpuset.cpus", NULL); + ret = lxc_write_to_file(fpath, cpulist, strlen(cpulist), false, 0666); +@@ -522,6 +537,25 @@ static bool copy_parent_file(char *path, char *file) + char *fpath, *lastslash, oldv; + int len = 0; + char *value = NULL; ++ char *current = NULL; ++ ++ fpath = must_make_path(path, file, NULL); ++ current = read_file(fpath); ++ ++ if (current == NULL) { ++ SYSERROR("Failed to read file \"%s\"", fpath); ++ free(fpath); ++ return false; ++ } ++ ++ if (strcmp(current, "\n") != 0) { ++ free(fpath); ++ free(current); ++ return true; ++ } ++ ++ free(fpath); ++ free(current); + + lastslash = strrchr(path, '/'); + if (!lastslash) { +@@ -560,8 +594,6 @@ on_error: + static bool build_sub_cpuset_cgroup_dir(char *cgpath) + { + int ret; +- char v; +- char *clonechildrenpath = NULL; + + ret = mkdir_p(cgpath, 0755); + if (ret < 0) { +@@ -571,51 +603,19 @@ static bool build_sub_cpuset_cgroup_dir(char *cgpath) + } + } + +- clonechildrenpath = must_make_path(cgpath, "cgroup.clone_children", NULL); +- /* unified hierarchy doesn't have clone_children */ +- if (!file_exists(clonechildrenpath)) { +- free(clonechildrenpath); +- return true; +- } +- +- ret = lxc_read_from_file(clonechildrenpath, &v, 1); +- if (ret < 0) { +- SYSERROR("Failed to read file \"%s\"", clonechildrenpath); +- free(clonechildrenpath); +- return false; +- } +- + /* Make sure any isolated cpus are removed from cpuset.cpus. */ +- if (!cg_legacy_filter_and_set_cpus(cgpath, v == '1')) { ++ if (!cg_legacy_filter_and_set_cpus(cgpath, false)) { + SYSERROR("Failed to remove isolated cpus"); +- free(clonechildrenpath); + return false; + } + +- /* Already set for us by someone else. */ +- if (v == '1') { +- DEBUG("\"cgroup.clone_children\" was already set to \"1\""); +- free(clonechildrenpath); +- return true; +- } +- + /* copy parent's settings */ + if (!copy_parent_file(cgpath, "cpuset.mems")) { + SYSERROR("Failed to copy \"cpuset.mems\" settings"); +- free(clonechildrenpath); + return false; + } + +- ret = lxc_write_to_file(clonechildrenpath, "1", 1, false, 0666); +- if (ret < 0) { +- /* Set clone_children so children inherit our settings */ +- SYSERROR("Failed to write 1 to \"%s\"", clonechildrenpath); +- free(clonechildrenpath); +- return false; +- } +- free(clonechildrenpath); + return true; +- + } + + /* Initialize the cpuset hierarchy in first directory of @gname and set +@@ -647,13 +647,13 @@ static bool cg_legacy_handle_cpuset_hierarchy(struct hierarchy *h, char *cgname) + } + slash = strchr(slash + 1, '/'); + } +- } else { +- cgpath = must_make_path(h->mountpoint, h->container_base_path, cgname, NULL); +- sub_mk_success = build_sub_cpuset_cgroup_dir(cgpath); +- free(cgpath); +- if (!sub_mk_success) { +- return false; +- } ++ } ++ ++ cgpath = must_make_path(h->mountpoint, h->container_base_path, cgname, NULL); ++ sub_mk_success = build_sub_cpuset_cgroup_dir(cgpath); ++ free(cgpath); ++ if (!sub_mk_success) { ++ return false; + } + + return true; +-- +1.8.3.1 + diff --git a/0134-lxc-do-cpuset-same-as-runc.patch b/0134-lxc-do-cpuset-same-as-runc.patch new file mode 100644 index 0000000000000000000000000000000000000000..49b912edd8a71e21c7d0afa535988644a25202a9 --- /dev/null +++ b/0134-lxc-do-cpuset-same-as-runc.patch @@ -0,0 +1,319 @@ +From 1118dbb609b83fcca6871e17a11de0752ef3f9d7 Mon Sep 17 00:00:00 2001 +From: LiFeng +Date: Wed, 18 Dec 2019 22:37:08 -0500 +Subject: [PATCH 134/138] lxc: do cpuset same as runc + +Signed-off-by: LiFeng +--- + src/lxc/cgroups/cgfsng.c | 288 +---------------------------------------------- + 1 file changed, 3 insertions(+), 285 deletions(-) + +diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c +index 5908c31..79fc5d3 100644 +--- a/src/lxc/cgroups/cgfsng.c ++++ b/src/lxc/cgroups/cgfsng.c +@@ -248,288 +248,6 @@ static char *read_file(const char *fnam) + return buf; + } + +-/* Taken over modified from the kernel sources. */ +-#define NBITS 32 /* bits in uint32_t */ +-#define DIV_ROUND_UP(n, d) (((n) + (d)-1) / (d)) +-#define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, NBITS) +- +-static void set_bit(unsigned bit, uint32_t *bitarr) +-{ +- bitarr[bit / NBITS] |= (1 << (bit % NBITS)); +-} +- +-static void clear_bit(unsigned bit, uint32_t *bitarr) +-{ +- bitarr[bit / NBITS] &= ~(1 << (bit % NBITS)); +-} +- +-static bool is_set(unsigned bit, uint32_t *bitarr) +-{ +- return (bitarr[bit / NBITS] & (1 << (bit % NBITS))) != 0; +-} +- +-/* Create cpumask from cpulist aka turn: +- * +- * 0,2-3 +- * +- * into bit array +- * +- * 1 0 1 1 +- */ +-static uint32_t *lxc_cpumask(char *buf, size_t nbits) +-{ +- char *token; +- size_t arrlen; +- uint32_t *bitarr; +- +- arrlen = BITS_TO_LONGS(nbits); +- bitarr = calloc(arrlen, sizeof(uint32_t)); +- if (!bitarr) +- return NULL; +- +- lxc_iterate_parts(token, buf, ",") { +- errno = 0; +- unsigned end, start; +- char *range; +- +- start = strtoul(token, NULL, 0); +- end = start; +- range = strchr(token, '-'); +- if (range) +- end = strtoul(range + 1, NULL, 0); +- +- if (!(start <= end)) { +- free(bitarr); +- return NULL; +- } +- +- if (end >= nbits) { +- free(bitarr); +- return NULL; +- } +- +- while (start <= end) +- set_bit(start++, bitarr); +- } +- +- return bitarr; +-} +- +-/* Turn cpumask into simple, comma-separated cpulist. */ +-static char *lxc_cpumask_to_cpulist(uint32_t *bitarr, size_t nbits) +-{ +- int ret; +- size_t i; +- char **cpulist = NULL; +- char numstr[INTTYPE_TO_STRLEN(size_t)] = {0}; +- +- for (i = 0; i <= nbits; i++) { +- if (!is_set(i, bitarr)) +- continue; +- +- ret = snprintf(numstr, sizeof(numstr), "%zu", i); +- if (ret < 0 || (size_t)ret >= sizeof(numstr)) { +- lxc_free_array((void **)cpulist, free); +- return NULL; +- } +- +- ret = lxc_append_string(&cpulist, numstr); +- if (ret < 0) { +- lxc_free_array((void **)cpulist, free); +- return NULL; +- } +- } +- +- if (!cpulist) +- return NULL; +- +- return lxc_string_join(",", (const char **)cpulist, false); +-} +- +-static ssize_t get_max_cpus(char *cpulist) +-{ +- char *c1, *c2; +- char *maxcpus = cpulist; +- size_t cpus = 0; +- +- c1 = strrchr(maxcpus, ','); +- if (c1) +- c1++; +- +- c2 = strrchr(maxcpus, '-'); +- if (c2) +- c2++; +- +- if (!c1 && !c2) +- c1 = maxcpus; +- else if (c1 > c2) +- c2 = c1; +- else if (c1 < c2) +- c1 = c2; +- else if (!c1 && c2) +- c1 = c2; +- +- errno = 0; +- cpus = strtoul(c1, NULL, 0); +- if (errno != 0) +- return -1; +- +- return cpus; +-} +- +-#define __ISOL_CPUS "/sys/devices/system/cpu/isolated" +-static bool cg_legacy_filter_and_set_cpus(char *path, bool am_initialized) +-{ +- int ret; +- ssize_t i; +- char *lastslash, *fpath, oldv; +- ssize_t maxisol = 0, maxposs = 0; +- char *cpulist = NULL, *isolcpus = NULL, *posscpus = NULL; +- uint32_t *isolmask = NULL, *possmask = NULL; +- bool bret = false, flipped_bit = false; +- bool need_read_parent = false; +- +- fpath = must_make_path(path, "cpuset.cpus", NULL); +- posscpus = read_file(fpath); +- if (!posscpus) { +- SYSERROR("Failed to read file \"%s\"", fpath); +- goto on_error; +- } +- +- if (strcmp(posscpus, "\n") == 0) { +- need_read_parent = true; +- free(fpath); +- free(posscpus); +- lastslash = strrchr(path, '/'); +- if (!lastslash) { +- ERROR("Failed to detect \"/\" in \"%s\"", path); +- return bret; +- } +- oldv = *lastslash; +- *lastslash = '\0'; +- fpath = must_make_path(path, "cpuset.cpus", NULL); +- posscpus = read_file(fpath); +- if (!posscpus) { +- SYSERROR("Failed to read file \"%s\"", fpath); +- goto on_error; +- } +- } +- +- /* Get maximum number of cpus found in possible cpuset. */ +- maxposs = get_max_cpus(posscpus); +- if (maxposs < 0 || maxposs >= INT_MAX - 1) +- goto on_error; +- +- if (!file_exists(__ISOL_CPUS)) { +- /* This system doesn't expose isolated cpus. */ +- DEBUG("The path \""__ISOL_CPUS"\" to read isolated cpus from does not exist"); +- cpulist = posscpus; +- /* No isolated cpus but we weren't already initialized by +- * someone. We should simply copy the parents cpuset.cpus +- * values. +- */ +- if (!am_initialized) { +- DEBUG("Copying cpu settings of parent cgroup"); +- goto copy_parent; +- } +- /* No isolated cpus but we were already initialized by someone. +- * Nothing more to do for us. +- */ +- goto on_success; +- } +- +- isolcpus = read_file(__ISOL_CPUS); +- if (!isolcpus) { +- SYSERROR("Failed to read file \""__ISOL_CPUS"\""); +- goto on_error; +- } +- if (!isdigit(isolcpus[0])) { +- TRACE("No isolated cpus detected"); +- cpulist = posscpus; +- /* No isolated cpus but we weren't already initialized by +- * someone. We should simply copy the parents cpuset.cpus +- * values. +- */ +- if (!am_initialized) { +- DEBUG("Copying cpu settings of parent cgroup"); +- goto copy_parent; +- } +- /* No isolated cpus but we were already initialized by someone. +- * Nothing more to do for us. +- */ +- goto on_success; +- } +- +- /* Get maximum number of cpus found in isolated cpuset. */ +- maxisol = get_max_cpus(isolcpus); +- if (maxisol < 0 || maxisol >= INT_MAX - 1) +- goto on_error; +- +- if (maxposs < maxisol) +- maxposs = maxisol; +- maxposs++; +- +- possmask = lxc_cpumask(posscpus, maxposs); +- if (!possmask) { +- ERROR("Failed to create cpumask for possible cpus"); +- goto on_error; +- } +- +- isolmask = lxc_cpumask(isolcpus, maxposs); +- if (!isolmask) { +- ERROR("Failed to create cpumask for isolated cpus"); +- goto on_error; +- } +- +- for (i = 0; i <= maxposs; i++) { +- if (!is_set(i, isolmask) || !is_set(i, possmask)) +- continue; +- +- flipped_bit = true; +- clear_bit(i, possmask); +- } +- +- if (!flipped_bit) { +- DEBUG("No isolated cpus present in cpuset"); +- goto on_success; +- } +- DEBUG("Removed isolated cpus from cpuset"); +- +- cpulist = lxc_cpumask_to_cpulist(possmask, maxposs); +- if (!cpulist) { +- ERROR("Failed to create cpu list"); +- goto on_error; +- } +- +-copy_parent: +- if (need_read_parent) { +- *lastslash = oldv; +- } +- free(fpath); +- fpath = must_make_path(path, "cpuset.cpus", NULL); +- ret = lxc_write_to_file(fpath, cpulist, strlen(cpulist), false, 0666); +- if (ret < 0) { +- SYSERROR("Failed to write cpu list to \"%s\"", fpath); +- goto on_error; +- } +- +-on_success: +- bret = true; +- +-on_error: +- free(fpath); +- +- free(isolcpus); +- free(isolmask); +- +- if (posscpus != cpulist) +- free(posscpus); +- free(possmask); +- +- free(cpulist); +- return bret; +-} +- + /* Copy contents of parent(@path)/@file to @path/@file */ + static bool copy_parent_file(char *path, char *file) + { +@@ -603,9 +321,9 @@ static bool build_sub_cpuset_cgroup_dir(char *cgpath) + } + } + +- /* Make sure any isolated cpus are removed from cpuset.cpus. */ +- if (!cg_legacy_filter_and_set_cpus(cgpath, false)) { +- SYSERROR("Failed to remove isolated cpus"); ++ /* copy parent's settings */ ++ if (!copy_parent_file(cgpath, "cpuset.cpus")) { ++ SYSERROR("Failed to copy \"cpuset.cpus\" settings"); + return false; + } + +-- +1.8.3.1 + diff --git a/0135-lxc-fix-code-warnings-for-cgfsng.c.patch b/0135-lxc-fix-code-warnings-for-cgfsng.c.patch new file mode 100644 index 0000000000000000000000000000000000000000..a04cc0280621ee803519017f6c506ce37da81ad4 --- /dev/null +++ b/0135-lxc-fix-code-warnings-for-cgfsng.c.patch @@ -0,0 +1,55 @@ +From 6c1e2e9db0e6f6cf685b60d62a74ba3994b0a333 Mon Sep 17 00:00:00 2001 +From: LiFeng +Date: Mon, 23 Dec 2019 03:20:14 -0500 +Subject: [PATCH 135/138] lxc: fix code warnings for cgfsng.c + +Signed-off-by: LiFeng +--- + src/lxc/cgroups/cgfsng.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c +index 79fc5d3..9f0bb69 100644 +--- a/src/lxc/cgroups/cgfsng.c ++++ b/src/lxc/cgroups/cgfsng.c +@@ -252,10 +252,12 @@ static char *read_file(const char *fnam) + static bool copy_parent_file(char *path, char *file) + { + int ret; +- char *fpath, *lastslash, oldv; + int len = 0; + char *value = NULL; + char *current = NULL; ++ char *fpath = NULL; ++ char *lastslash = NULL; ++ char oldv; + + fpath = must_make_path(path, file, NULL); + current = read_file(fpath); +@@ -276,13 +278,14 @@ static bool copy_parent_file(char *path, char *file) + free(current); + + lastslash = strrchr(path, '/'); +- if (!lastslash) { ++ if (lastslash == NULL) { + ERROR("Failed to detect \"/\" in \"%s\"", path); + return false; + } + oldv = *lastslash; + *lastslash = '\0'; + fpath = must_make_path(path, file, NULL); ++ *lastslash = oldv; + len = lxc_read_from_file(fpath, NULL, 0); + if (len <= 0) + goto on_error; +@@ -293,7 +296,6 @@ static bool copy_parent_file(char *path, char *file) + goto on_error; + free(fpath); + +- *lastslash = oldv; + fpath = must_make_path(path, file, NULL); + ret = lxc_write_to_file(fpath, value, len, false, 0666); + if (ret < 0) +-- +1.8.3.1 + diff --git a/0136-lxc-fix-retry-bug-in-cgroup.patch b/0136-lxc-fix-retry-bug-in-cgroup.patch new file mode 100644 index 0000000000000000000000000000000000000000..2bcbf11423e4b6e68d32f94b2fcba359de890e0a --- /dev/null +++ b/0136-lxc-fix-retry-bug-in-cgroup.patch @@ -0,0 +1,79 @@ +From 77e924659f1a1674f5c2017f4dd03b9d94f67ee3 Mon Sep 17 00:00:00 2001 +From: LiFeng +Date: Sat, 28 Dec 2019 20:12:57 -0500 +Subject: [PATCH 136/138] lxc: fix retry bug in cgroup + +Signed-off-by: LiFeng +--- + src/lxc/cgroups/cgfsng.c | 34 +++++++++++++++++----------------- + 1 file changed, 17 insertions(+), 17 deletions(-) + +diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c +index 9f0bb69..ed08f10 100644 +--- a/src/lxc/cgroups/cgfsng.c ++++ b/src/lxc/cgroups/cgfsng.c +@@ -1025,6 +1025,7 @@ __cgfsng_ops static bool cgfsng_payload_create(struct cgroup_ops *ops, + __cgfsng_ops static bool cgfsng_payload_enter(struct cgroup_ops *ops, pid_t pid) + { + int len; ++ char *container_cgroup = ops->container_cgroup; + char pidstr[INTTYPE_TO_STRLEN(pid_t)]; + + len = snprintf(pidstr, sizeof(pidstr), "%d", pid); +@@ -1042,14 +1043,13 @@ __cgfsng_ops static bool cgfsng_payload_enter(struct cgroup_ops *ops, pid_t pid) + retry: + ret = lxc_write_to_file(fullpath, pidstr, len, false, 0666); + if (ret != 0) { +- if (errno == ENOENT) { +- if (retry_count < max_retry) { +- SYSERROR("Failed to enter cgroup \"%s\" with retry count:%d", fullpath, retry_count); +- (void)mkdir_eexist_on_last(ops->hierarchies[i]->container_full_path, 0755); +- usleep(100 * 1000); /* 100 millisecond */ +- retry_count++; +- goto retry; +- } ++ if (retry_count < max_retry) { ++ SYSERROR("Failed to enter cgroup \"%s\" with retry count:%d", fullpath, retry_count); ++ (void)cg_legacy_handle_cpuset_hierarchy(ops->hierarchies[i], container_cgroup); ++ (void)mkdir_eexist_on_last(ops->hierarchies[i]->container_full_path, 0755); ++ usleep(100 * 1000); /* 100 millisecond */ ++ retry_count++; ++ goto retry; + } + SYSERROR("Failed to enter cgroup \"%s\"", fullpath); + free(fullpath); +@@ -1949,6 +1949,7 @@ static int cg_legacy_set_data(struct cgroup_ops *ops, const char *filename, + char *controller = NULL; + int retry_count = 0; + int max_retry = 10; ++ char *container_cgroup = ops->container_cgroup; + + len = strlen(filename); + controller = alloca(len + 1); +@@ -1979,15 +1980,14 @@ static int cg_legacy_set_data(struct cgroup_ops *ops, const char *filename, + + retry: + ret = lxc_write_to_file(fullpath, value, strlen(value), false, 0666); +- if (ret) { +- if (errno == ENOENT) { +- if (retry_count < max_retry) { +- SYSERROR("setting cgroup config for ready process caused \"failed to write %s to %s\".", value, fullpath); +- (void)mkdir_eexist_on_last(h->container_full_path, 0755); +- usleep(100 * 1000); /* 100 millisecond */ +- retry_count++; +- goto retry; +- } ++ if (ret != 0) { ++ if (retry_count < max_retry) { ++ SYSERROR("setting cgroup config for ready process caused \"failed to write %s to %s\".", value, fullpath); ++ (void)cg_legacy_handle_cpuset_hierarchy(h, container_cgroup); ++ (void)mkdir_eexist_on_last(h->container_full_path, 0755); ++ usleep(100 * 1000); /* 100 millisecond */ ++ retry_count++; ++ goto retry; + } + lxc_write_error_message(ops->errfd, + "%s:%d: setting cgroup config for ready process caused \"failed to write %s to %s: %s\".", +-- +1.8.3.1 + diff --git a/0137-lxc-fix-bug-in-read-proc.patch b/0137-lxc-fix-bug-in-read-proc.patch new file mode 100644 index 0000000000000000000000000000000000000000..1d2f49dfb2efae8d3dcc9d0fc9e4f83dc0cf146d --- /dev/null +++ b/0137-lxc-fix-bug-in-read-proc.patch @@ -0,0 +1,43 @@ +From 3a68cc1e0500c6643d281f4d67b8c6a61708eb4a Mon Sep 17 00:00:00 2001 +From: LiFeng +Date: Mon, 30 Dec 2019 04:50:28 -0500 +Subject: [PATCH 137/138] lxc: fix bug in read proc + +Signed-off-by: LiFeng +--- + src/lxc/start.c | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +diff --git a/src/lxc/start.c b/src/lxc/start.c +index 63be4e3..c9bae65 100644 +--- a/src/lxc/start.c ++++ b/src/lxc/start.c +@@ -998,7 +998,7 @@ static int _recursive_read_cgroup_procs(const char *dirpath, pid_t **pids, size_ + char pathname[PATH_MAX]; + + dir = opendir(dirpath); +- if (!dir && errno != ENOENT) { ++ if (dir == NULL) { + WARN("Failed to open \"%s\"", dirpath); + return 0; + } +@@ -1049,15 +1049,13 @@ static int _recursive_read_cgroup_procs(const char *dirpath, pid_t **pids, size_ + int get_all_pids(struct cgroup_ops *cg_ops, pid_t **pids, size_t *len) + { + const char *devices_path = NULL; +- int ret; + + devices_path = cg_ops->get_cgroup(cg_ops, "devices", false); + if (!file_exists(devices_path)) { + return 0; + } + +- ret = _recursive_read_cgroup_procs(devices_path, pids, len); +- return ret; ++ return _recursive_read_cgroup_procs(devices_path, pids, len); + } + + static int set_cgroup_freezer(struct cgroup_ops *cg_ops, const char *value) +-- +1.8.3.1 + diff --git a/0138-resize-implement-resize-function-in-exec-start.patch b/0138-resize-implement-resize-function-in-exec-start.patch new file mode 100644 index 0000000000000000000000000000000000000000..2e958625e180eaa73837ea5caf3adf4010bdfcf8 --- /dev/null +++ b/0138-resize-implement-resize-function-in-exec-start.patch @@ -0,0 +1,1133 @@ +From 3690e3e4ced8378108888ff2c15aeecfc650b974 Mon Sep 17 00:00:00 2001 +From: LiFeng +Date: Fri, 29 Nov 2019 22:12:10 -0500 +Subject: [PATCH 138/138] resize: implement resize function in exec/start + +Signed-off-by: LiFeng +--- + src/lxc/Makefile.am | 1 + + src/lxc/attach.c | 45 ++++- + src/lxc/attach.h | 2 +- + src/lxc/commands.c | 44 +++++ + src/lxc/commands.h | 9 + + src/lxc/exec_commands.c | 416 +++++++++++++++++++++++++++++++++++++++++++++ + src/lxc/exec_commands.h | 73 ++++++++ + src/lxc/lxccontainer.c | 64 ++++++- + src/lxc/lxccontainer.h | 15 +- + src/lxc/terminal.c | 26 +++ + src/lxc/terminal.h | 1 + + src/lxc/tools/arguments.h | 3 +- + src/lxc/tools/lxc_attach.c | 20 ++- + src/lxc/tools/lxc_copy.c | 2 +- + src/lxc/tools/lxc_ls.c | 2 +- + 15 files changed, 698 insertions(+), 25 deletions(-) + create mode 100644 src/lxc/exec_commands.c + create mode 100644 src/lxc/exec_commands.h + +diff --git a/src/lxc/Makefile.am b/src/lxc/Makefile.am +index 27240cc..c21eb85 100644 +--- a/src/lxc/Makefile.am ++++ b/src/lxc/Makefile.am +@@ -101,6 +101,7 @@ liblxc_la_SOURCES = af_unix.c af_unix.h \ + cgroups/cgroup_utils.c cgroups/cgroup_utils.h \ + compiler.h \ + commands.c commands.h \ ++ exec_commands.c exec_commands.h \ + commands_utils.c commands_utils.h \ + conf.c conf.h \ + confile.c confile.h \ +diff --git a/src/lxc/attach.c b/src/lxc/attach.c +index 1f14eb4..03a7646 100644 +--- a/src/lxc/attach.c ++++ b/src/lxc/attach.c +@@ -64,6 +64,7 @@ + #include "syscall_wrappers.h" + #include "terminal.h" + #include "utils.h" ++#include "exec_commands.h" + + #if HAVE_SYS_PERSONALITY_H + #include +@@ -1208,7 +1209,7 @@ out: + return ret; + } + +-int lxc_attach(const char *name, const char *lxcpath, ++int lxc_attach(const char *name, const char *lxcpath, const char *suffix, + lxc_attach_exec_t exec_function, void *exec_payload, + lxc_attach_options_t *options, pid_t *attached_process, char **err_msg) + { +@@ -1221,6 +1222,10 @@ int lxc_attach(const char *name, const char *lxcpath, + struct lxc_terminal terminal; + struct lxc_conf *conf; + struct attach_clone_payload payload = {0}; ++ struct lxc_exec_command_handler exec_command; ++ ++ exec_command.maincmd_fd = -1; ++ exec_command.terminal = &terminal; + + ret = access("/proc/self/ns", X_OK); + if (ret) { +@@ -1354,6 +1359,10 @@ int lxc_attach(const char *name, const char *lxcpath, + } + + terminal.log_fd = options->log_fd; ++ if (suffix != NULL) { ++ exec_command.maincmd_fd = lxc_exec_cmd_init(name, lxcpath, suffix); ++ exec_command.terminal = &terminal; ++ } + } else { + lxc_terminal_init(&terminal); + } +@@ -1394,15 +1403,30 @@ int lxc_attach(const char *name, const char *lxcpath, + ret = socketpair(PF_LOCAL, SOCK_STREAM | SOCK_CLOEXEC, 0, ipc_sockets); + if (ret < 0) { + SYSERROR("Could not set up required IPC mechanism for attaching"); ++ if (options->attach_flags & LXC_ATTACH_TERMINAL) { ++ lxc_terminal_delete(&terminal); ++ lxc_terminal_conf_free(&terminal); ++ if (exec_command.maincmd_fd != -1) { ++ close(exec_command.maincmd_fd); ++ } ++ } + free(cwd); + lxc_proc_put_context_info(init_ctx); + return -1; + } + +- + /* isulad: pipdfd for get error message of child or grandchild process. */ + if (pipe2(conf->errpipe, O_CLOEXEC) != 0) { + SYSERROR("Failed to init errpipe"); ++ if (options->attach_flags & LXC_ATTACH_TERMINAL) { ++ lxc_terminal_delete(&terminal); ++ lxc_terminal_conf_free(&terminal); ++ if (exec_command.maincmd_fd != -1) { ++ close(exec_command.maincmd_fd); ++ } ++ } ++ close(ipc_sockets[0]); ++ close(ipc_sockets[1]); + free(cwd); + lxc_proc_put_context_info(init_ctx); + return -1; +@@ -1418,6 +1442,15 @@ int lxc_attach(const char *name, const char *lxcpath, + pid = fork(); + if (pid < 0) { + SYSERROR("Failed to create first subprocess"); ++ if (options->attach_flags & LXC_ATTACH_TERMINAL) { ++ lxc_terminal_delete(&terminal); ++ lxc_terminal_conf_free(&terminal); ++ if (exec_command.maincmd_fd != -1) { ++ close(exec_command.maincmd_fd); ++ } ++ } ++ close(ipc_sockets[0]); ++ close(ipc_sockets[1]); + free(cwd); + lxc_proc_put_context_info(init_ctx); + return -1; +@@ -1474,6 +1507,8 @@ int lxc_attach(const char *name, const char *lxcpath, + if (ret < 0) + goto on_error; + ++ (void)lxc_exec_cmd_mainloop_add(&descr, &exec_command); ++ + TRACE("Initialized terminal mainloop"); + } + +@@ -1597,6 +1632,9 @@ int lxc_attach(const char *name, const char *lxcpath, + if (options->attach_flags & LXC_ATTACH_TERMINAL) { + lxc_terminal_delete(&terminal); + lxc_terminal_conf_free(&terminal); ++ if (exec_command.maincmd_fd != -1) { ++ close(exec_command.maincmd_fd); ++ } + } + + lxc_proc_put_context_info(init_ctx); +@@ -1615,6 +1653,9 @@ int lxc_attach(const char *name, const char *lxcpath, + lxc_attach_terminal_close_master(&terminal); + lxc_attach_terminal_close_peer(&terminal); + lxc_attach_terminal_close_log(&terminal); ++ if (exec_command.maincmd_fd != -1) { ++ close(exec_command.maincmd_fd); ++ } + } + + /* Wait for the parent to have setup cgroups. */ +diff --git a/src/lxc/attach.h b/src/lxc/attach.h +index e62b98b..8626a8e 100644 +--- a/src/lxc/attach.h ++++ b/src/lxc/attach.h +@@ -41,7 +41,7 @@ struct lxc_proc_context_info { + int ns_fd[LXC_NS_MAX]; + }; + +-extern int lxc_attach(const char *name, const char *lxcpath, ++extern int lxc_attach(const char *name, const char *lxcpath, const char *suffix, + lxc_attach_exec_t exec_function, void *exec_payload, + lxc_attach_options_t *options, pid_t *attached_process, char **err_msg); + +diff --git a/src/lxc/commands.c b/src/lxc/commands.c +index b70564f..8fd929d 100644 +--- a/src/lxc/commands.c ++++ b/src/lxc/commands.c +@@ -97,6 +97,7 @@ static const char *lxc_cmd_str(lxc_cmd_t cmd) + [LXC_CMD_CONSOLE_LOG] = "console_log", + [LXC_CMD_SERVE_STATE_CLIENTS] = "serve_state_clients", + [LXC_CMD_SET_TERMINAL_FIFOS] = "set_terminal_fifos", ++ [LXC_CMD_SET_TERMINAL_WINCH] = "set_terminal_winch", + }; + + if (cmd >= LXC_CMD_MAX) +@@ -1126,6 +1127,48 @@ static int lxc_cmd_set_terminal_fifos_callback(int fd, struct lxc_cmd_req *req, + + } + ++int lxc_cmd_set_terminal_winch(const char *name, const char *lxcpath, unsigned int height, unsigned int width) ++{ ++ int ret = 0, stopped = 0; ++ struct lxc_cmd_set_terminal_winch_request data = { 0 }; ++ ++ data.height = height; ++ data.width = width; ++ ++ struct lxc_cmd_rr cmd = { ++ .req = { ++ .cmd = LXC_CMD_SET_TERMINAL_WINCH, ++ .datalen = sizeof(struct lxc_cmd_set_terminal_winch_request), ++ .data = &data, ++ }, ++ }; ++ ++ ret = lxc_cmd(name, &cmd, &stopped, lxcpath, NULL); ++ if (ret < 0) { ++ ERROR("Failed to send command to container"); ++ return -1; ++ } ++ ++ if (cmd.rsp.ret != 0) { ++ ERROR("Command response error:%d", cmd.rsp.ret); ++ return -1; ++ } ++ return 0; ++} ++ ++static int lxc_cmd_set_terminal_winch_callback(int fd, struct lxc_cmd_req *req, ++ struct lxc_handler *handler) ++{ ++ struct lxc_cmd_rsp rsp; ++ struct lxc_cmd_set_terminal_winch_request *data = (struct lxc_cmd_set_terminal_winch_request *)(req->data); ++ memset(&rsp, 0, sizeof(rsp)); ++ ++ rsp.ret = lxc_set_terminal_winsz(&handler->conf->console, data->height, data->width);; ++ ++ return lxc_cmd_rsp_send(fd, &rsp); ++ ++} ++ + static int lxc_cmd_process(int fd, struct lxc_cmd_req *req, + struct lxc_handler *handler) + { +@@ -1146,6 +1189,7 @@ static int lxc_cmd_process(int fd, struct lxc_cmd_req *req, + [LXC_CMD_CONSOLE_LOG] = lxc_cmd_console_log_callback, + [LXC_CMD_SERVE_STATE_CLIENTS] = lxc_cmd_serve_state_clients_callback, + [LXC_CMD_SET_TERMINAL_FIFOS] = lxc_cmd_set_terminal_fifos_callback, ++ [LXC_CMD_SET_TERMINAL_WINCH] = lxc_cmd_set_terminal_winch_callback, + }; + + if (req->cmd >= LXC_CMD_MAX) { +diff --git a/src/lxc/commands.h b/src/lxc/commands.h +index 6b64849..c8cc8cd 100644 +--- a/src/lxc/commands.h ++++ b/src/lxc/commands.h +@@ -47,6 +47,7 @@ typedef enum { + LXC_CMD_CONSOLE_LOG, + LXC_CMD_SERVE_STATE_CLIENTS, + LXC_CMD_SET_TERMINAL_FIFOS, ++ LXC_CMD_SET_TERMINAL_WINCH, + LXC_CMD_MAX, + } lxc_cmd_t; + +@@ -80,6 +81,11 @@ struct lxc_cmd_console_log { + + }; + ++struct lxc_cmd_set_terminal_winch_request { ++ unsigned int height; ++ unsigned int width; ++}; ++ + extern int lxc_cmd_terminal_winch(const char *name, const char *lxcpath); + extern int lxc_cmd_console(const char *name, int *ttynum, int *fd, + const char *lxcpath); +@@ -129,4 +135,7 @@ extern int lxc_cmd_console_log(const char *name, const char *lxcpath, + extern int lxc_cmd_set_terminal_fifos(const char *name, const char *lxcpath, + const char *in_fifo, const char *out_fifo, const char *err_fifo); + ++extern int lxc_cmd_set_terminal_winch(const char *name, const char *lxcpath, unsigned int height, unsigned int width); ++ ++ + #endif /* __commands_h */ +diff --git a/src/lxc/exec_commands.c b/src/lxc/exec_commands.c +new file mode 100644 +index 0000000..00129cb +--- /dev/null ++++ b/src/lxc/exec_commands.c +@@ -0,0 +1,416 @@ ++/****************************************************************************** ++ * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. ++ * Author: lifeng ++ * Create: 2019-12-08 ++ * Description: provide container definition ++ * lxc: linux Container library ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ ******************************************************************************/ ++ ++#ifndef _GNU_SOURCE ++#define _GNU_SOURCE 1 ++#endif ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "af_unix.h" ++#include "cgroup.h" ++#include "exec_commands.h" ++#include "commands_utils.h" ++#include "conf.h" ++#include "config.h" ++#include "confile.h" ++#include "log.h" ++#include "lxc.h" ++#include "lxclock.h" ++#include "mainloop.h" ++#include "monitor.h" ++#include "terminal.h" ++#include "utils.h" ++ ++lxc_log_define(commands_exec, lxc); ++ ++static const char *lxc_exec_cmd_str(lxc_exec_cmd_t cmd) ++{ ++ static const char *const cmdname[LXC_EXEC_CMD_MAX] = { ++ [LXC_EXEC_CMD_SET_TERMINAL_WINCH] = "set_exec_terminal_winch", ++ }; ++ ++ if (cmd >= LXC_EXEC_CMD_MAX) ++ return "Invalid request"; ++ ++ return cmdname[cmd]; ++} ++ ++static int lxc_exec_cmd_rsp_recv(int sock, struct lxc_exec_cmd_rr *cmd) ++{ ++ int ret, rspfd; ++ struct lxc_exec_cmd_rsp *rsp = &cmd->rsp; ++ ++ ret = lxc_abstract_unix_recv_fds_timeout(sock, &rspfd, 1, rsp, sizeof(*rsp), 1000 * 1000); ++ if (ret < 0) { ++ SYSERROR("Failed to receive response for command \"%s\"", ++ lxc_exec_cmd_str(cmd->req.cmd)); ++ ++ if (errno == ECONNRESET || errno == EAGAIN || errno == EWOULDBLOCK) { ++ errno = ECONNRESET; /*isulad set errno ECONNRESET when timeout */ ++ return -1; ++ } ++ ++ return -1; ++ } ++ TRACE("Command \"%s\" received response", lxc_exec_cmd_str(cmd->req.cmd)); ++ ++ if (rsp->datalen == 0) { ++ DEBUG("Response data length for command \"%s\" is 0", ++ lxc_exec_cmd_str(cmd->req.cmd)); ++ return ret; ++ } ++ ++ if (rsp->datalen > LXC_CMD_DATA_MAX) { ++ ERROR("Response data for command \"%s\" is too long: %d bytes > %d", ++ lxc_exec_cmd_str(cmd->req.cmd), rsp->datalen, LXC_CMD_DATA_MAX); ++ return -1; ++ } ++ ++ rsp->data = malloc(rsp->datalen); ++ if (!rsp->data) { ++ errno = ENOMEM; ++ ERROR("Failed to allocate response buffer for command \"%s\"", ++ lxc_exec_cmd_str(cmd->req.cmd)); ++ return -1; ++ } ++ ++ ret = lxc_recv_nointr(sock, rsp->data, rsp->datalen, 0); ++ if (ret != rsp->datalen) { ++ SYSERROR("Failed to receive response data for command \"%s\"", ++ lxc_exec_cmd_str(cmd->req.cmd)); ++ return -1; ++ } ++ ++ return ret; ++} ++ ++static int lxc_exec_cmd_rsp_send(int fd, struct lxc_exec_cmd_rsp *rsp) ++{ ++ ssize_t ret; ++ ++ errno = EMSGSIZE; ++ ret = lxc_send_nointr(fd, rsp, sizeof(*rsp), MSG_NOSIGNAL); ++ if (ret < 0 || (size_t)ret != sizeof(*rsp)) { ++ SYSERROR("Failed to send command response %zd", ret); ++ return -1; ++ } ++ ++ if (!rsp->data || rsp->datalen <= 0) ++ return 0; ++ ++ errno = EMSGSIZE; ++ ret = lxc_send_nointr(fd, rsp->data, rsp->datalen, MSG_NOSIGNAL); ++ if (ret < 0 || ret != (ssize_t)rsp->datalen) { ++ SYSWARN("Failed to send command response data %zd", ret); ++ return -1; ++ } ++ ++ return 0; ++} ++ ++static int lxc_exec_cmd_send(const char *name, struct lxc_exec_cmd_rr *cmd, ++ const char *lxcpath, const char *hashed_sock_name, const char *suffix) ++{ ++ int client_fd, saved_errno; ++ ssize_t ret = -1; ++ ++ client_fd = lxc_cmd_connect(name, lxcpath, hashed_sock_name, suffix); ++ if (client_fd < 0) ++ return -1; ++ ++ ret = lxc_abstract_unix_send_credential(client_fd, &cmd->req, ++ sizeof(cmd->req)); ++ if (ret < 0 || (size_t)ret != sizeof(cmd->req)) ++ goto on_error; ++ ++ if (cmd->req.datalen <= 0) ++ return client_fd; ++ ++ errno = EMSGSIZE; ++ ret = lxc_send_nointr(client_fd, (void *)cmd->req.data, ++ cmd->req.datalen, MSG_NOSIGNAL); ++ if (ret < 0 || ret != (ssize_t)cmd->req.datalen) ++ goto on_error; ++ ++ return client_fd; ++ ++on_error: ++ saved_errno = errno; ++ close(client_fd); ++ errno = saved_errno; ++ ++ return -1; ++} ++ ++static int lxc_exec_cmd(const char *name, struct lxc_exec_cmd_rr *cmd, const char *lxcpath, const char *hashed_sock_name, const char *suffix) ++{ ++ int client_fd = -1; ++ int saved_errno; ++ int ret = -1; ++ ++ client_fd = lxc_exec_cmd_send(name, cmd, lxcpath, hashed_sock_name, suffix); ++ if (client_fd < 0) { ++ SYSTRACE("Command \"%s\" failed to connect command socket", ++ lxc_exec_cmd_str(cmd->req.cmd)); ++ return -1; ++ } ++ ++ ret = lxc_exec_cmd_rsp_recv(client_fd, cmd); ++ ++ saved_errno = errno; ++ close(client_fd); ++ errno = saved_errno; ++ return ret; ++} ++ ++int lxc_exec_cmd_set_terminal_winch(const char *name, const char *lxcpath, const char *suffix, unsigned int height, unsigned int width) ++{ ++ int ret = 0; ++ struct lxc_exec_cmd_set_terminal_winch_request data = { 0 }; ++ ++ data.height = height; ++ data.width = width; ++ ++ struct lxc_exec_cmd_rr cmd = { ++ .req = { ++ .cmd = LXC_EXEC_CMD_SET_TERMINAL_WINCH, ++ .datalen = sizeof(struct lxc_exec_cmd_set_terminal_winch_request), ++ .data = &data, ++ }, ++ }; ++ ++ ret = lxc_exec_cmd(name, &cmd, lxcpath, NULL, suffix); ++ if (ret < 0) { ++ ERROR("Failed to send command to container"); ++ return -1; ++ } ++ ++ if (cmd.rsp.ret != 0) { ++ ERROR("Command response error:%d", cmd.rsp.ret); ++ return -1; ++ } ++ return 0; ++} ++ ++static int lxc_exec_cmd_set_terminal_winch_callback(int fd, struct lxc_exec_cmd_req *req, ++ struct lxc_exec_command_handler *handler) ++{ ++ struct lxc_exec_cmd_rsp rsp; ++ struct lxc_exec_cmd_set_terminal_winch_request *data = (struct lxc_exec_cmd_set_terminal_winch_request *)(req->data); ++ memset(&rsp, 0, sizeof(rsp)); ++ ++ rsp.ret = lxc_set_terminal_winsz(handler->terminal, data->height, data->width);; ++ ++ return lxc_exec_cmd_rsp_send(fd, &rsp); ++ ++} ++ ++static int lxc_exec_cmd_process(int fd, struct lxc_exec_cmd_req *req, ++ struct lxc_exec_command_handler *handler) ++{ ++ typedef int (*callback)(int, struct lxc_exec_cmd_req *, struct lxc_exec_command_handler *); ++ ++ callback cb[LXC_EXEC_CMD_MAX] = { ++ [LXC_EXEC_CMD_SET_TERMINAL_WINCH] = lxc_exec_cmd_set_terminal_winch_callback, ++ }; ++ ++ if (req->cmd >= LXC_EXEC_CMD_MAX) { ++ ERROR("Undefined command id %d", req->cmd); ++ return -1; ++ } ++ return cb[req->cmd](fd, req, handler); ++} ++ ++static void lxc_exec_cmd_fd_cleanup(int fd, struct lxc_epoll_descr *descr) ++{ ++ lxc_mainloop_del_handler(descr, fd); ++ close(fd); ++ return; ++} ++ ++static int lxc_exec_cmd_handler(int fd, uint32_t events, void *data, ++ struct lxc_epoll_descr *descr) ++{ ++ int ret; ++ struct lxc_exec_cmd_req req; ++ void *reqdata = NULL; ++ struct lxc_exec_command_handler *handler = data; ++ ++ ret = lxc_abstract_unix_rcv_credential(fd, &req, sizeof(req)); ++ if (ret < 0) { ++ SYSERROR("Failed to receive data on command socket for command " ++ "\"%s\"", lxc_exec_cmd_str(req.cmd)); ++ ++ if (errno == EACCES) { ++ /* We don't care for the peer, just send and close. */ ++ struct lxc_exec_cmd_rsp rsp = {.ret = ret}; ++ ++ lxc_exec_cmd_rsp_send(fd, &rsp); ++ } ++ ++ goto out_close; ++ } ++ ++ if (ret == 0) ++ goto out_close; ++ ++ if (ret != sizeof(req)) { ++ WARN("Failed to receive full command request. Ignoring request " ++ "for \"%s\"", lxc_exec_cmd_str(req.cmd)); ++ ret = -1; ++ goto out_close; ++ } ++ ++ if (req.datalen > LXC_CMD_DATA_MAX) { ++ ERROR("Received command data length %d is too large for " ++ "command \"%s\"", req.datalen, lxc_exec_cmd_str(req.cmd)); ++ errno = EFBIG; ++ ret = -EFBIG; ++ goto out_close; ++ } ++ ++ if (req.datalen > 0) { ++ reqdata = alloca(req.datalen); ++ if (!reqdata) { ++ ERROR("Failed to allocate memory for \"%s\" command", ++ lxc_exec_cmd_str(req.cmd)); ++ errno = ENOMEM; ++ ret = -ENOMEM; ++ goto out_close; ++ } ++ ++ ret = lxc_recv_nointr(fd, reqdata, req.datalen, 0); ++ if (ret != req.datalen) { ++ WARN("Failed to receive full command request. Ignoring " ++ "request for \"%s\"", lxc_exec_cmd_str(req.cmd)); ++ ret = LXC_MAINLOOP_ERROR; ++ goto out_close; ++ } ++ ++ req.data = reqdata; ++ } ++ ++ ret = lxc_exec_cmd_process(fd, &req, handler); ++ if (ret) { ++ /* This is not an error, but only a request to close fd. */ ++ ret = LXC_MAINLOOP_CONTINUE; ++ goto out_close; ++ } ++ ++out: ++ return ret; ++ ++out_close: ++ lxc_exec_cmd_fd_cleanup(fd, descr); ++ goto out; ++} ++ ++static int lxc_exec_cmd_accept(int fd, uint32_t events, void *data, ++ struct lxc_epoll_descr *descr) ++{ ++ int connection = -1; ++ int opt = 1, ret = -1; ++ ++ connection = accept(fd, NULL, 0); ++ if (connection < 0) { ++ SYSERROR("Failed to accept connection to run command"); ++ return LXC_MAINLOOP_ERROR; ++ } ++ ++ ret = fcntl(connection, F_SETFD, FD_CLOEXEC); ++ if (ret < 0) { ++ SYSERROR("Failed to set close-on-exec on incoming command connection"); ++ goto out_close; ++ } ++ ++ ret = setsockopt(connection, SOL_SOCKET, SO_PASSCRED, &opt, sizeof(opt)); ++ if (ret < 0) { ++ SYSERROR("Failed to enable necessary credentials on command socket"); ++ goto out_close; ++ } ++ ++ ret = lxc_mainloop_add_handler(descr, connection, lxc_exec_cmd_handler, data); ++ if (ret) { ++ ERROR("Failed to add command handler"); ++ goto out_close; ++ } ++ ++out: ++ return ret; ++ ++out_close: ++ close(connection); ++ goto out; ++} ++ ++int lxc_exec_cmd_init(const char *name, const char *lxcpath, const char *suffix) ++{ ++ int fd, ret; ++ char path[LXC_AUDS_ADDR_LEN] = {0}; ++ ++ ret = lxc_make_abstract_socket_name(path, sizeof(path), name, lxcpath, NULL, suffix); ++ if (ret < 0) ++ return -1; ++ TRACE("Creating abstract unix socket \"%s\"", &path[1]); ++ ++ fd = lxc_abstract_unix_open(path, SOCK_STREAM, 0); ++ if (fd < 0) { ++ SYSERROR("Failed to create command socket %s", &path[1]); ++ if (errno == EADDRINUSE) ++ ERROR("Container \"%s\" appears to be already running", name); ++ ++ return -1; ++ } ++ ++ ret = fcntl(fd, F_SETFD, FD_CLOEXEC); ++ if (ret < 0) { ++ SYSERROR("Failed to set FD_CLOEXEC on command socket file descriptor"); ++ close(fd); ++ return -1; ++ } ++ ++ return fd; ++} ++ ++int lxc_exec_cmd_mainloop_add(struct lxc_epoll_descr *descr, struct lxc_exec_command_handler *handler) ++{ ++ int ret; ++ int fd = handler->maincmd_fd; ++ ++ ret = lxc_mainloop_add_handler(descr, fd, lxc_exec_cmd_accept, handler); ++ if (ret < 0) { ++ ERROR("Failed to add handler for command socket"); ++ close(fd); ++ } ++ ++ return ret; ++} +diff --git a/src/lxc/exec_commands.h b/src/lxc/exec_commands.h +new file mode 100644 +index 0000000..2581ee9 +--- /dev/null ++++ b/src/lxc/exec_commands.h +@@ -0,0 +1,73 @@ ++/****************************************************************************** ++ * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. ++ * Author: lifeng ++ * Create: 2019-12-08 ++ * Description: provide container definition ++ * lxc: linux Container library ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ ******************************************************************************/ ++ ++#ifndef __LXC_EXEC_COMMANDS_H ++#define __LXC_EXEC_COMMANDS_H ++ ++#include ++#include ++#include ++ ++#include "lxccontainer.h" ++#include "macro.h" ++#include "state.h" ++#include "terminal.h" ++ ++struct lxc_exec_command_handler { ++ int maincmd_fd; ++ struct lxc_terminal *terminal; ++}; ++ ++typedef enum { ++ LXC_EXEC_CMD_SET_TERMINAL_WINCH, ++ LXC_EXEC_CMD_MAX, ++} lxc_exec_cmd_t; ++ ++struct lxc_exec_cmd_req { ++ lxc_exec_cmd_t cmd; ++ int datalen; ++ const void *data; ++}; ++ ++struct lxc_exec_cmd_rsp { ++ int ret; /* 0 on success, -errno on failure */ ++ int datalen; ++ void *data; ++}; ++ ++struct lxc_exec_cmd_rr { ++ struct lxc_exec_cmd_req req; ++ struct lxc_exec_cmd_rsp rsp; ++}; ++ ++struct lxc_exec_cmd_set_terminal_winch_request { ++ unsigned int height; ++ unsigned int width; ++}; ++ ++struct lxc_epoll_descr; ++struct lxc_handler; ++ ++extern int lxc_exec_cmd_init(const char *name, const char *lxcpath, const char *suffix); ++extern int lxc_exec_cmd_mainloop_add(struct lxc_epoll_descr *descr, struct lxc_exec_command_handler *handler); ++extern int lxc_exec_cmd_set_terminal_winch(const char *name, const char *lxcpath, const char *suffix, unsigned int height, unsigned int width); ++ ++#endif /* __exec_commands_h */ +diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c +index 9f9cbfc..7ef57f0 100644 +--- a/src/lxc/lxccontainer.c ++++ b/src/lxc/lxccontainer.c +@@ -47,6 +47,7 @@ + #include "cgroup.h" + #include "commands.h" + #include "commands_utils.h" ++#include "exec_commands.h" + #include "conf.h" + #include "config.h" + #include "confile.h" +@@ -4214,7 +4215,7 @@ static bool do_lxcapi_rename(struct lxc_container *c, const char *newname) + + WRAP_API_1(bool, lxcapi_rename, const char *) + +-static int lxcapi_attach(struct lxc_container *c, lxc_attach_exec_t exec_function, void *exec_payload, lxc_attach_options_t *options, pid_t *attached_process) ++static int lxcapi_attach(struct lxc_container *c, const char *suffix, lxc_attach_exec_t exec_function, void *exec_payload, lxc_attach_options_t *options, pid_t *attached_process) + { + int ret; + +@@ -4223,12 +4224,12 @@ static int lxcapi_attach(struct lxc_container *c, lxc_attach_exec_t exec_functio + + current_config = c->lxc_conf; + +- ret = lxc_attach(c->name, c->config_path, exec_function, exec_payload, options, attached_process, &c->lxc_conf->errmsg); ++ ret = lxc_attach(c->name, c->config_path, suffix, exec_function, exec_payload, options, attached_process, &c->lxc_conf->errmsg); + current_config = NULL; + return ret; + } + +-static int do_lxcapi_attach_run_wait(struct lxc_container *c, lxc_attach_options_t *options, const char *program, const char * const argv[]) ++static int do_lxcapi_attach_run_wait(struct lxc_container *c, const char *suffix, lxc_attach_options_t *options, const char *program, const char * const argv[]) + { + lxc_attach_command_t command; + pid_t pid; +@@ -4240,7 +4241,7 @@ static int do_lxcapi_attach_run_wait(struct lxc_container *c, lxc_attach_options + command.program = (char*)program; + command.argv = (char**)argv; + +- r = lxc_attach(c->name, c->config_path, lxc_attach_run_command, &command, options, &pid, NULL); ++ r = lxc_attach(c->name, c->config_path, suffix, lxc_attach_run_command, &command, options, &pid, NULL); + if (r < 0) { + ERROR("ups"); + return r; +@@ -4249,12 +4250,12 @@ static int do_lxcapi_attach_run_wait(struct lxc_container *c, lxc_attach_options + return lxc_wait_for_pid_status(pid); + } + +-static int lxcapi_attach_run_wait(struct lxc_container *c, lxc_attach_options_t *options, const char *program, const char * const argv[]) ++static int lxcapi_attach_run_wait(struct lxc_container *c, const char *suffix, lxc_attach_options_t *options, const char *program, const char * const argv[]) + { + int ret; + + current_config = c ? c->lxc_conf : NULL; +- ret = do_lxcapi_attach_run_wait(c, options, program, argv); ++ ret = do_lxcapi_attach_run_wait(c, suffix, options, program, argv); + current_config = NULL; + + return ret; +@@ -5109,7 +5110,7 @@ static bool do_lxcapi_restore(struct lxc_container *c, char *directory, bool ver + + WRAP_API_2(bool, lxcapi_restore, char *, bool) + +-static int lxcapi_attach_run_waitl(struct lxc_container *c, lxc_attach_options_t *options, const char *program, const char *arg, ...) ++static int lxcapi_attach_run_waitl(struct lxc_container *c, const char *suffix, lxc_attach_options_t *options, const char *program, const char *arg, ...) + { + va_list ap; + const char **argv; +@@ -5131,7 +5132,7 @@ static int lxcapi_attach_run_waitl(struct lxc_container *c, lxc_attach_options_t + } + argv[0] = arg; + +- ret = do_lxcapi_attach_run_wait(c, options, program, (const char * const *)argv); ++ ret = do_lxcapi_attach_run_wait(c, suffix, options, program, (const char * const *)argv); + free((void*)argv); + + out: +@@ -5230,6 +5231,51 @@ static bool do_lxcapi_clean_container_resource(struct lxc_container *c, pid_t pi + + WRAP_API_1(bool, lxcapi_clean_container_resource, pid_t) + ++static bool do_lxcapi_set_terminal_winch(struct lxc_container *c, unsigned int height, unsigned int width) ++{ ++ bool ret = true; ++ ++ if (!c || !c->lxc_conf) ++ return false; ++ if (container_mem_lock(c)) { ++ ERROR("Error getting mem lock"); ++ return false; ++ } ++ ++ if (lxc_cmd_set_terminal_winch(c->name, c->config_path, height, width)) { ++ ERROR("Error set terminal winch"); ++ ret = false; ++ } ++ ++ container_mem_unlock(c); ++ return ret; ++} ++ ++WRAP_API_2(bool, lxcapi_set_terminal_winch, unsigned int, unsigned int) ++ ++static bool do_lxcapi_set_exec_terminal_winch(struct lxc_container *c, const char *suffix, unsigned int height, unsigned int width) ++{ ++ bool ret = true; ++ ++ if (!c || !c->lxc_conf) ++ return false; ++ if (container_mem_lock(c)) { ++ ERROR("Error getting mem lock"); ++ return false; ++ } ++ ++ if (lxc_exec_cmd_set_terminal_winch(c->name, c->config_path, suffix, height, width)) { ++ ERROR("Error set terminal winch"); ++ ret = false; ++ } ++ ++ container_mem_unlock(c); ++ return ret; ++} ++ ++WRAP_API_3(bool, lxcapi_set_exec_terminal_winch, const char *, unsigned int, unsigned int) ++ ++ + /* isulad get coantainer pids */ + static bool do_lxcapi_get_container_pids(struct lxc_container *c, pid_t **pids,size_t *pids_len) + { +@@ -5484,6 +5530,8 @@ static struct lxc_container *do_lxc_container_new(const char *name, const char * + c->clean_container_resource = lxcapi_clean_container_resource; + c->add_terminal_fifos = lxcapi_add_terminal_fifo; + c->get_container_pids = lxcapi_get_container_pids; ++ c->set_terminal_winch = lxcapi_set_terminal_winch; ++ c->set_exec_terminal_winch = lxcapi_set_exec_terminal_winch; + /* isulad add end */ + return c; + +diff --git a/src/lxc/lxccontainer.h b/src/lxc/lxccontainer.h +index 608f815..976acf4 100644 +--- a/src/lxc/lxccontainer.h ++++ b/src/lxc/lxccontainer.h +@@ -674,7 +674,7 @@ struct lxc_container { + * + * \return \c 0 on success, \c -1 on error. + */ +- int (*attach)(struct lxc_container *c, lxc_attach_exec_t exec_function, ++ int (*attach)(struct lxc_container *c, const char *suffix, lxc_attach_exec_t exec_function, + void *exec_payload, lxc_attach_options_t *options, pid_t *attached_process); + + /*! +@@ -688,7 +688,7 @@ struct lxc_container { + * \return \c waitpid(2) status of exited process that ran \p + * program, or \c -1 on error. + */ +- int (*attach_run_wait)(struct lxc_container *c, lxc_attach_options_t *options, const char *program, const char * const argv[]); ++ int (*attach_run_wait)(struct lxc_container *c, const char *suffix, lxc_attach_options_t *options, const char *program, const char * const argv[]); + + /*! + * \brief Run a program inside a container and wait for it to exit (list variant). +@@ -701,7 +701,7 @@ struct lxc_container { + * \return \c waitpid(2) status of exited process that ran \p + * program, or \c -1 on error. + */ +- int (*attach_run_waitl)(struct lxc_container *c, lxc_attach_options_t *options, const char *program, const char *arg, ...); ++ int (*attach_run_waitl)(struct lxc_container *c, const char *suffix, lxc_attach_options_t *options, const char *program, const char *arg, ...); + + /*! + * \brief Create a container snapshot. +@@ -958,6 +958,15 @@ struct lxc_container { + * \return \c true on success, else \c false. + */ + bool (*get_container_pids)(struct lxc_container *c,pid_t **pids,size_t *pids_len); ++ /*! isulad add ++ * \brief An API call to set terminal winch ++ * ++ * \param c Container. ++ * \return \c true on success, else \c false. ++ */ ++ bool (*set_terminal_winch)(struct lxc_container *c, unsigned int height, unsigned int width); ++ ++ bool (*set_exec_terminal_winch)(struct lxc_container *c, const char *suffix, unsigned int height, unsigned int width); + }; + + /*! +diff --git a/src/lxc/terminal.c b/src/lxc/terminal.c +index bccc23d..535f374 100644 +--- a/src/lxc/terminal.c ++++ b/src/lxc/terminal.c +@@ -69,6 +69,32 @@ __attribute__((constructor)) void lxc_terminal_init_global(void) + lxc_list_init(&lxc_ttys); + } + ++int lxc_set_terminal_winsz(struct lxc_terminal *terminal, unsigned int height, unsigned int width) ++{ ++ int ret = 0; ++ struct winsize wsz; ++ ++ if (terminal->master < 0) { ++ return 0; ++ } ++ ++ ret = ioctl(terminal->master, TIOCGWINSZ, &wsz); ++ if (ret < 0) { ++ WARN("Failed to get window size"); ++ return -1; ++ } ++ wsz.ws_col = width; ++ wsz.ws_row = height; ++ ++ ret = ioctl(terminal->master, TIOCSWINSZ, &wsz); ++ if (ret < 0) ++ WARN("Failed to set window size"); ++ else ++ DEBUG("Set window size to %d columns and %d rows", wsz.ws_col, ++ wsz.ws_row); ++ return ret; ++} ++ + void lxc_terminal_winsz(int srcfd, int dstfd) + { + int ret; +diff --git a/src/lxc/terminal.h b/src/lxc/terminal.h +index 9bb341f..4b5c70e 100644 +--- a/src/lxc/terminal.h ++++ b/src/lxc/terminal.h +@@ -313,5 +313,6 @@ extern int lxc_terminal_map_ids(struct lxc_conf *c, + /* isulad: if fd == -1, means delete all the fifos*/ + int lxc_terminal_delete_fifo(int fd, struct lxc_list *list); + int lxc_terminal_add_fifos(struct lxc_conf *conf, const char *fifonames); ++int lxc_set_terminal_winsz(struct lxc_terminal *terminal, unsigned int height, unsigned int width); + + #endif /* __LXC_TERMINAL_H */ +diff --git a/src/lxc/tools/arguments.h b/src/lxc/tools/arguments.h +index de02aeb..cb7f776 100644 +--- a/src/lxc/tools/arguments.h ++++ b/src/lxc/tools/arguments.h +@@ -71,6 +71,7 @@ struct lxc_arguments { + + /* for lxc-attach */ + int64_t attach_timeout; ++ const char *suffix; /* isulad add, suffix used for connect with parent of execed process*/ + + /* for lxc-console */ + unsigned int ttynum; +@@ -191,7 +192,7 @@ struct lxc_arguments { + #define OPT_DISABLE_PTY OPT_USAGE - 13 + #define OPT_OPEN_STDIN OPT_USAGE - 14 + #define OPT_ATTACH_TIMEOUT OPT_USAGE - 15 +- ++#define OPT_ATTACH_SUFFIX OPT_USAGE - 16 + /* isulad add end*/ + + extern int lxc_arguments_parse(struct lxc_arguments *args, int argc, +diff --git a/src/lxc/tools/lxc_attach.c b/src/lxc/tools/lxc_attach.c +index 0d40155..56684e7 100644 +--- a/src/lxc/tools/lxc_attach.c ++++ b/src/lxc/tools/lxc_attach.c +@@ -82,6 +82,7 @@ static const struct option my_longopts[] = { + {"out-fifo", required_argument, 0, OPT_OUTPUT_FIFO}, + {"err-fifo", required_argument, 0, OPT_STDERR_FIFO}, + {"timeout", required_argument, 0, OPT_ATTACH_TIMEOUT}, ++ {"suffix", required_argument, 0, OPT_ATTACH_SUFFIX}, + LXC_COMMON_OPTIONS + }; + +@@ -287,6 +288,9 @@ static int my_parser(struct lxc_arguments *args, int c, char *arg) + } + args->attach_timeout = (unsigned int)atoll(arg); + break; ++ case OPT_ATTACH_SUFFIX: ++ args->suffix = arg; ++ break; + } + + return 0; +@@ -351,7 +355,7 @@ static int lxc_attach_create_log_file(const char *log_file) + } + + /*isulad: attach with terminal*/ +-static int do_attach_foreground(struct lxc_container *c, lxc_attach_command_t *command, ++static int do_attach_foreground(struct lxc_container *c, const char *suffix, lxc_attach_command_t *command, + lxc_attach_options_t *attach_options, + char **errmsg) + { +@@ -361,9 +365,9 @@ static int do_attach_foreground(struct lxc_container *c, lxc_attach_command_t *c + int signal; + + if (command->program) +- ret = c->attach(c, lxc_attach_run_command, command, attach_options, &pid); ++ ret = c->attach(c, suffix, lxc_attach_run_command, command, attach_options, &pid); + else +- ret = c->attach(c, lxc_attach_run_shell, NULL, attach_options, &pid); ++ ret = c->attach(c, suffix, lxc_attach_run_shell, NULL, attach_options, &pid); + if (ret < 0) + goto out; + +@@ -399,7 +403,7 @@ static void close_msg_pipe(int *errpipe) + } + + /*isulad: attach without terminal in background */ +-static int do_attach_background(struct lxc_container *c, lxc_attach_command_t *command, ++static int do_attach_background(struct lxc_container *c, const char *suffix, lxc_attach_command_t *command, + lxc_attach_options_t *attach_options, + char **errmsg) + { +@@ -458,9 +462,9 @@ static int do_attach_background(struct lxc_container *c, lxc_attach_command_t *c + setsid(); + + if (command->program) +- ret = c->attach(c, lxc_attach_run_command, command, attach_options, &pid); ++ ret = c->attach(c, suffix, lxc_attach_run_command, command, attach_options, &pid); + else +- ret = c->attach(c, lxc_attach_run_shell, NULL, attach_options, &pid); ++ ret = c->attach(c, suffix, lxc_attach_run_shell, NULL, attach_options, &pid); + if (ret < 0) { + if (c->lxc_conf->errmsg) + lxc_write_error_message(msgpipe[1], "%s", c->lxc_conf->errmsg); +@@ -580,9 +584,9 @@ int main(int argc, char *argv[]) + + /* isulad: add do attach background */ + if (attach_options.attach_flags & LXC_ATTACH_TERMINAL) +- wexit = do_attach_foreground(c, &command, &attach_options, &errmsg); ++ wexit = do_attach_foreground(c, my_args.suffix, &command, &attach_options, &errmsg); + else +- wexit = do_attach_background(c, &command, &attach_options, &errmsg); ++ wexit = do_attach_background(c, my_args.suffix, &command, &attach_options, &errmsg); + + if (errmsg) { + fprintf(stderr, "%s:%s:%s:%d starting container process caused \"%s\"", c->name, +diff --git a/src/lxc/tools/lxc_copy.c b/src/lxc/tools/lxc_copy.c +index 954f1dd..b4e2b8f 100644 +--- a/src/lxc/tools/lxc_copy.c ++++ b/src/lxc/tools/lxc_copy.c +@@ -467,7 +467,7 @@ static int do_clone_ephemeral(struct lxc_container *c, + goto destroy_and_put; + + if (arg->daemonize && arg->argc) { +- ret = clone->attach_run_wait(clone, &attach_options, arg->argv[0], (const char *const *)arg->argv); ++ ret = clone->attach_run_wait(clone, NULL, &attach_options, arg->argv[0], (const char *const *)arg->argv); + if (ret < 0) + goto destroy_and_put; + clone->shutdown(clone, -1); +diff --git a/src/lxc/tools/lxc_ls.c b/src/lxc/tools/lxc_ls.c +index e261c7b..9fd1bf3 100644 +--- a/src/lxc/tools/lxc_ls.c ++++ b/src/lxc/tools/lxc_ls.c +@@ -544,7 +544,7 @@ static int ls_get(struct ls **m, size_t *size, const struct lxc_arguments *args, + + /* fork(): Attach to the namespace of the container and + * run ls_get() in it which is called in ls_get_wrapper(). */ +- check = c->attach(c, ls_get_wrapper, &wargs, &aopt, &out); ++ check = c->attach(c, NULL, ls_get_wrapper, &wargs, &aopt, &out); + /* close the socket */ + close(wargs.pipefd[1]); + +-- +1.8.3.1 + diff --git a/lxc.spec b/lxc.spec index 9ebcb0c1b43555aebff1b20bfc52253a3241c84a..07a051dd023f560c79d27a3b667d891c11e45675 100644 --- a/lxc.spec +++ b/lxc.spec @@ -1,4 +1,4 @@ -%global _release 20191226 +%global _release 20200106 %global debug_package %{nil} Name: lxc @@ -142,6 +142,13 @@ Patch9130: 0128-link-proc-mounts-to-etc-mtab.patch Patch9131: 0129-cgfsng-add-retry-for-enter-cgroup.patch Patch9132: 0130-fix-snprintf-create-abstract-socket-name-bug.patch Patch9133: 0131-fix-commands-and-terminal-memory-leak-bug.patch +Patch9134: 0132-lxc-fix-bug-in-cgroup-parent.patch +Patch9135: 0133-lxc-fix-bug-in-cgfsng.patch +Patch9136: 0134-lxc-do-cpuset-same-as-runc.patch +Patch9137: 0135-lxc-fix-code-warnings-for-cgfsng.c.patch +Patch9138: 0136-lxc-fix-retry-bug-in-cgroup.patch +Patch9139: 0137-lxc-fix-bug-in-read-proc.patch +Patch9140: 0138-resize-implement-resize-function-in-exec-start.patch BuildRequires: systemd-units git libtool graphviz docbook2X doxygen chrpath BuildRequires: pkgconfig(libseccomp)