diff options
author | Lennart Poettering <lennart@poettering.net> | 2014-05-22 11:53:12 +0900 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2014-05-22 11:53:12 +0900 |
commit | 9a0549093332880df47c4218209ce126b8586835 (patch) | |
tree | 3f929d8ef12b580f5c6ed91b7316bbbac4d4a299 /src/libsystemd | |
parent | 609e002e78e79ef2bf9d6a6ea22bda215abbbb14 (diff) |
cgroups: simplify CPUQuota= logic
Only accept cpu quota values in percentages, get rid of period
definition.
It's not clear whether the CFS period controllable per-cgroup even has a
future in the kernel, hence let's simplify all this, hardcode the period
to 100ms and only accept percentage based quota values.
Diffstat (limited to 'src/libsystemd')
-rw-r--r-- | src/libsystemd/sd-bus/bus-util.c | 32 |
1 files changed, 1 insertions, 31 deletions
diff --git a/src/libsystemd/sd-bus/bus-util.c b/src/libsystemd/sd-bus/bus-util.c index 6220934bd8..6c9548f9aa 100644 --- a/src/libsystemd/sd-bus/bus-util.c +++ b/src/libsystemd/sd-bus/bus-util.c @@ -1274,40 +1274,10 @@ int bus_append_unit_property_assignment(sd_bus_message *m, const char *assignmen r = sd_bus_message_append(m, "v", "t", (usec_t) percent * USEC_PER_SEC / 100); } else { - usec_t us; - - r = parse_sec(eq, &us); - if (r < 0) { - log_error("CPU quota '%s' invalid.", eq); - return -EINVAL; - } - - r = sd_bus_message_append_basic(m, SD_BUS_TYPE_STRING, "CPUQuotaUSec"); - if (r < 0) - return bus_log_create_error(r); - - r = sd_bus_message_append(m, "v", "t", us); - } - - if (r < 0) - return bus_log_create_error(r); - - return 0; - - } else if (streq(field, "CPUQuotaPeriodSec")) { - usec_t us; - - r = parse_sec(eq, &us); - if (r < 0) { - log_error("CPU period '%s' invalid.", eq); + log_error("CPU quota needs to be in percent."); return -EINVAL; } - r = sd_bus_message_append_basic(m, SD_BUS_TYPE_STRING, "CPUQuotaPeriodUSec"); - if (r < 0) - return bus_log_create_error(r); - - r = sd_bus_message_append(m, "v", "t", us); if (r < 0) return bus_log_create_error(r); |