Browse code

Stop expanding sandbox size when no new size is specified

Signed-off-by: Darren Stahl <darst@microsoft.com>

Darren Stahl authored on 2016/10/13 08:58:57
Showing 1 changed files
... ...
@@ -37,10 +37,6 @@ import (
37 37
 const filterDriver = 1
38 38
 
39 39
 var (
40
-	vmcomputedll            = syscall.NewLazyDLL("vmcompute.dll")
41
-	hcsExpandSandboxSize    = vmcomputedll.NewProc("ExpandSandboxSize")
42
-	hcsSandboxSizeSupported = hcsExpandSandboxSize.Find() == nil
43
-
44 40
 	// mutatedFiles is a list of files that are mutated by the import process
45 41
 	// and must be backed up and restored.
46 42
 	mutatedFiles = map[string]string{
... ...
@@ -212,7 +208,7 @@ func (d *Driver) create(id, parent, mountLabel string, readOnly bool, storageOpt
212 212
 			return fmt.Errorf("Failed to parse storage options - %s", err)
213 213
 		}
214 214
 
215
-		if hcsSandboxSizeSupported {
215
+		if storageOptions.size != 0 {
216 216
 			if err := hcsshim.ExpandSandboxSize(d.info, id, storageOptions.size); err != nil {
217 217
 				return err
218 218
 			}