mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-15 10:12:24 +00:00
Merge pull request #1070 from hallyn/2016-07-01/fixcg
cgfsng: don't pre-calculate path
This commit is contained in:
commit
a715a9bcb2
@ -1627,8 +1627,6 @@ static bool cgfsng_setup_limits(void *hdata, struct lxc_list *cgroup_settings,
|
|||||||
struct cgfsng_handler_data *d = hdata;
|
struct cgfsng_handler_data *d = hdata;
|
||||||
struct lxc_list *iterator, *sorted_cgroup_settings, *next;
|
struct lxc_list *iterator, *sorted_cgroup_settings, *next;
|
||||||
struct lxc_cgroup *cg;
|
struct lxc_cgroup *cg;
|
||||||
struct hierarchy *h;
|
|
||||||
char *listpath = NULL;
|
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
|
|
||||||
if (lxc_list_empty(cgroup_settings))
|
if (lxc_list_empty(cgroup_settings))
|
||||||
@ -1639,15 +1637,6 @@ static bool cgfsng_setup_limits(void *hdata, struct lxc_list *cgroup_settings,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (do_devices) {
|
|
||||||
h = get_hierarchy("devices");
|
|
||||||
if (!h) {
|
|
||||||
ERROR("No devices cgroup setup for %s", d->name);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
listpath = must_make_path(h->fullcgpath, "devices.list", NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
lxc_list_for_each(iterator, sorted_cgroup_settings) {
|
lxc_list_for_each(iterator, sorted_cgroup_settings) {
|
||||||
cg = iterator->elem;
|
cg = iterator->elem;
|
||||||
|
|
||||||
@ -1670,7 +1659,6 @@ static bool cgfsng_setup_limits(void *hdata, struct lxc_list *cgroup_settings,
|
|||||||
ret = true;
|
ret = true;
|
||||||
INFO("cgroup has been setup");
|
INFO("cgroup has been setup");
|
||||||
out:
|
out:
|
||||||
free(listpath);
|
|
||||||
lxc_list_for_each_safe(iterator, sorted_cgroup_settings, next) {
|
lxc_list_for_each_safe(iterator, sorted_cgroup_settings, next) {
|
||||||
lxc_list_del(iterator);
|
lxc_list_del(iterator);
|
||||||
free(iterator);
|
free(iterator);
|
||||||
|
Loading…
Reference in New Issue
Block a user