]> git.proxmox.com Git - mirror_lxc.git/commitdiff
Make /dev/kmsg symlinking optional, add lxc.kmsg option
authorAlexander Vladimirov <alexander.idkfa.vladimirov@gmail.com>
Mon, 11 Mar 2013 05:15:18 +0000 (13:15 +0800)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Wed, 13 Mar 2013 13:51:39 +0000 (08:51 -0500)
Had this changeset hanging around for some time, maybe this would be useful
until some better solution come up.

Signed-off-by: Alexander Vladimirov <alexander.idkfa.vladimirov@gmail.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
src/lxc/conf.c
src/lxc/conf.h
src/lxc/confile.c

index 9700c7aa2797d1c51dca8fea16d3bede4f5befb4..e30c720bab45f06a0ab9cf4d7603d3aa6c25ad4b 100644 (file)
@@ -2768,8 +2768,10 @@ int lxc_setup(const char *name, struct lxc_conf *lxc_conf)
                return -1;
        }
 
-       if (setup_kmsg(&lxc_conf->rootfs, &lxc_conf->console))  // don't fail
-               ERROR("failed to setup kmsg for '%s'", name);
+       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 (setup_tty(&lxc_conf->rootfs, &lxc_conf->tty_info, lxc_conf->ttydir)) {
                ERROR("failed to setup the ttys for '%s'", name);
index 4c25970f309c81d44a6437b56fb938f2a182637e..f05c0737b2ddc303f44160bbb15c9b4aeb7ce0e6 100644 (file)
@@ -278,6 +278,7 @@ struct lxc_conf {
        int maincmd_fd;
        int autodev;  // if 1, mount and fill a /dev at start
        int stopsignal; // signal used to stop container
+       int kmsg;  // if 1, create /dev/kmsg symlink
        char *rcfile;   // Copy of the top level rcfile we read
 };
 
index cd02b2e2c3e4c7067503fc5c9bba6f8a20697624..cf5e3aec13ca130041c543f9f20d14da7af6e6d9 100644 (file)
@@ -56,6 +56,7 @@ static int config_personality(const char *, const char *, struct lxc_conf *);
 static int config_pts(const char *, const char *, struct lxc_conf *);
 static int config_tty(const char *, const char *, struct lxc_conf *);
 static int config_ttydir(const char *, const char *, struct lxc_conf *);
+static int config_kmsg(const char *, const char *, struct lxc_conf *);
 #if HAVE_APPARMOR
 static int config_aa_profile(const char *, const char *, struct lxc_conf *);
 #endif
@@ -97,6 +98,7 @@ static struct lxc_config_t config[] = {
        { "lxc.pts",                  config_pts                  },
        { "lxc.tty",                  config_tty                  },
        { "lxc.devttydir",            config_ttydir               },
+       { "lxc.kmsg",                 config_kmsg                 },
 #if HAVE_APPARMOR
        { "lxc.aa_profile",            config_aa_profile          },
 #endif
@@ -933,6 +935,16 @@ static int config_ttydir(const char *key, const char *value,
        return 0;
 }
 
+static int config_kmsg(const char *key, const char *value,
+                         struct lxc_conf *lxc_conf)
+{
+       int v = atoi(value);
+
+       lxc_conf->kmsg = v;
+
+       return 0;
+}
+
 #if HAVE_APPARMOR
 static int config_aa_profile(const char *key, const char *value,
                             struct lxc_conf *lxc_conf)