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

Richard Palethorpe rpalethorpe@suse.de
Thu Feb 3 06:31:03 CET 2022


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.

BTW we need to test cloning into a CGroup, so I'll probably add that
soon.

-- 
Thank you,
Richard.


More information about the ltp mailing list