]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
confile: remove lxc.kmsg
authorChristian Brauner <christian.brauner@ubuntu.com>
Fri, 23 Jun 2017 13:38:02 +0000 (15:38 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Fri, 23 Jun 2017 14:00:23 +0000 (16:00 +0200)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
doc/lxc.container.conf.sgml.in
src/lxc/conf.c
src/lxc/conf.h
src/lxc/confile.c
src/tests/parse_config_file.c

index 745ccd8a3aaf79440076c4164d86fd40ce252445..de3f5b5e2d72bcbceed711a88c9826d2862abb23 100644 (file)
@@ -791,25 +791,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
       </variablelist>
     </refsect2>
 
-    <refsect2>
-      <title>Enable kmsg symlink</title>
-      <para>
-        Enable creating /dev/kmsg as symlink to /dev/console.  This defaults to 0.
-      </para>
-      <variablelist>
-    <varlistentry>
-      <term>
-        <option>lxc.kmsg</option>
-      </term>
-      <listitem>
-        <para>
-          Set this to 1 to enable /dev/kmsg symlinking.
-        </para>
-      </listitem>
-    </varlistentry>
-      </variablelist>
-    </refsect2>
-
     <refsect2>
       <title>Mount points</title>
       <para>
index 7ecfc82ec1059f8b65ff50c5a8be66940c22bdda..c5281b056d0dc55151608d73023428d06e48962c 100644 (file)
@@ -1632,33 +1632,6 @@ static int lxc_setup_console(const struct lxc_rootfs *rootfs,
        return lxc_setup_ttydir_console(rootfs, console, ttydir);
 }
 
-static int setup_kmsg(const struct lxc_rootfs *rootfs,
-                      const struct lxc_console *console)
-{
-       char kpath[MAXPATHLEN];
-       int ret;
-
-       if (!rootfs->path)
-               return 0;
-       ret = snprintf(kpath, sizeof(kpath), "%s/dev/kmsg", rootfs->mount);
-       if (ret < 0 || ret >= sizeof(kpath))
-               return -1;
-
-       ret = unlink(kpath);
-       if (ret && errno != ENOENT) {
-               SYSERROR("error unlinking %s", kpath);
-               return -1;
-       }
-
-       ret = symlink("console", kpath);
-       if (ret) {
-               SYSERROR("failed to create symlink for kmsg");
-               return -1;
-       }
-
-       return 0;
-}
-
 static void parse_mntopt(char *opt, unsigned long *flags, char **data)
 {
        struct mount_opt *mo;
@@ -2667,7 +2640,6 @@ struct lxc_conf *lxc_conf_init(void)
                free(new);
                return NULL;
        }
-       new->kmsg = 0;
        new->logfd = -1;
        lxc_list_init(&new->cgroup);
        lxc_list_init(&new->network);
@@ -4206,11 +4178,6 @@ int lxc_setup(struct lxc_handler *handler)
                return -1;
        }
 
