]> git.proxmox.com Git - mirror_lxc.git/blobdiff - src/lxc/conf.h
conf: port environment to new list type
[mirror_lxc.git] / src / lxc / conf.h
index 7a63acffcd28f9bf7cde9c4610d8ee1c96487d08..0ec423458382fa218fb42fb50e9776f63bab277e 100644 (file)
@@ -211,13 +211,15 @@ struct lxc_mount_options {
        unsigned int create_file : 1;
        unsigned int optional : 1;
        unsigned int relative : 1;
-       unsigned int recursive : 1;
+       unsigned int bind_recursively : 1;
+       unsigned int propagate_recursively : 1;
        unsigned int bind : 1;
        char userns_path[PATH_MAX];
        unsigned long mnt_flags;
        unsigned long prop_flags;
        char *data;
        struct lxc_mount_attr attr;
+       char *raw_options;
 };
 
 /* Defines a structure to store the rootfs location, the
@@ -226,7 +228,6 @@ struct lxc_mount_options {
  * @mount        : where it is mounted
  * @buf                 : static buffer to construct paths
  * @bev_type     : optional backing store type
- * @options      : mount options
  * @managed      : whether it is managed by LXC
  * @dfd_mnt     : fd for @mount
  * @dfd_dev : fd for /dev of the container
@@ -245,7 +246,6 @@ struct lxc_rootfs {
 
        char buf[PATH_MAX];
        char *bdev_type;
-       char *options;
        bool managed;
        struct lxc_mount_options mnt_opts;
        struct lxc_storage *storage;
@@ -337,6 +337,12 @@ struct timens_offsets {
        int64_t ns_monotonic;
 };
 
+struct environment_entry {
+       char *key;
+       char *val;
+       struct list_head head;
+};
+
 struct lxc_conf {
        /* Pointer to the name of the container. Do not free! */
        const char *name;
@@ -436,14 +442,9 @@ struct lxc_conf {
        unsigned int monitor_unshare;
        unsigned int monitor_signal_pdeath;
 
-       /* list of included files */
-       struct lxc_list includes;
-       /* config entries which are not "lxc.*" are aliens */
-       struct lxc_list aliens;
-
        /* list of environment variables we'll add to the container when
         * started */
-       struct lxc_list environment;
+       struct list_head environment;
 
        /* text representation of the config file */
        char *unexpanded_config;
@@ -540,7 +541,6 @@ __hidden extern int lxc_clear_environment(struct lxc_conf *c);
 __hidden extern int lxc_clear_limits(struct lxc_conf *c, const char *key);
 __hidden extern int lxc_delete_autodev(struct lxc_handler *handler);
 __hidden extern int lxc_clear_autodev_tmpfs_size(struct lxc_conf *c);
-__hidden extern void lxc_clear_includes(struct lxc_conf *conf);
 __hidden extern int lxc_setup_rootfs_prepare_root(struct lxc_conf *conf, const char *name,
                                                  const char *lxcpath);
 __hidden extern int lxc_setup(struct lxc_handler *handler);
@@ -613,6 +613,7 @@ static inline void put_lxc_mount_options(struct lxc_mount_options *mnt_opts)
        mnt_opts->prop_flags = 0;
 
        free_disarm(mnt_opts->data);
+       free_disarm(mnt_opts->raw_options);
 }
 
 static inline void put_lxc_rootfs(struct lxc_rootfs *rootfs, bool unpin)
@@ -648,4 +649,6 @@ static inline int lxc_personality(personality_t persona)
        return personality(persona);
 }
 
+__hidden extern int lxc_set_environment(const struct lxc_conf *conf);
+
 #endif /* __LXC_CONF_H */