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/unit.c | |
parent | 14e639ae7a1dbf156273ce697d30fbc6c6594209 (diff) |
cgroup: expose cgroup attributes as unit properties on the bus
Diffstat (limited to 'src/unit.c')
-rw-r--r-- | src/unit.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/unit.c b/src/unit.c index 5006742d9d..e0f4a1bb31 100644 --- a/src/unit.c +++ b/src/unit.c @@ -686,9 +686,17 @@ void unit_dump(Unit *u, FILE *f, const char *prefix) { fprintf(f, "%s\tControlGroup: %s:%s\n", prefix, b->controller, b->path); - LIST_FOREACH(by_unit, a, u->meta.cgroup_attributes) + LIST_FOREACH(by_unit, a, u->meta.cgroup_attributes) { + char *v = NULL; + + if (a->map_callback) + a->map_callback(a->controller, a->name, a->value, &v); + fprintf(f, "%s\tControlGroupAttribute: %s %s \"%s\"\n", - prefix, a->controller, a->name, a->value); + prefix, a->controller, a->name, v ? v : a->value); + + free(v); + } if (UNIT_VTABLE(u)->dump) UNIT_VTABLE(u)->dump(u, f, prefix2); |