diff options
author | Daniel Mack <github@zonque.org> | 2015-09-13 20:44:30 +0200 |
---|---|---|
committer | Daniel Mack <github@zonque.org> | 2015-09-13 20:44:30 +0200 |
commit | 5669ef3644e3044036eeaaf6bb4b1a6a7e63130c (patch) | |
tree | 1f2f6f436e6070aeea41960ed91fee8705d2aac3 /src/shared/bus-util.c | |
parent | 2d0fd6e1c5bbaddef56ecf0fc8c59478fb9ba822 (diff) | |
parent | e7ab4d1ac9f8d99eecd5e2d22eb482a1fb0fbf23 (diff) |
Merge pull request #1251 from poettering/cgroups-cleanup
cgroups cleanup + other fixes
Diffstat (limited to 'src/shared/bus-util.c')
-rw-r--r-- | src/shared/bus-util.c | 35 |
1 files changed, 24 insertions, 11 deletions
diff --git a/src/shared/bus-util.c b/src/shared/bus-util.c index 4dc4ca581d..a2c5d8acca 100644 --- a/src/shared/bus-util.c +++ b/src/shared/bus-util.c @@ -23,22 +23,24 @@ #include "sd-daemon.h" #include "sd-event.h" -#include "util.h" -#include "strv.h" -#include "macro.h" +#include "sd-bus.h" + +#include "bus-error.h" +#include "bus-internal.h" +#include "bus-label.h" +#include "bus-message.h" +#include "cgroup-util.h" #include "def.h" -#include "path-util.h" +#include "macro.h" #include "missing.h" +#include "path-util.h" #include "set.h" #include "signal-util.h" +#include "strv.h" #include "unit-name.h" +#include "util.h" -#include "sd-bus.h" -#include "bus-error.h" -#include "bus-label.h" -#include "bus-message.h" #include "bus-util.h" -#include "bus-internal.h" static int name_owner_change_callback(sd_bus_message *m, void *userdata, sd_bus_error *ret_error) { sd_event *e = userdata; @@ -1463,10 +1465,21 @@ int bus_append_unit_property_assignment(sd_bus_message *m, const char *assignmen r = sd_bus_message_append(m, "v", "t", n); - } else if (STR_IN_SET(field, "CPUShares", "BlockIOWeight")) { + } else if (STR_IN_SET(field, "CPUShares", "StartupCPUShares")) { + uint64_t u; + + r = cg_cpu_shares_parse(eq, &u); + if (r < 0) { + log_error("Failed to parse %s value %s.", field, eq); + return -EINVAL; + } + + r = sd_bus_message_append(m, "v", "t", u); + + } else if (STR_IN_SET(field, "BlockIOWeight", "StartupBlockIOWeight")) { uint64_t u; - r = safe_atou64(eq, &u); + r = cg_cpu_shares_parse(eq, &u); if (r < 0) { log_error("Failed to parse %s value %s.", field, eq); return -EINVAL; |