]> git.proxmox.com Git - mirror_lxc.git/commitdiff
confile: namespace lxc.log keys
author0x0916 <w@laoqinren.net>
Wed, 28 Jun 2017 09:30:41 +0000 (17:30 +0800)
committer0x0916 <w@laoqinren.net>
Fri, 30 Jun 2017 01:41:04 +0000 (09:41 +0800)
* rename lxc.logfile to lxc.log.file
* renaem lxc.loglevel to lxc.log.level
* rename lxc.syslog to lxc.log.syslog

the legacy keys will be kept around until LXC 3.0 and then will be
removed.

Signed-off-by: 0x0916 <w@laoqinren.net>
doc/ja/lxc.container.conf.sgml.in
doc/ko/lxc.container.conf.sgml.in
doc/lxc.container.conf.sgml.in
src/lxc/confile.c
src/lxc/log.c
src/python-lxc/lxc/__init__.py
src/tests/concurrent.c
src/tests/parse_config_file.c

index 8ac4189e52d588d7c1dc742b719686792b339a63..2835b0507e2840660eebfd62c43cdcb093dbf3d8 100644 (file)
@@ -2410,7 +2410,7 @@ by KATOH Yasufumi <karma at jazz.email.ne.jp>
       <variablelist>
         <varlistentry>
           <term>
-            <option>lxc.loglevel</option>
+            <option>lxc.log.level</option>
           </term>
           <listitem>
             <para>
@@ -2440,7 +2440,7 @@ by KATOH Yasufumi <karma at jazz.email.ne.jp>
         </varlistentry>
         <varlistentry>
           <term>
-            <option>lxc.logfile</option>
+            <option>lxc.log</option>
           </term>
           <listitem>
             <para>
@@ -2453,17 +2453,17 @@ by KATOH Yasufumi <karma at jazz.email.ne.jp>
         </varlistentry>
         <varlistentry>
           <term>
-            <option>lxc.syslog</option>
+            <option>lxc.log.syslog</option>
           </term>
           <listitem>
             <para>
               <!--
             Send logging info to syslog. It respects the log level defined in
-            <command>lxc.loglevel</command>. The argument should be the syslog
+            <command>lxc.log.level</command>. The argument should be the syslog
             facility to use, valid ones are: daemon, local0, local1, local2,
             local3, local4, local5, local5, local7.
             -->
-              ログ情報を syslog に送ります。ログレベルとして <command>lxc.loglevel</command> の値を使用します。指定する値は使用する syslog の facility です。有効な値は daemon, local0, local1, local2, local3, local4, local5, local5, local6, local7 のいずれかです。
+              ログ情報を syslog に送ります。ログレベルとして <command>lxc.log.level</command> の値を使用します。指定する値は使用する syslog の facility です。有効な値は daemon, local0, local1, local2, local3, local4, local5, local5, local6, local7 のいずれかです。
             </para>
           </listitem>
         </varlistentry>
index 9dba8a96a2851dd020eb2323aa3b1ccc8d09359e..1bbf8f440d590b15ab1483a45a6cef3c153b20cc 100644 (file)
@@ -2308,7 +2308,7 @@ mknod errno 0
       <variablelist>
        <varlistentry>
          <term>
-           <option>lxc.loglevel</option>
+           <option>lxc.log.level</option>
          </term>
          <listitem>
            <para>
@@ -2338,7 +2338,7 @@ mknod errno 0
        </varlistentry>
        <varlistentry>
          <term>
-           <option>lxc.logfile</option>
+           <option>lxc.log</option>
          </term>
          <listitem>
            <para>
@@ -2351,17 +2351,17 @@ mknod errno 0
        </varlistentry>
        <varlistentry>
          <term>
-           <option>lxc.syslog</option>
+           <option>lxc.log.syslog</option>
          </term>
          <listitem>
            <para>
              <!--
                  Send logging info to syslog. It respects the log level defined in
-                 <command>lxc.loglevel</command>. The argument should be the syslog
+                 <command>lxc.log.level</command>. The argument should be the syslog
                  facility to use, valid ones are: daemon, local0, local1, local2,
                  local3, local4, local5, local5, local7.
              -->
-             로그정보를 syslog에 보낸다. 로그 수준은 <command>lxc.loglevel</command>로 지정할 수 있다. 인자는 syslog에 정의된 값으로만 지정할 수 있다. 사용 가능한 값은 다음과 같다 : daemon, local0, local1, local2, local3, local4, local5, local5, local7 
+             로그정보를 syslog에 보낸다. 로그 수준은 <command>lxc.log.level</command>로 지정할 수 있다. 인자는 syslog에 정의된 값으로만 지정할 수 있다. 사용 가능한 값은 다음과 같다 : daemon, local0, local1, local2, local3, local4, local5, local5, local7 
            </para>
          </listitem>
        </varlistentry>
