2014-03-14 14:23:54 -04:00
|
|
|
// +build !exclude_graphdriver_aufs
|
|
|
|
|
2014-04-17 17:43:01 -04:00
|
|
|
package daemon
|
2014-03-14 14:23:54 -04:00
|
|
|
|
|
|
|
import (
|
2014-07-24 18:19:50 -04:00
|
|
|
"github.com/docker/docker/daemon/graphdriver"
|
|
|
|
"github.com/docker/docker/daemon/graphdriver/aufs"
|
|
|
|
"github.com/docker/docker/graph"
|
2014-07-24 16:37:44 -04:00
|
|
|
"github.com/docker/docker/pkg/log"
|
2014-03-14 14:23:54 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
// Given the graphdriver ad, if it is aufs, then migrate it.
|
|
|
|
// If aufs driver is not built, this func is a noop.
|
|
|
|
func migrateIfAufs(driver graphdriver.Driver, root string) error {
|
|
|
|
if ad, ok := driver.(*aufs.Driver); ok {
|
2014-07-24 16:37:44 -04:00
|
|
|
log.Debugf("Migrating existing containers")
|
2014-03-14 14:23:54 -04:00
|
|
|
if err := ad.Migrate(root, graph.SetupInitLayer); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|