]> git.proxmox.com Git - mirror_lxc.git/commitdiff
Add bind option for mounting setup
authordlezcano <dlezcano>
Wed, 3 Sep 2008 16:38:58 +0000 (16:38 +0000)
committerdlezcano <dlezcano>
Wed, 3 Sep 2008 16:38:58 +0000 (16:38 +0000)
src/liblxc/lxc_conf.c

index b1681cbdbebcf101c18d1f6510f6059a0fc81267..beea5cb42e7f44d0b96a75b6f9f304145307be7e 100644 (file)
@@ -606,6 +606,7 @@ static int setup_mount(const char *name)
        struct mntent *mntent;
        FILE *file;
        int ret = -1;
+       unsigned long mntflags = 0;
 
        snprintf(path, MAXPATHLEN, LXCPATH "/%s/fstab", name);
 
@@ -618,8 +619,12 @@ static int setup_mount(const char *name)
        }
 
        while((mntent = getmntent(file))) {
+
+               if (hasmntopt(mntent, "bind"))
+                       mntflags |= MS_BIND;
+
                if (mount(mntent->mnt_fsname, mntent->mnt_dir,
-                         mntent->mnt_type, 0, NULL)) {
+                         mntent->mnt_type, mntflags, NULL)) {
                        lxc_log_syserror("failed to mount '%s' on '%s'",
                                         mntent->mnt_fsname, mntent->mnt_dir);
                        goto out;