index cf47e1224d44b981e076ac74d5b12cf23495d42c..0ef45c494b3c228b86fc0c8fa7ef966bb7c35c84 100644 (file)
@@ -1741,7 +1741,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
       <variablelist>
         <varlistentry>
           <term>
-            <option>lxc.loglevel</option>
+            <option>lxc.log.level</option>
           </term>
           <listitem>
             <para>
@@ -1761,7 +1761,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
         </varlistentry>
         <varlistentry>
           <term>
-            <option>lxc.logfile</option>
+            <option>lxc.log</option>
           </term>
           <listitem>
             <para>
@@ -1771,12 +1771,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
         </varlistentry>
         <varlistentry>
           <term>
-            <option>lxc.syslog</option>
+            <option>lxc.log.syslog</option>
           </term>
           <listitem>
             <para>
             Send logging info to syslog. It respects the log level defined in
-            <command>lxc.loglevel</command>. The argument should be the syslog
+            <command>lxc.log.level</command>. The argument should be the syslog
             facility to use, valid ones are: daemon, local0, local1, local2,
             local3, local4, local5, local5, local6, local7.
             </para>
index df2a5056a7b9f4238f9c06f6a54a84c0d7ea81bf..1af6f5f661ebe854489d07b6999e05ba85bae80a 100644 (file)
@@ -83,8 +83,8 @@ lxc_config_define(apparmor_allow_incomplete);
 lxc_config_define(selinux_context);
 lxc_config_define(cgroup);
 lxc_config_define(idmaps);
-lxc_config_define(loglevel);
-lxc_config_define(logfile);
+lxc_config_define(log_level);
+lxc_config_define(log_file);
 lxc_config_define(mount);
 lxc_config_define(mount_auto);
 lxc_config_define(fstab);
@@ -129,7 +129,7 @@ lxc_config_define(init_cmd);
 lxc_config_define(init_uid);
 lxc_config_define(init_gid);
 lxc_config_define(ephemeral);
-lxc_config_define(syslog);
+lxc_config_define(log_syslog);
 lxc_config_define(no_new_privs);
 lxc_config_define(prlimit);
 
