From 55dd96592bb72864d9fa5e81e0440e84dfdf9836 Mon Sep 17 00:00:00 2001 From: Qiang Huang Date: Thu, 2 Apr 2015 09:57:04 +0800 Subject: [PATCH] add Set support for systemd based cgroup Signed-off-by: Qiang Huang --- cgroups/systemd/apply_systemd.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/cgroups/systemd/apply_systemd.go b/cgroups/systemd/apply_systemd.go index dea196bd..8c382314 100644 --- a/cgroups/systemd/apply_systemd.go +++ b/cgroups/systemd/apply_systemd.go @@ -347,7 +347,17 @@ func (m *Manager) GetStats() (*cgroups.Stats, error) { } func (m *Manager) Set(container *configs.Config) error { - panic("not implemented") + for name, path := range m.Paths { + sys, ok := subsystems[name] + if !ok || !cgroups.PathExists(path) { + continue + } + if err := sys.Set(path, container.Cgroups); err != nil { + return err + } + } + + return nil } func getUnitName(c *configs.Cgroup) string {