[Libct] Queries regarding libct_fs_set_private() API

Monali Porob Monali.Porob at huawei.com
Tue Mar 10 13:52:38 PDT 2015


Hi Andrew, 

Thanks for your reply. I need some more help in understanding this further. 

Please could you elaborate when I need to use libct_fs_set_private(). what is the difference between libct_fs_set_private() and libct_fs_set_root() ?
If you provide some code to explain their differences and comment on typical use-cases, it would be great. 

Should the directories like bin lib lib64 which are host directories and bind mounted in the root of container also listed under the private directory of the container when I use  both 
libct_fs_set_root(ct, FS_ROOT) and  libct_fs_set_private(ct, CT_FS_SUBDIR, FS_PRIVATE) .

Regards,
Monali



-----Original Message-----
From: Andrew Vagin [mailto:avagin at parallels.com] 
Sent: Tuesday, February 17, 2015 2:40 AM
To: Monali Porob
Cc: Andrew Vagin; libct at openvz.org
Subject: Re: Queries regarding libct_fs_set_private() API

On Fri, Feb 06, 2015 at 10:59:42PM +0000, Monali Porob wrote:
> Hi Andrew ,
> 
>  
> 
> W.rt the mount namespace libct APIs , I wanted to know a bit more on 
> how the
> libct_fs_set_private() API is useful .
> 
> Qn 1: What is the use case where I need this .  Please could you 
> provide some pointers here .

libct_fs_set_private() can be used to mount a root directory for a container.

...

> 
> 	libct_fs_set_root(ct, FS_ROOT);
> 	
> 	libct_fs_add_bind_mount(ct, FS_EXT_BIN, FS_CT_BIN, 0);
> 	libct_fs_add_bind_mount(ct, FS_EXT_LIB, FS_CT_LIB, 0);
> 	libct_fs_add_bind_mount(ct, FS_EXT_LIB64, FS_CT_LIB64, 0);
> 
> 
> 	libct_fs_add_mount(ct, "test_devpts", FS_PTS, 0, "devpts", "newinstance");
> 	libct_fs_set_private(ct, CT_FS_SUBDIR, FS_PRIVATE);

I think you need to call libct_fs_add_bind_mount instead of libct_fs_set_private.




More information about the Libct mailing list