Make overlayfs mounts work directly
Make overlayfs mounts work directly

When users wanted to mount overlay directories with lxc.mount.entry they had to
create upperdirs and workdirs beforehand in order to mount them. To create it
for them we add the functions mount_entry_create_overlay_dirs() and
mount_entry_create_aufs_dirs() which do this for them. User can now simply
specify e.g.:

        lxc.mount.entry = /lower merged overlay lowerdir=/lower,upper=/upper,workdir=/workdir,create=dir

and /upper and /workdir will be created for them. /upper and /workdir need to
be absolute paths to directories which are created under the containerdir (e.g.
under $lxcpath/CONTAINERNAME/). Relative mountpoints, mountpoints outside the
containerdir, and mountpoints within the container's rootfs are ignored. (The
latter *might* change in the future should it be considered safe/useful.)

Specifying

        lxc.mount.entry = /lower merged overlay lowerdir=/lower:/lower2,create=dir

will lead to a read-only overlay mount in accordance with the
kernel-documentation.

Specifying

        lxc.mount.entry = /lower merged overlay lowerdir=/lower,create=dir

will fail when no upperdir and workdir options are given.

Signed-off-by: Christian Brauner <94aca18939fc64aa4df96ea8cb026da8a2e1541a@gmail.com>
Acked-by: Serge E. Hallyn <3df611b026e4639bee8aef7a4beb2e39fcebb313@ubuntu.com>

federicobriata/lxc,ysbnim/lxc,thmo/lxc,Ponce/lxc,akshaykarle/lxc,ksperis/lxc,akshaykarle/lxc,fwilson42/lxc,ksperis/lxc,DarknessBeforeDawn/lxc,terceiro/lxc,LynxChaus/lxc,QingweiPeterLan/cs188-lxc,caglar10ur/lxc,aeris/lxc,cjwatson/lxc,caglar10ur/lxc,Distrotech/lxc,ss1h2a3tw/lxc,hfuCN/lxc,hfuCN/lxc,fwilson42/lxc,ss1h2a3tw/lxc,LynxChaus/lxc,DarknessBeforeDawn/lxc,armcc/lxc,thmo/lxc,terceiro/lxc,bostjan/lxc,armcc/lxc,hallyn/lxc,LynxChaus/lxc,Distrotech/lxc,ksperis/lxc,GreatFruitOmsk/lxc,QingweiPeterLan/cs188-lxc,tych0/lxc,bostjan/lxc,hfuCN/lxc,bostjan/lxc,federicobriata/lxc,cjwatson/lxc,hallyn/lxc,aeris/lxc,thmo/lxc,DarknessBeforeDawn/lxc,armcc/lxc,QingweiPeterLan/cs188-lxc,caglar10ur/lxc,tych0/lxc,cjwatson/lxc,federicobriata/lxc,aeris/lxc,Distrotech/lxc,ysbnim/lxc,ss1h2a3tw/lxc,fwilson42/lxc,ysbnim/lxc,tych0/lxc,Ponce/lxc,akshaykarle/lxc,hallyn/lxc,terceiro/lxc,Ponce/lxc,GreatFruitOmsk/lxc,GreatFruitOmsk/lxc