diff options
author | Lennart Poettering <lennart@poettering.net> | 2011-08-20 00:42:50 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2011-08-21 20:07:08 +0200 |
commit | d8bbda9141f03c3a2877639e7d43b5f35767840f (patch) | |
tree | 726e20e8deaeed328a7586eeb42d4b81957cd869 /src/systemctl.c | |
parent | 14e639ae7a1dbf156273ce697d30fbc6c6594209 (diff) |
cgroup: expose cgroup attributes as unit properties on the bus
Diffstat (limited to 'src/systemctl.c')
-rw-r--r-- | src/systemctl.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/systemctl.c b/src/systemctl.c index bb998d37e2..604400d8fb 100644 --- a/src/systemctl.c +++ b/src/systemctl.c @@ -2546,6 +2546,30 @@ static int print_property(const char *name, DBusMessageIter *iter) { return 0; + } else if (dbus_message_iter_get_element_type(iter) == DBUS_TYPE_STRUCT && streq(name, "ControlGroupAttributes")) { + DBusMessageIter sub, sub2; + + dbus_message_iter_recurse(iter, &sub); + while (dbus_message_iter_get_arg_type(&sub) == DBUS_TYPE_STRUCT) { + const char *controller, *attr, *value; + + dbus_message_iter_recurse(&sub, &sub2); + + if (bus_iter_get_basic_and_next(&sub2, DBUS_TYPE_STRING, &controller, true) >= 0 && + bus_iter_get_basic_and_next(&sub2, DBUS_TYPE_STRING, &attr, true) >= 0 && + bus_iter_get_basic_and_next(&sub2, DBUS_TYPE_STRING, &value, false) >= 0) { + + printf("ControlGroupAttribute={ controller=%s ; attribute=%s ; value=\"%s\" }\n", + controller, + attr, + value); + } + + dbus_message_iter_next(&sub); + } + + return 0; + } else if (dbus_message_iter_get_element_type(iter) == DBUS_TYPE_STRUCT && startswith(name, "Exec")) { DBusMessageIter sub; |