a016b9228f338cb9b380ce7e00826ef462767d98Lennart Poettering/***
a016b9228f338cb9b380ce7e00826ef462767d98Lennart Poettering This file is part of systemd.
a016b9228f338cb9b380ce7e00826ef462767d98Lennart Poettering
a016b9228f338cb9b380ce7e00826ef462767d98Lennart Poettering Copyright 2013 Lennart Poettering
a016b9228f338cb9b380ce7e00826ef462767d98Lennart Poettering
a016b9228f338cb9b380ce7e00826ef462767d98Lennart Poettering systemd is free software; you can redistribute it and/or modify it
a016b9228f338cb9b380ce7e00826ef462767d98Lennart Poettering under the terms of the GNU Lesser General Public License as published by
a016b9228f338cb9b380ce7e00826ef462767d98Lennart Poettering the Free Software Foundation; either version 2.1 of the License, or
a016b9228f338cb9b380ce7e00826ef462767d98Lennart Poettering (at your option) any later version.
a016b9228f338cb9b380ce7e00826ef462767d98Lennart Poettering
a016b9228f338cb9b380ce7e00826ef462767d98Lennart Poettering systemd is distributed in the hope that it will be useful, but
a016b9228f338cb9b380ce7e00826ef462767d98Lennart Poettering WITHOUT ANY WARRANTY; without even the implied warranty of
a016b9228f338cb9b380ce7e00826ef462767d98Lennart Poettering MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
a016b9228f338cb9b380ce7e00826ef462767d98Lennart Poettering Lesser General Public License for more details.
a016b9228f338cb9b380ce7e00826ef462767d98Lennart Poettering
a016b9228f338cb9b380ce7e00826ef462767d98Lennart Poettering You should have received a copy of the GNU Lesser General Public License
a016b9228f338cb9b380ce7e00826ef462767d98Lennart Poettering along with systemd; If not, see <http://www.gnu.org/licenses/>.
a016b9228f338cb9b380ce7e00826ef462767d98Lennart Poettering***/
a016b9228f338cb9b380ce7e00826ef462767d98Lennart Poettering
4ad490007b70e6ac18d3cb04fa2ed92eba1451faLennart Poettering#include "dbus-cgroup.h"
4ad490007b70e6ac18d3cb04fa2ed92eba1451faLennart Poettering#include "dbus-slice.h"
cf0fbc49e67b55f8d346fc94de28c90113505297Thomas Hindoe Paaboel Andersen#include "slice.h"
cf0fbc49e67b55f8d346fc94de28c90113505297Thomas Hindoe Paaboel Andersen#include "unit.h"
a016b9228f338cb9b380ce7e00826ef462767d98Lennart Poettering
718db96199eb307751264e4163555662c9a389faLennart Poetteringconst sd_bus_vtable bus_slice_vtable[] = {
718db96199eb307751264e4163555662c9a389faLennart Poettering SD_BUS_VTABLE_START(0),
718db96199eb307751264e4163555662c9a389faLennart Poettering SD_BUS_VTABLE_END
718db96199eb307751264e4163555662c9a389faLennart Poettering};
8e2af478402414f060bbc16e1b4bbe7de1779c13Lennart Poettering
8e2af478402414f060bbc16e1b4bbe7de1779c13Lennart Poetteringint bus_slice_set_property(
8e2af478402414f060bbc16e1b4bbe7de1779c13Lennart Poettering Unit *u,
8e2af478402414f060bbc16e1b4bbe7de1779c13Lennart Poettering const char *name,
718db96199eb307751264e4163555662c9a389faLennart Poettering sd_bus_message *message,
8e2af478402414f060bbc16e1b4bbe7de1779c13Lennart Poettering UnitSetPropertiesMode mode,
718db96199eb307751264e4163555662c9a389faLennart Poettering sd_bus_error *error) {
8e2af478402414f060bbc16e1b4bbe7de1779c13Lennart Poettering
8e2af478402414f060bbc16e1b4bbe7de1779c13Lennart Poettering Slice *s = SLICE(u);
8e2af478402414f060bbc16e1b4bbe7de1779c13Lennart Poettering
8e2af478402414f060bbc16e1b4bbe7de1779c13Lennart Poettering assert(name);
8e2af478402414f060bbc16e1b4bbe7de1779c13Lennart Poettering assert(u);
8e2af478402414f060bbc16e1b4bbe7de1779c13Lennart Poettering
718db96199eb307751264e4163555662c9a389faLennart Poettering return bus_cgroup_set_property(u, &s->cgroup_context, name, message, mode, error);
8e2af478402414f060bbc16e1b4bbe7de1779c13Lennart Poettering}
8e2af478402414f060bbc16e1b4bbe7de1779c13Lennart Poettering
8e2af478402414f060bbc16e1b4bbe7de1779c13Lennart Poetteringint bus_slice_commit_properties(Unit *u) {
8e2af478402414f060bbc16e1b4bbe7de1779c13Lennart Poettering assert(u);
8e2af478402414f060bbc16e1b4bbe7de1779c13Lennart Poettering
bc432dc7eb62c5671f2b741a86a66393adb350dcLennart Poettering unit_update_cgroup_members_masks(u);
8e2af478402414f060bbc16e1b4bbe7de1779c13Lennart Poettering unit_realize_cgroup(u);
bc432dc7eb62c5671f2b741a86a66393adb350dcLennart Poettering
8e2af478402414f060bbc16e1b4bbe7de1779c13Lennart Poettering return 0;
8e2af478402414f060bbc16e1b4bbe7de1779c13Lennart Poettering}