summaryrefslogtreecommitdiff
path: root/src/core/dbus-unit.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-07-01 03:02:42 +0200
committerLennart Poettering <lennart@poettering.net>2013-07-01 03:02:42 +0200
commitc221420be8744bb0f8b8a8145efc1f247f1aa801 (patch)
tree42b955f8da918c714bca4a31bfdd7067ef628277 /src/core/dbus-unit.c
parentd28e9236e79e2d0a49aba472f86f7551ce9ca2f1 (diff)
core: add support to run transient units in arbitrary slices
Diffstat (limited to 'src/core/dbus-unit.c')
-rw-r--r--src/core/dbus-unit.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/core/dbus-unit.c b/src/core/dbus-unit.c
index 6273e46274..ad6d5a6038 100644
--- a/src/core/dbus-unit.c
+++ b/src/core/dbus-unit.c
@@ -790,6 +790,25 @@ static int bus_unit_set_transient_property(
return r;
return 1;
+
+ } else if (streq(name, "Slice") && unit_get_cgroup_context(u)) {
+ const char *s;
+ Unit *slice;
+
+ if (dbus_message_iter_get_arg_type(i) != DBUS_TYPE_STRING)
+ return -EINVAL;
+
+ dbus_message_iter_get_basic(i, &s);
+
+ r = manager_load_unit(u->manager, s, NULL, error, &slice);
+ if (r < 0)
+ return r;
+
+ if (slice->type != UNIT_SLICE)
+ return -EINVAL;
+
+ unit_ref_set(&u->slice, slice);
+ return 1;
}
return 0;