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 <h.huangqiang@huawei.com>
This commit is contained in:
Qiang Huang 2015-03-11 16:46:54 +08:00
parent 9387ebb6ba
commit d6eb76f8a2
2 changed files with 3 additions and 2 deletions

View File

@ -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.

View File

@ -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)
}