@@ -151,8 +151,6 @@ static struct lxc_config_t config[] = {
 
        { "lxc.cgroup",                    set_config_cgroup,                      get_config_cgroup,                      clr_config_cgroup,                    },
        { "lxc.id_map",                    set_config_idmaps,                      get_config_idmaps,                      clr_config_idmaps,                    },
-       { "lxc.loglevel",                  set_config_loglevel,                    get_config_loglevel,                    clr_config_loglevel,                  },
-       { "lxc.logfile",                   set_config_logfile,                     get_config_logfile,                     clr_config_logfile,                   },
        { "lxc.mount.entry",               set_config_mount,                       get_config_mount,                       clr_config_mount,                     },
        { "lxc.mount.auto",                set_config_mount_auto,                  get_config_mount_auto,                  clr_config_mount_auto,                },
        { "lxc.mount",                     set_config_fstab,                       get_config_fstab,                       clr_config_fstab,                     },
@@ -227,16 +225,21 @@ static struct lxc_config_t config[] = {
        { "lxc.group",                     set_config_group,                       get_config_group,                       clr_config_group,                     },
        { "lxc.environment",               set_config_environment,                 get_config_environment,                 clr_config_environment,               },
        { "lxc.ephemeral",                 set_config_ephemeral,                   get_config_ephemeral,                   clr_config_ephemeral,                 },
-       { "lxc.syslog",                    set_config_syslog,                      get_config_syslog,                      clr_config_syslog,                    },
        { "lxc.no_new_privs",              set_config_no_new_privs,                get_config_no_new_privs,                clr_config_no_new_privs,              },
 
        /* REMOVE IN LXC 3.0: legacy keys  [START]*/
+       { "lxc.syslog",                    set_config_log_syslog,                  get_config_log_syslog,                  clr_config_log_syslog,                },
+       { "lxc.loglevel",                  set_config_log_level,                   get_config_log_level,                   clr_config_log_level,                 },
+       { "lxc.logfile",                   set_config_log_file,                    get_config_log_file,                    clr_config_log_file,                  },
        { "lxc.init_cmd",                  set_config_init_cmd,                    get_config_init_cmd,                    clr_config_init_cmd,                  },
        { "lxc.init_uid",                  set_config_init_uid,                    get_config_init_uid,                    clr_config_init_uid,                  },
        { "lxc.init_gid",                  set_config_init_gid,                    get_config_init_gid,                    clr_config_init_gid,                  },
        { "lxc.limit",                     set_config_limit,                       get_config_limit,                       clr_config_limit,                     },
        /* REMOVE IN LXC 3.0: legacy keys  [END]*/
 
+       { "lxc.log.syslog",                set_config_log_syslog,                  get_config_log_syslog,                  clr_config_log_syslog,                },
+       { "lxc.log.level",                 set_config_log_level,                   get_config_log_level,                   clr_config_log_level,                 },
+       { "lxc.log.file",                  set_config_log_file,                    get_config_log_file,                    clr_config_log_file,                  },
        { "lxc.init.cmd",                  set_config_init_cmd,                    get_config_init_cmd,                    clr_config_init_cmd,                  },
        { "lxc.init.uid",                  set_config_init_uid,                    get_config_init_uid,                    clr_config_init_uid,                  },
        { "lxc.init.gid",                  set_config_init_gid,                    get_config_init_gid,                    clr_config_init_gid,                  },
@@ -1327,7 +1330,7 @@ static int set_config_selinux_context(const char *key, const char *value,
        return set_config_string_item(&lxc_conf->lsm_se_context, value);
 }
 
-static int set_config_logfile(const char *key, const char *value,
+static int set_config_log_file(const char *key, const char *value,
                              struct lxc_conf *c, void *data)
 {
        int ret;
@@ -1347,7 +1350,7 @@ static int set_config_logfile(const char *key, const char *value,
        return ret;
 }
 
-static int set_config_loglevel(const char *key, const char *value,
+static int set_config_log_level(const char *key, const char *value,
                               struct lxc_conf *lxc_conf, void *data)
 {
        int newlevel;
@@ -2677,7 +2680,7 @@ static int set_config_ephemeral(const char *key, const char *value,
        return 0;
 }
 
-static int set_config_syslog(const char *key, const char *value,
+static int set_config_log_syslog(const char *key, const char *value,
                             struct lxc_conf *lxc_conf, void *data)
 {
        int facility;
@@ -2695,7 +2698,7 @@ static int set_config_syslog(const char *key, const char *value,
        /* Parse value. */
        facility = lxc_syslog_priority_to_int(value);
        if (facility == -EINVAL) {
-               ERROR("Wrong value for lxc.syslog.");
+               ERROR("Wrong value for lxc.log.syslog.");
                return -1;
        }
 
@@ -2886,7 +2889,7 @@ static int get_config_idmaps(const char *key, char *retv, int inlen,
        return fulllen;
 }
 
-static int get_config_loglevel(const char *key, char *retv, int inlen,
+static int get_config_log_level(const char *key, char *retv, int inlen,
                               struct lxc_conf *c, void *data)
 {
        const char *v;
@@ -2894,7 +2897,7 @@ static int get_config_loglevel(const char *key, char *retv, int inlen,
        return lxc_get_conf_str(retv, inlen, v);
 }
 
-static int get_config_logfile(const char *key, char *retv, int inlen,
+static int get_config_log_file(const char *key, char *retv, int inlen,
                              struct lxc_conf *c, void *data)
 {
        return lxc_get_conf_str(retv, inlen, c->logfile);
@@ -3187,7 +3190,7 @@ static int get_config_start(const char *key, char *retv, int inlen,
        return -1;
 }
 
-static int get_config_syslog(const char *key, char *retv, int inlen,
+static int get_config_log_syslog(const char *key, char *retv, int inlen,
                             struct lxc_conf *c, void *data)
 {
        return lxc_get_conf_str(retv, inlen, c->syslog);
@@ -3388,14 +3391,14 @@ static inline int clr_config_idmaps(const char *key, struct lxc_conf *c,
        return lxc_clear_idmaps(c);
 }
 
-static inline int clr_config_loglevel(const char *key, struct lxc_conf *c,
+static inline int clr_config_log_level(const char *key, struct lxc_conf *c,
                                      void *data)
 {
        c->loglevel = LXC_LOG_LEVEL_NOTSET;
        return 0;
 }
 
-static inline int clr_config_logfile(const char *key, struct lxc_conf *c,
+static inline int clr_config_log_file(const char *key, struct lxc_conf *c,
                                     void *data)
 {
        free(c->logfile);
@@ -3554,7 +3557,7 @@ static inline int clr_config_start(const char *key, struct lxc_conf *c,
        return 0;
 }
 
-static inline int clr_config_syslog(const char *key, struct lxc_conf *c,
+static inline int clr_config_log_syslog(const char *key, struct lxc_conf *c,
                                    void *data)
 {
        free(c->syslog);
index edbd785efb9a3496cca8e81d0ce441cfb1cb3021..8105aca7cae9cdbb701e76111c7f440c72c3ecfa 100644 (file)
@@ -463,10 +463,10 @@ extern void lxc_log_close(void)
 /*
  * This can be called:
  *   1. when a program calls lxc_log_init with no logfile parameter (in which
- *      case the default is used).  In this case lxc.logfile can override this.
+ *      case the default is used).  In this case lxc.loge can override this.
  *   2. when a program calls lxc_log_init with a logfile parameter.  In this
- *     case we don't want lxc.logfile to override this.
- *   3. When a lxc.logfile entry is found in config file.
+ *     case we don't want lxc.log to override this.
+ *   3. When a lxc.log entry is found in config file.
  */
 static int __lxc_log_set_file(const char *fname, int create_dirs)
 {
@@ -614,7 +614,7 @@ extern int lxc_log_init(struct lxc_log *log)
 }
 
 /*
- * This is called when we read a lxc.loglevel entry in a lxc.conf file.  This
+ * This is called when we read a lxc.log.level entry in a lxc.conf file.  This
  * happens after processing command line arguments, which override the .conf
  * settings.  So only set the level if previously unset.
  */
index 989b1b409305b7c53020ff5ac1e034f58c08a4bb..ccc4d18bb67452b484c10b191c7710d900d7a64b 100644 (file)
@@ -387,7 +387,7 @@ class Container(_lxc.Container):
         new_value = self.get_config_item(key)
 
         # loglevel is special and won't match the string we set
-        if key == "lxc.loglevel":
+        if key == "lxc.log.level":
             new_value = value
 
         if (isinstance(value, str) and isinstance(new_value, str) and
index bfefa48094e2dff65b9fe20fdb05df4912103b1c..af63c6a073f929f535f5fc56f3f5c0dbe35b8c35 100644 (file)
@@ -85,8 +85,8 @@ static void do_function(void *arguments)
     }
 
     if (debug) {
-        c->set_config_item(c, "lxc.loglevel", "DEBUG");
-        c->set_config_item(c, "lxc.logfile", name);
+        c->set_config_item(c, "lxc.log.level", "DEBUG");
+        c->set_config_item(c, "lxc.log", name);
     }
 
     if (strcmp(args->mode, "create") == 0) {
index 815553f780645b371c4076dcd3816e19bfaed093..b2988d64663c01d582fc599eb4f2e18113f40157 100644 (file)
@@ -431,20 +431,39 @@ int main(int argc, char *argv[])
        c->clear_config(c);
        c->lxc_conf = NULL;
 
-       /* lxc.loglevel */
+       /* REMOVE IN LXC 3.0
+          legacy lxc.loglevel key
+        */
        if (set_get_compare_clear_save_load(c, "lxc.loglevel", "DEBUG", tmpf,
                                            true) < 0) {
                lxc_error("%s\n", "lxc.loglevel");
                goto non_test_error;
        }
 
-       /* lxc.logfile */
+       /* REMOVE IN LXC 3.0
+          legacy lxc.logfile key
+        */
        if (set_get_compare_clear_save_load(c, "lxc.logfile", "/some/path",
                                            tmpf, true) < 0) {
                lxc_error("%s\n", "lxc.logfile");
                goto non_test_error;
        }
 
+
+       /* lxc.log.level */
+       if (set_get_compare_clear_save_load(c, "lxc.log.level", "DEBUG", tmpf,
+                                           true) < 0) {
+               lxc_error("%s\n", "lxc.log.level");
+               goto non_test_error;
+       }
+
+       /* lxc.log */
+       if (set_get_compare_clear_save_load(c, "lxc.log.file", "/some/path",
+                                           tmpf, true) < 0) {
+               lxc_error("%s\n", "lxc.log.file");
+               goto non_test_error;
+       }
+
        /* lxc.mount */
        if (set_get_compare_clear_save_load(c, "lxc.mount", "/some/path", NULL,
                                            true) < 0) {
@@ -659,10 +678,10 @@ int main(int argc, char *argv[])
                goto non_test_error;
        }
 
-       /* lxc.syslog */
-       if (set_get_compare_clear_save_load(c, "lxc.syslog", "local0", tmpf,
+       /* lxc.log.syslog */
+       if (set_get_compare_clear_save_load(c, "lxc.log.syslog", "local0", tmpf,
                                            true) < 0) {
-               lxc_error("%s\n", "lxc.syslog");
+               lxc_error("%s\n", "lxc.log.syslog");
                goto non_test_error;
        }