mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-15 12:06:12 +00:00
cgfsng: fix get_hierarchy() for unified hierarchy
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
parent
7211378b1f
commit
106f1f38ef
@ -327,7 +327,7 @@ struct hierarchy *get_hierarchy(const char *c)
|
|||||||
!hierarchies[i]->controllers[0])
|
!hierarchies[i]->controllers[0])
|
||||||
return hierarchies[i];
|
return hierarchies[i];
|
||||||
|
|
||||||
return NULL;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (string_in_list(hierarchies[i]->controllers, c))
|
if (string_in_list(hierarchies[i]->controllers, c))
|
||||||
@ -1306,8 +1306,11 @@ static bool cg_hybrid_init(void)
|
|||||||
|
|
||||||
controller_list = cg_unified_get_controllers(cgv2_ctrl_path);
|
controller_list = cg_unified_get_controllers(cgv2_ctrl_path);
|
||||||
free(cgv2_ctrl_path);
|
free(cgv2_ctrl_path);
|
||||||
if (!controller_list)
|
if (!controller_list) {
|
||||||
controller_list = cg_unified_make_empty_controller();
|
controller_list = cg_unified_make_empty_controller();
|
||||||
|
CGFSNG_DEBUG("No controllers are enabled for "
|
||||||
|
"delegation in the unified hierarchy\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
new = add_hierarchy(controller_list, mountpoint, base_cgroup, type);
|
new = add_hierarchy(controller_list, mountpoint, base_cgroup, type);
|
||||||
@ -2365,13 +2368,16 @@ static bool cgfsng_unfreeze(void *hdata)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *cgfsng_get_cgroup(void *hdata, const char *subsystem)
|
static const char *cgfsng_get_cgroup(void *hdata, const char *controller)
|
||||||
{
|
{
|
||||||
struct hierarchy *h;
|
struct hierarchy *h;
|
||||||
|
|
||||||
h = get_hierarchy(subsystem);
|
h = get_hierarchy(controller);
|
||||||
if (!h)
|
if (!h) {
|
||||||
|
SYSERROR("Failed to find hierarchy for controller \"%s\"",
|
||||||
|
controller ? controller : "(null)");
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
return h->fullcgpath ? h->fullcgpath + strlen(h->mountpoint) : NULL;
|
return h->fullcgpath ? h->fullcgpath + strlen(h->mountpoint) : NULL;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user