From d6eb76f8a2184688489fc3a611d80de36ef50877 Mon Sep 17 00:00:00 2001 From: Qiang Huang Date: Wed, 11 Mar 2015 16:46:54 +0800 Subject: [PATCH] add parameter to Set api We only have libcontainer.Container on Docker side, can't change `config` in linuxContainer, pass config to libcontainer so we can change config of container. Signed-off-by: Qiang Huang --- container.go | 2 +- container_linux.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/container.go b/container.go index cebe8273..35bdfd78 100644 --- a/container.go +++ b/container.go @@ -96,7 +96,7 @@ type Container interface { // // errors: // Systemerror - System error. - Set() error + Set(config configs.Config) error // Start a process inside the container. Returns error if process fails to // start. You can track process lifecycle with passed Process structure. diff --git a/container_linux.go b/container_linux.go index bf729760..c44c8dac 100644 --- a/container_linux.go +++ b/container_linux.go @@ -78,9 +78,10 @@ func (c *linuxContainer) Stats() (*Stats, error) { return stats, nil } -func (c *linuxContainer) Set() error { +func (c *linuxContainer) Set(config configs.Config) error { c.m.Lock() defer c.m.Unlock() + c.config = &config return c.cgroupManager.Set(c.config) }