Decouple daemon and container to mount and unmount filesystems.

Side effects:
- Decouple daemon and container to start containers.
- Decouple daemon and container to copy files.

Signed-off-by: David Calavera <david.calavera@gmail.com>
This commit is contained in:
David Calavera
2015-11-02 20:06:09 -05:00
parent 1c94f5f53a
commit 3a49765046
17 changed files with 188 additions and 176 deletions

View File

@@ -29,15 +29,15 @@ func (daemon *Daemon) containerRestart(container *Container, seconds int) error
// Avoid unnecessarily unmounting and then directly mounting
// the container when the container stops and then starts
// again
if err := container.Mount(); err == nil {
defer container.Unmount()
if err := daemon.Mount(container); err == nil {
defer daemon.Unmount(container)
}
if err := daemon.containerStop(container, seconds); err != nil {
return err
}
if err := container.Start(); err != nil {
if err := daemon.containerStart(container); err != nil {
return err
}