-       if (lxc_conf->kmsg) {
-               if (setup_kmsg(&lxc_conf->rootfs, &lxc_conf->console))  // don't fail
-                       ERROR("failed to setup kmsg for '%s'", name);
-       }
-
        if (!lxc_conf->is_execute && setup_dev_symlinks(&lxc_conf->rootfs)) {
                ERROR("failed to setup /dev symlinks for '%s'", name);
                return -1;
index 495d6486faa485e12262f3dbc27214af5ff46110..24659b54bdbbdb504eda6661769a375412224846 100644 (file)
@@ -351,7 +351,6 @@ struct lxc_conf {
        int haltsignal; // signal used to halt container
        int rebootsignal; // signal used to reboot container
        int stopsignal; // signal used to hard stop container
-       unsigned int kmsg;  // if 1, create /dev/kmsg symlink
        char *rcfile;   // Copy of the top level rcfile we read
 
        // Logfile and logleve can be set in a container config file.
index cfad6c5a85e493cff083217ecfd2ba5dbe870b88..fec1d563832b39ce1d72becf37cdc18cb6416bac 100644 (file)
@@ -87,12 +87,6 @@ static int get_config_ttydir(const char *, char *, int, struct lxc_conf *,
                             void *);
 static int clr_config_ttydir(const char *, struct lxc_conf *, void *);
 
-static int set_config_kmsg(const char *, const char *, struct lxc_conf *,
-                          void *);
-static int get_config_kmsg(const char *, char *, int, struct lxc_conf *,
-                          void *);
-static int clr_config_kmsg(const char *, struct lxc_conf *, void *);
-
 static int set_config_apparmor_profile(const char *, const char *,
                                       struct lxc_conf *, void *);
 static int get_config_apparmor_profile(const char *, char *, int,
@@ -428,7 +422,6 @@ static struct lxc_config_t config[] = {
        { "lxc.pts",                       set_config_pts,                         get_config_pts,                         clr_config_pts,                       },
        { "lxc.tty",                       set_config_tty,                         get_config_tty,                         clr_config_tty,                       },
        { "lxc.devttydir",                 set_config_ttydir,                      get_config_ttydir,                      clr_config_ttydir,                    },
-       { "lxc.kmsg",                      set_config_kmsg,                        get_config_kmsg,                        clr_config_kmsg,                      },
        { "lxc.apparmor.profile",          set_config_apparmor_profile,            get_config_apparmor_profile,            clr_config_apparmor_profile,          },
        { "lxc.apparmor.allow_incomplete", set_config_apparmor_allow_incomplete,   get_config_apparmor_allow_incomplete,   clr_config_apparmor_allow_incomplete, },
        { "lxc.selinux.context",           set_config_selinux_context,             get_config_selinux_context,             clr_config_selinux_context,           },
@@ -1575,25 +1568,6 @@ static int set_config_ttydir(const char *key, const char *value,
                                          NAME_MAX + 1);
 }
 
-static int set_config_kmsg(const char *key, const char *value,
-                          struct lxc_conf *lxc_conf, void *data)
-{
-       /* Set config value to default. */
-       if (lxc_config_value_empty(value)) {
-               lxc_conf->kmsg = 0;
-               return 0;
-       }
-
-       /* Parse new config value. */
-       if (lxc_safe_uint(value, &lxc_conf->kmsg) < 0)
-               return -1;
-
-       if (lxc_conf->kmsg > 1)
-               return -1;
-
-       return 0;
-}
-
 static int set_config_apparmor_profile(const char *key, const char *value,
                                       struct lxc_conf *lxc_conf, void *data)
 {
@@ -3106,12 +3080,6 @@ static int get_config_ttydir(const char *key, char *retv, int inlen,
        return lxc_get_conf_str(retv, inlen, c->ttydir);
 }
 
-static int get_config_kmsg(const char *key, char *retv, int inlen,
-                          struct lxc_conf *c, void *data)
-{
-       return lxc_get_conf_int(c, retv, inlen, c->kmsg);
-}
-
 static int get_config_apparmor_profile(const char *key, char *retv, int inlen,
                                       struct lxc_conf *c, void *data)
 {
@@ -3694,13 +3662,6 @@ static inline int clr_config_ttydir(const char *key, struct lxc_conf *c,
        return 0;
 }
 
-static inline int clr_config_kmsg(const char *key, struct lxc_conf *c,
-                                 void *data)
-{
-       c->kmsg = 0;
-       return 0;
-}
-
 static inline int clr_config_apparmor_profile(const char *key,
                                              struct lxc_conf *c, void *data)
 {
index 6618596c6c319966c0f1b92138334f5bdeb24dbe..3836a361c90cae969ed4c444e6332b08c52f144a 100644 (file)
@@ -321,13 +321,6 @@ int main(int argc, char *argv[])
                goto non_test_error;
        }
 
-       /* lxc.kmsg */
-       if (set_get_compare_clear_save_load(c, "lxc.kmsg", "1", tmpf, true) <
-           0) {
-               lxc_error("%s\n", "lxc.kmsg");
-               goto non_test_error;
-       }
-
        /* REMOVE IN LXC 3.0
           legacy security keys
         */