2
0
mirror of git://github.com/lxc/lxc synced 2025-08-31 06:29:29 +00:00

add lxc.rootfs.mount config option

Define lxc.rootfs.mount option in order to override the default
mount point for rootfs.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
This commit is contained in:
Daniel Lezcano
2010-05-12 23:44:28 +02:00
committed by Daniel Lezcano
parent 33fcb7a047
commit 23b7ea696b
2 changed files with 19 additions and 0 deletions

View File

@@ -170,6 +170,7 @@ struct lxc_console {
*/
struct lxc_rootfs {
char *path;
char *mount;
char *pivot;
};

View File

@@ -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) {