2015-04-27 10:53:12 -04:00
|
|
|
// +build !exclude_graphdriver_aufs,linux
|
2014-03-14 14:23:54 -04:00
|
|
|
|
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"
|
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")
|
2015-06-16 14:06:53 -04:00
|
|
|
if err := ad.Migrate(root, setupInitLayer); err != nil {
|
2014-03-14 14:23:54 -04:00
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|