[LTP] [PATCH v1] Extract libclone from testcases/kernel/containers

Andrea Cervesato andrea.cervesato@suse.com
Thu Feb 3 10:22:19 CET 2022


Hi!

On 2/3/22 06:31, Richard Palethorpe wrote:
> Hello,
>
> Petr Vorel<pvorel@suse.cz>  writes:
>
>> Hi Andrea,
>>
>> [ Cc Richie, Li ]
>> https://lore.kernel.org/ltp/20220201142230.20243-1-andrea.cervesato@suse.de/
>>
>>> libclone has been added to the libs folder and updated with the new
>>> LTP API. This library will be used by containers tests, which will be
>>> updated to the new LTP API as well.
>> I suppose you want to use it for containers (still use legacy API), which
>> already use it. I remember Richie not considering libclone.h as a good source
>> and suggesting to use SAFE_CLONE() for simple cases.
>>
>> https://lore.kernel.org/ltp/878s7k59tk.fsf@suse.de/
>>
>> We probably need some wrapper for containers, but we should recheck, whether
>> we want to take a different approach. Code in the functions is really a bit weird.
>>
> Yeah tst_clone.{c,h} is the new library which uses clone3 + a
> compatability layer if clone3 is not available. This avoids reinventing
> a cloning API to some extent because the clone3 interface is nice IMO.
>
> Also IMO tests should be rewritten to use tst_clone, I just haven't had
> chance to do that.
libclone does also a several other things, such as executing a process 
under unshared namespace and that is used by mountns testcases. So maybe 
we can just call it in an another way or find a way to recycle the 
libclone code.
> BTW we need to test cloning into a CGroup, so I'll probably add that
> soon.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20220203/fb2ca2a6/attachment.htm>


More information about the ltp mailing list