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 (
|
2015-03-26 18:22:04 -04:00
|
|
|
"github.com/Sirupsen/logrus"
|
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-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 {
|
2015-03-26 18:22:04 -04:00
|
|
|
logrus.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
|
|
|
|
}
|