summaryrefslogtreecommitdiff
path: root/runtime/runtime_aufs.go
blob: 5a32615df5e123f86a82afd8e02a83d28e02df0a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// +build !exclude_graphdriver_aufs

package runtime

import (
	"github.com/dotcloud/docker/graph"
	"github.com/dotcloud/docker/runtime/graphdriver"
	"github.com/dotcloud/docker/runtime/graphdriver/aufs"
	"github.com/dotcloud/docker/utils"
)

// 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 {
		utils.Debugf("Migrating existing containers")
		if err := ad.Migrate(root, graph.SetupInitLayer); err != nil {
			return err
		}
	}
	return nil
}