return -1;
*key = '\0';
- if (!cgm_dbus_connect()) {
- ERROR("Error connecting to cgroup manager");
+ /* use the command interface to look for the cgroup */
+ cgroup = lxc_cmd_get_cgroup_path(name, lxcpath, controller);
+ if (!cgroup)
return -1;
- }
- cgroup = try_get_abs_cgroup(name, lxcpath, controller);
- if (!cgroup) {
- cgm_dbus_disconnect();
+ if (!cgm_dbus_connect()) {
+ ERROR("Error connecting to cgroup manager");
return -1;
}
NihError *nerr;
nerr = nih_error_get();
nih_free(nerr);
- free_abs_cgroup(cgroup);
+ free(cgroup);
cgm_dbus_disconnect();
return -1;
}
cgm_dbus_disconnect();
- free_abs_cgroup(cgroup);
+ free(cgroup);
newlen = strlen(result);
if (!len || !value) {
// user queries the size
return -1;
*key = '\0';
- if (!cgm_dbus_connect()) {
- ERROR("Error connecting to cgroup manager");
- free(cgroup);
- return false;
- }
- cgroup = try_get_abs_cgroup(name, lxcpath, controller);
+ /* use the command interface to look for the cgroup */
+ cgroup = lxc_cmd_get_cgroup_path(name, lxcpath, controller);
if (!cgroup) {
ERROR("Failed to get cgroup for controller %s for %s:%s",
controller, lxcpath, name);
- cgm_dbus_disconnect();
return -1;
}
+
+ if (!cgm_dbus_connect()) {
+ ERROR("Error connecting to cgroup manager");
+ free(cgroup);
+ return false;
+ }
ret = cgm_do_set(controller, filename, cgroup, value);
cgm_dbus_disconnect();
- free_abs_cgroup(cgroup);
+ free(cgroup);
return ret;
}