Commit 23b7ea69 by Daniel Lezcano Committed by Daniel Lezcano

add lxc.rootfs.mount config option

Define lxc.rootfs.mount option in order to override the default mount point for rootfs. Signed-off-by: 's avatarDaniel Lezcano <dlezcano@fr.ibm.com>
parent 33fcb7a0
......@@ -170,6 +170,7 @@ struct lxc_console {
*/
struct lxc_rootfs {
char *path;
char *mount;
char *pivot;
};
......
......@@ -48,6 +48,7 @@ static int config_tty(const char *, char *, struct lxc_conf *);
static int config_cgroup(const char *, char *, struct lxc_conf *);
static int config_mount(const char *, char *, struct lxc_conf *);
static int config_rootfs(const char *, char *, struct lxc_conf *);
static int config_rootfs_mount(const char *, char *, struct lxc_conf *);
static int config_pivotdir(const char *, char *, struct lxc_conf *);
static int config_utsname(const char *, char *, struct lxc_conf *);
static int config_network_type(const char *, char *, struct lxc_conf *);
......@@ -77,6 +78,7 @@ static struct config config[] = {
{ "lxc.tty", config_tty },
{ "lxc.cgroup", config_cgroup },
{ "lxc.mount", config_mount },
{ "lxc.rootfs.mount", config_rootfs_mount },
{ "lxc.rootfs", config_rootfs },
{ "lxc.pivotdir", config_pivotdir },
{ "lxc.utsname", config_utsname },
......@@ -652,6 +654,22 @@ static int config_rootfs(const char *key, char *value, struct lxc_conf *lxc_conf
return 0;
}
static int config_rootfs_mount(const char *key, char *value, struct lxc_conf *lxc_conf)
{
if (strlen(value) >= MAXPATHLEN) {
ERROR("%s path is too long", value);
return -1;
}
lxc_conf->rootfs.mount = strdup(value);
if (!lxc_conf->rootfs.mount) {
SYSERROR("failed to duplicate string '%s'", value);
return -1;
}
return 0;
}
static int config_pivotdir(const char *key, char *value, struct lxc_conf *lxc_conf)
{
if (strlen(value) >= MAXPATHLEN) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment