]> git.proxmox.com Git - mirror_lxc.git/commitdiff
confile: add getter for lxc.rootfs.options
authorChristian Brauner <christian.brauner@ubuntu.com>
Wed, 31 May 2017 05:39:11 +0000 (07:39 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Wed, 31 May 2017 08:03:29 +0000 (10:03 +0200)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/confile.c

index 099a86b73accf2ab7fed330d42dbf8c179f4d321..4cadc0f1ea9e001c29004925a45dc2950d72c695 100644 (file)
@@ -115,6 +115,8 @@ static int set_config_rootfs_mount(const char *, const char *, struct lxc_conf *
 static int get_config_rootfs_mount(struct lxc_container *, const char *, char *, int);
 
 static int set_config_rootfs_options(const char *, const char *, struct lxc_conf *);
+static int get_config_rootfs_options(struct lxc_container *, const char *, char *, int);
+
 static int set_config_rootfs_backend(const char *, const char *, struct lxc_conf *);
 static int set_config_pivotdir(const char *, const char *, struct lxc_conf *);
 static int set_config_utsname(const char *, const char *, struct lxc_conf *);
@@ -175,7 +177,7 @@ static struct lxc_config_t config[] = {
        { "lxc.mount.auto",           set_config_mount_auto,           get_config_mount_auto,        NULL},
        { "lxc.mount",                set_config_fstab,                get_config_fstab,             NULL},
        { "lxc.rootfs.mount",         set_config_rootfs_mount,         get_config_rootfs_mount,      NULL},
-       { "lxc.rootfs.options",       set_config_rootfs_options,        NULL, NULL},
+       { "lxc.rootfs.options",       set_config_rootfs_options,       get_config_rootfs_options,    NULL},
        { "lxc.rootfs.backend",       set_config_rootfs_backend,        NULL, NULL},
        { "lxc.rootfs",               set_config_rootfs,               get_config_rootfs,            NULL},
        { "lxc.pivotdir",             set_config_pivotdir,              NULL, NULL},
@@ -2908,8 +2910,6 @@ int lxc_get_config_item(struct lxc_conf *c, const char *key, char *retv,
                v = c->console.path;
        else if (strcmp(key, "lxc.rootfs.backend") == 0)
                v = c->rootfs.bdev_type;
-       else if (strcmp(key, "lxc.rootfs.options") == 0)
-               v = c->rootfs.options;
        else if (strcmp(key, "lxc.cap.drop") == 0)
                return lxc_get_item_cap_drop(c, retv, inlen);
        else if (strcmp(key, "lxc.cap.keep") == 0)
@@ -3840,3 +3840,9 @@ static int get_config_rootfs_mount(struct lxc_container *c, const char *key,
 {
        return lxc_get_conf_str(retv, inlen, c->lxc_conf->rootfs.mount);
 }
+
+static int get_config_rootfs_options(struct lxc_container *c, const char *key,
+                                    char *retv, int inlen)
+{
+       return lxc_get_conf_str(retv, inlen, c->lxc_conf->rootfs.options);
+}