Browse code

Windows: Fix PR13278 compile break

Signed-off-by: John Howard <jhoward@microsoft.com>

John Howard authored on 2015/06/09 05:45:28
Showing 3 changed files
... ...
@@ -8,7 +8,6 @@ import (
8 8
 	"path/filepath"
9 9
 	"strings"
10 10
 
11
-	"github.com/Sirupsen/logrus"
12 11
 	"github.com/docker/docker/pkg/chrootarchive"
13 12
 	"github.com/docker/docker/runconfig"
14 13
 	"github.com/docker/docker/volume"
... ...
@@ -291,37 +290,6 @@ func (daemon *Daemon) verifyVolumesInfo(container *Container) error {
291 291
 	return container.ToDisk()
292 292
 }
293 293
 
294
-// migrateVolume moves the contents of a volume created pre Docker 1.7
295
-// to the location expected by the local driver. Steps:
296
-// 1. Save old directory that includes old volume's config json file.
297
-// 2. Move virtual directory with content to where the local driver expects it to be.
298
-// 3. Remove the backup of the old volume config.
299
-func (daemon *Daemon) migrateVolume(id, vfs string) error {
300
-	volumeInfo := filepath.Join(daemon.root, defaultVolumesPathName, id)
301
-	backup := filepath.Join(daemon.root, defaultVolumesPathName, id+".back")
302
-
303
-	var err error
304
-	if err = os.Rename(volumeInfo, backup); err != nil {
305
-		return err
306
-	}
307
-	defer func() {
308
-		// Put old configuration back in place in case one of the next steps fails.
309
-		if err != nil {
310
-			os.Rename(backup, volumeInfo)
311
-		}
312
-	}()
313
-
314
-	if err = os.Rename(vfs, volumeInfo); err != nil {
315
-		return err
316
-	}
317
-
318
-	if err = os.RemoveAll(backup); err != nil {
319
-		logrus.Errorf("Unable to remove volume info backup directory %s: %v", backup, err)
320
-	}
321
-
322
-	return nil
323
-}
324
-
325 294
 func createVolume(name, driverName string) (volume.Volume, error) {
326 295
 	vd, err := getVolumeDriver(driverName)
327 296
 	if err != nil {
... ...
@@ -8,6 +8,7 @@ import (
8 8
 	"sort"
9 9
 	"strings"
10 10
 
11
+	"github.com/Sirupsen/logrus"
11 12
 	"github.com/docker/docker/daemon/execdriver"
12 13
 	"github.com/docker/docker/pkg/system"
13 14
 )
... ...
@@ -68,3 +69,34 @@ func (m mounts) Swap(i, j int) {
68 68
 func (m mounts) parts(i int) int {
69 69
 	return len(strings.Split(filepath.Clean(m[i].Destination), string(os.PathSeparator)))
70 70
 }
71
+
72
+// migrateVolume moves the contents of a volume created pre Docker 1.7
73
+// to the location expected by the local driver. Steps:
74
+// 1. Save old directory that includes old volume's config json file.
75
+// 2. Move virtual directory with content to where the local driver expects it to be.
76
+// 3. Remove the backup of the old volume config.
77
+func (daemon *Daemon) migrateVolume(id, vfs string) error {
78
+	volumeInfo := filepath.Join(daemon.root, defaultVolumesPathName, id)
79
+	backup := filepath.Join(daemon.root, defaultVolumesPathName, id+".back")
80
+
81
+	var err error
82
+	if err = os.Rename(volumeInfo, backup); err != nil {
83
+		return err
84
+	}
85
+	defer func() {
86
+		// Put old configuration back in place in case one of the next steps fails.
87
+		if err != nil {
88
+			os.Rename(backup, volumeInfo)
89
+		}
90
+	}()
91
+
92
+	if err = os.Rename(vfs, volumeInfo); err != nil {
93
+		return err
94
+	}
95
+
96
+	if err = os.RemoveAll(backup); err != nil {
97
+		logrus.Errorf("Unable to remove volume info backup directory %s: %v", backup, err)
98
+	}
99
+
100
+	return nil
101
+}
... ...
@@ -12,3 +12,7 @@ func copyOwnership(source, destination string) error {
12 12
 func (container *Container) setupMounts() ([]execdriver.Mount, error) {
13 13
 	return nil, nil
14 14
 }
15
+
16
+func (daemon *Daemon) migrateVolume(id, vfs string) error {
17
+	return nil
18
+}