Compare commits

..

No commits in common. "df957acc6603a04e62dee7e911c65dc7dbcb6208" and "b9dc511954b080d8b05a44f1758be6dbb4078852" have entirely different histories.

2 changed files with 13 additions and 13 deletions

View File

@ -360,7 +360,9 @@ static char *format_cgroup_memory_limit_comparison(char *buf, size_t l, Unit *u,
} }
void cgroup_context_dump(Unit *u, FILE* f, const char *prefix) { void cgroup_context_dump(Unit *u, FILE* f, const char *prefix) {
_cleanup_free_ char *disable_controllers_str = NULL, *cpuset_cpus = NULL, *cpuset_mems = NULL; _cleanup_free_ char *disable_controllers_str = NULL;
_cleanup_free_ char *cpuset_cpus = NULL;
_cleanup_free_ char *cpuset_mems = NULL;
CGroupIODeviceLimit *il; CGroupIODeviceLimit *il;
CGroupIODeviceWeight *iw; CGroupIODeviceWeight *iw;
CGroupIODeviceLatency *l; CGroupIODeviceLatency *l;
@ -435,8 +437,8 @@ void cgroup_context_dump(Unit *u, FILE* f, const char *prefix) {
prefix, c->startup_cpu_shares, prefix, c->startup_cpu_shares,
prefix, format_timespan(q, sizeof(q), c->cpu_quota_per_sec_usec, 1), prefix, format_timespan(q, sizeof(q), c->cpu_quota_per_sec_usec, 1),
prefix, format_timespan(v, sizeof(v), c->cpu_quota_period_usec, 1), prefix, format_timespan(v, sizeof(v), c->cpu_quota_period_usec, 1),
prefix, strempty(cpuset_cpus), prefix, cpuset_cpus,
prefix, strempty(cpuset_mems), prefix, cpuset_mems,
prefix, c->io_weight, prefix, c->io_weight,
prefix, c->startup_io_weight, prefix, c->startup_io_weight,
prefix, c->blockio_weight, prefix, c->blockio_weight,
@ -972,10 +974,8 @@ static void cgroup_apply_unified_cpuset(Unit *u, const CPUSet *cpus, const char
_cleanup_free_ char *buf = NULL; _cleanup_free_ char *buf = NULL;
buf = cpu_set_to_range_string(cpus); buf = cpu_set_to_range_string(cpus);
if (!buf) { if (!buf)
log_oom();
return; return;
}
(void) set_attribute_and_warn(u, "cpuset", name, buf); (void) set_attribute_and_warn(u, "cpuset", name, buf);
} }

View File

@ -926,23 +926,23 @@ int bus_cgroup_set_property(
if (!UNIT_WRITE_FLAGS_NOOP(flags)) { if (!UNIT_WRITE_FLAGS_NOOP(flags)) {
_cleanup_free_ char *setstr = NULL; _cleanup_free_ char *setstr = NULL;
_cleanup_free_ char *data = NULL;
CPUSet *set; CPUSet *set;
setstr = cpu_set_to_range_string(&new_set); setstr = cpu_set_to_range_string(&new_set);
if (!setstr)
return -ENOMEM;
if (streq(name, "AllowedCPUs")) if (streq(name, "AllowedCPUs"))
set = &c->cpuset_cpus; set = &c->cpuset_cpus;
else else
set = &c->cpuset_mems; set = &c->cpuset_mems;
cpu_set_reset(set); if (asprintf(&data, "%s=%s", name, setstr) < 0)
*set = new_set; return -ENOMEM;
new_set = (CPUSet) {};
cpu_set_reset(set);
cpu_set_add_all(set, &new_set);
unit_invalidate_cgroup(u, CGROUP_MASK_CPUSET); unit_invalidate_cgroup(u, CGROUP_MASK_CPUSET);
unit_write_settingf(u, flags, name, "%s=%s", name, setstr); unit_write_setting(u, flags, name, data);
} }
return 1; return 1;