2015-04-27 17:53:12 +03:00
|
|
|
// +build !exclude_graphdriver_aufs,linux
|
2014-03-14 22:23:54 +04:00
|
|
|
|
2014-04-18 01:43:01 +04:00
|
|
|
package daemon
|
2014-03-14 22:23:54 +04:00
|
|
|
|
|
|
|
import (
|
2015-03-27 01:22:04 +03:00
|
|
|
"github.com/Sirupsen/logrus"
|
2014-07-25 02:19:50 +04:00
|
|
|
"github.com/docker/docker/daemon/graphdriver"
|
|
|
|
"github.com/docker/docker/daemon/graphdriver/aufs"
|
2014-03-14 22: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-27 01:22:04 +03:00
|
|
|
logrus.Debugf("Migrating existing containers")
|
2015-06-16 21:06:53 +03:00
|
|
|
if err := ad.Migrate(root, setupInitLayer); err != nil {
|
2014-03-14 22:23:54 +04:00
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|