From: Zbigniew Jędrzejewski-Szmek Date: Tue, 27 Jun 2017 01:19:33 +0000 (-0400) Subject: Merge pull request #6200 from poettering/ioprio-transient X-Git-Tag: v234~83 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=23e4a234fc06393e4b7f4cfb8774b326ac5f29e4;p=thirdparty%2Fsystemd.git Merge pull request #6200 from poettering/ioprio-transient --- 23e4a234fc06393e4b7f4cfb8774b326ac5f29e4 diff --cc src/core/dbus-execute.c index 7e165be61d9,a35420eb81f..c041a7d94c4 --- a/src/core/dbus-execute.c +++ b/src/core/dbus-execute.c @@@ -166,15 -165,46 +165,45 @@@ static int property_get_ioprio assert(reply); assert(c); - if (c->ioprio_set) - n = c->ioprio; - else { - n = ioprio_get(IOPRIO_WHO_PROCESS, 0); - if (n < 0) - n = IOPRIO_PRIO_VALUE(IOPRIO_CLASS_BE, 4); - } + return sd_bus_message_append(reply, "i", exec_context_get_effective_ioprio(c)); + } - return sd_bus_message_append(reply, "i", n); + static int property_get_ioprio_class( + sd_bus *bus, + const char *path, + const char *interface, + const char *property, + sd_bus_message *reply, + void *userdata, + sd_bus_error *error) { + + + ExecContext *c = userdata; + + assert(bus); + assert(reply); + assert(c); + + return sd_bus_message_append(reply, "i", IOPRIO_PRIO_CLASS(exec_context_get_effective_ioprio(c))); + } + - + static int property_get_ioprio_priority( + sd_bus *bus, + const char *path, + const char *interface, + const char *property, + sd_bus_message *reply, + void *userdata, + sd_bus_error *error) { + + + ExecContext *c = userdata; + + assert(bus); + assert(reply); + assert(c); + + return sd_bus_message_append(reply, "i", IOPRIO_PRIO_DATA(exec_context_get_effective_ioprio(c))); } static int property_get_cpu_sched_policy( diff --cc src/shared/bus-unit-util.c index 7e446cbc84d,e4204fd6616..5cbe663fa87 --- a/src/shared/bus-unit-util.c +++ b/src/shared/bus-unit-util.c @@@ -390,15 -389,24 +390,33 @@@ int bus_append_unit_property_assignment r = sd_bus_message_append(m, "v", "i", (int32_t) n); + } else if (streq(field, "FileDescriptorStoreMax")) { + unsigned u; + + r = safe_atou(eq, &u); + if (r < 0) + return log_error_errno(r, "Failed to parse file descriptor store limit: %s", eq); + + r = sd_bus_message_append(m, "v", "u", (uint32_t) u); + + } else if (streq(field, "IOSchedulingClass")) { + int c; + + c = ioprio_class_from_string(eq); + if (c < 0) + return log_error_errno(r, "Failed to parse IO scheduling class: %s", eq); + + r = sd_bus_message_append(m, "v", "i", (int32_t) c); + + } else if (streq(field, "IOSchedulingPriority")) { + int q; + + r = ioprio_parse_priority(eq, &q); + if (r < 0) + return log_error_errno(r, "Failed to parse IO scheduling priority: %s", eq); + + r = sd_bus_message_append(m, "v", "i", (int32_t) q); + } else if (STR_IN_SET(field, "Environment", "PassEnvironment")) { const char *p;