[LTP] [PATCH v2 1/4] lib: add new cgroup test API

Li Wang
2020-06-08T10:18:31Z

On Mon, Jun 8, 2020 at 5:48 PM Jan Stancek <jstancek@redhat.com> wrote:

> ...
>
> But there would be clear connection between function and variable.
> new_path = tst_cgroup_get_path(cgroup_dir);
>

Yes, that's easier to understand the code workflow.

> vs.
> tst_cgroup_get_path(cgroup_dir);
> // fyi, tst_cgroup_new_path is updated as side-effect of call above
> // What other calls do update tst_cgroup_new_path? Have a look at
> implementation.

...
>
> That makes it somewhat better, since it's only concern of library code now.
> But since there are no tests using "tst_cgroup_new_path", does it still
> need to be global variable?
>

Sure, we could delete tst_cgorup_mnt/new_path variables, since we have
tracking all mount paths in the list, so it will be easy to find new_path
in each
function.

Hope v4 is the final version:).

--
Regards,
Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20200608/5ecc6f74/attachment.htm>