api.c: Allow creation of a v2 cgroup with no controllers
Commit
498530a1d744 ("cgcreate, tools: Allow cgroup creation with
no controllers attached") attempted to add support to allow the
creation of a cgroup v2 cgroup with no controllers attached. This
patch did create the requested cgroup, but it still required there
to be at least one valid controller _available_ to attach to.
Rework the aforementioned logic so that the cgroup can be created
if there's a valid cgroup v2 mount - even if there are no v2
controllers available.
Fixes: 498530a1d744 ("cgcreate, tools: Allow cgroup creation with no controllers attached")
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Reviewed-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>