daemon_aufs.go 601 B

12345678910111213141516171819202122
  1. // +build !exclude_graphdriver_aufs
  2. package daemon
  3. import (
  4. log "github.com/Sirupsen/logrus"
  5. "github.com/docker/docker/daemon/graphdriver"
  6. "github.com/docker/docker/daemon/graphdriver/aufs"
  7. "github.com/docker/docker/graph"
  8. )
  9. // Given the graphdriver ad, if it is aufs, then migrate it.
  10. // If aufs driver is not built, this func is a noop.
  11. func migrateIfAufs(driver graphdriver.Driver, root string) error {
  12. if ad, ok := driver.(*aufs.Driver); ok {
  13. log.Debugf("Migrating existing containers")
  14. if err := ad.Migrate(root, graph.SetupInitLayer); err != nil {
  15. return err
  16. }
  17. }
  18. return nil
  19. }