diff --git a/hack/vendor.sh b/hack/vendor.sh index 36c7c8fb58..6f28b341fd 100755 --- a/hack/vendor.sh +++ b/hack/vendor.sh @@ -7,7 +7,7 @@ source 'hack/.vendor-helpers.sh' # the following lines are in sorted order, FYI clone git github.com/Azure/go-ansiterm 70b2c90b260171e829f1ebd7c17f600c11858dbe -clone git github.com/Microsoft/hcsshim 9488dda5ab5d3c1af26e17d3d9fc2e9f29009a7b +clone git github.com/Microsoft/hcsshim 116e0e9f5ced0cec94ae46d0aa1b3002a325f532 clone git github.com/Microsoft/go-winio c40bf24f405ab3cc8e1383542d474e813332de6d clone git github.com/Sirupsen/logrus v0.9.0 # logrus is a common dependency among multiple deps clone git github.com/docker/libtrust 9cbd2a1374f46905c68a4eb3694a130610adc62a diff --git a/vendor/src/github.com/Microsoft/hcsshim/hcsshim.go b/vendor/src/github.com/Microsoft/hcsshim/hcsshim.go index 43cf2fd670..88650b8ac9 100644 --- a/vendor/src/github.com/Microsoft/hcsshim/hcsshim.go +++ b/vendor/src/github.com/Microsoft/hcsshim/hcsshim.go @@ -27,6 +27,8 @@ import ( //sys nameToGuid(name string, guid *GUID) (hr error) = vmcompute.NameToGuid? //sys prepareLayer(info *driverInfo, id string, descriptors []WC_LAYER_DESCRIPTOR) (hr error) = vmcompute.PrepareLayer? //sys unprepareLayer(info *driverInfo, id string) (hr error) = vmcompute.UnprepareLayer? +//sys processBaseImage(path string) (hr error) = vmcompute.ProcessBaseImage? +//sys processUtilityImage(path string) (hr error) = vmcompute.ProcessUtilityImage? //sys importLayerBegin(info *driverInfo, id string, descriptors []WC_LAYER_DESCRIPTOR, context *uintptr) (hr error) = vmcompute.ImportLayerBegin? //sys importLayerNext(context uintptr, fileName string, fileInfo *winio.FileBasicInfo) (hr error) = vmcompute.ImportLayerNext? diff --git a/vendor/src/github.com/Microsoft/hcsshim/hnsfuncs.go b/vendor/src/github.com/Microsoft/hcsshim/hnsfuncs.go index affff7f86f..590d6e381f 100644 --- a/vendor/src/github.com/Microsoft/hcsshim/hnsfuncs.go +++ b/vendor/src/github.com/Microsoft/hcsshim/hnsfuncs.go @@ -36,12 +36,16 @@ type MacPool struct { // HNSNetwork represents a network in HNS type HNSNetwork struct { - Id string `json:",omitempty"` - Name string `json:",omitempty"` - Type string `json:",omitempty"` - Policies []json.RawMessage `json:",omitempty"` - MacPools []MacPool `json:",omitempty"` - Subnets []Subnet `json:",omitempty"` + Id string `json:",omitempty"` + Name string `json:",omitempty"` + Type string `json:",omitempty"` + NetworkAdapterName string `json:",omitempty"` + SourceMac string `json:",omitempty"` + Policies []json.RawMessage `json:",omitempty"` + MacPools []MacPool `json:",omitempty"` + Subnets []Subnet `json:",omitempty"` + DNSSuffix string `json:",omitempty"` + DNSServerList string `json:",omitempty"` } // HNSEndpoint represents a network endpoint in HNS @@ -53,6 +57,10 @@ type HNSEndpoint struct { Policies []json.RawMessage `json:",omitempty"` MacAddress string `json:",omitempty"` IPAddress net.IP `json:",omitempty"` + DNSSuffix string `json:",omitempty"` + DNSServerList string `json:",omitempty"` + GatewayAddress string `json:",omitempty"` + PrefixLength uint8 `json:",omitempty"` } type hnsNetworkResponse struct { diff --git a/vendor/src/github.com/Microsoft/hcsshim/legacy.go b/vendor/src/github.com/Microsoft/hcsshim/legacy.go index fbeebb3755..bc31f23656 100644 --- a/vendor/src/github.com/Microsoft/hcsshim/legacy.go +++ b/vendor/src/github.com/Microsoft/hcsshim/legacy.go @@ -319,11 +319,7 @@ func (w *LegacyLayerWriter) Add(name string, fileInfo *winio.FileBasicInfo) erro if err != nil { return err } - if strings.HasPrefix(name, `Files\`) { - path += ".$wcidirs$" - } else { - createDisposition = syscall.OPEN_EXISTING - } + path += ".$wcidirs$" } f, err := openFileOrDir(path, syscall.GENERIC_READ|syscall.GENERIC_WRITE, createDisposition) @@ -344,7 +340,7 @@ func (w *LegacyLayerWriter) Add(name string, fileInfo *winio.FileBasicInfo) erro return err } - if !strings.HasPrefix(name, `Files\`) { + if strings.HasPrefix(name, `Hives\`) { w.backupWriter = winio.NewBackupFileWriter(f, false) } else { if !w.isTP4Format { diff --git a/vendor/src/github.com/Microsoft/hcsshim/processimage.go b/vendor/src/github.com/Microsoft/hcsshim/processimage.go new file mode 100644 index 0000000000..fadb1b92c5 --- /dev/null +++ b/vendor/src/github.com/Microsoft/hcsshim/processimage.go @@ -0,0 +1,23 @@ +package hcsshim + +import "os" + +// ProcessBaseLayer post-processes a base layer that has had its files extracted. +// The files should have been extracted to \Files. +func ProcessBaseLayer(path string) error { + err := processBaseImage(path) + if err != nil { + return &os.PathError{Op: "ProcessBaseLayer", Path: path, Err: err} + } + return nil +} + +// ProcessUtilityVMImage post-processes a utility VM image that has had its files extracted. +// The files should have been extracted to \Files. +func ProcessUtilityVMImage(path string) error { + err := processUtilityImage(path) + if err != nil { + return &os.PathError{Op: "ProcessUtilityVMImage", Path: path, Err: err} + } + return nil +} diff --git a/vendor/src/github.com/Microsoft/hcsshim/zhcsshim.go b/vendor/src/github.com/Microsoft/hcsshim/zhcsshim.go index 7ac12d7878..03924b6fcc 100644 --- a/vendor/src/github.com/Microsoft/hcsshim/zhcsshim.go +++ b/vendor/src/github.com/Microsoft/hcsshim/zhcsshim.go @@ -30,6 +30,8 @@ var ( procNameToGuid = modvmcompute.NewProc("NameToGuid") procPrepareLayer = modvmcompute.NewProc("PrepareLayer") procUnprepareLayer = modvmcompute.NewProc("UnprepareLayer") + procProcessBaseImage = modvmcompute.NewProc("ProcessBaseImage") + procProcessUtilityImage = modvmcompute.NewProc("ProcessUtilityImage") procImportLayerBegin = modvmcompute.NewProc("ImportLayerBegin") procImportLayerNext = modvmcompute.NewProc("ImportLayerNext") procImportLayerWrite = modvmcompute.NewProc("ImportLayerWrite") @@ -370,6 +372,46 @@ func _unprepareLayer(info *driverInfo, id *uint16) (hr error) { return } +func processBaseImage(path string) (hr error) { + var _p0 *uint16 + _p0, hr = syscall.UTF16PtrFromString(path) + if hr != nil { + return + } + return _processBaseImage(_p0) +} + +func _processBaseImage(path *uint16) (hr error) { + if hr = procProcessBaseImage.Find(); hr != nil { + return + } + r0, _, _ := syscall.Syscall(procProcessBaseImage.Addr(), 1, uintptr(unsafe.Pointer(path)), 0, 0) + if int32(r0) < 0 { + hr = syscall.Errno(win32FromHresult(r0)) + } + return +} + +func processUtilityImage(path string) (hr error) { + var _p0 *uint16 + _p0, hr = syscall.UTF16PtrFromString(path) + if hr != nil { + return + } + return _processUtilityImage(_p0) +} + +func _processUtilityImage(path *uint16) (hr error) { + if hr = procProcessUtilityImage.Find(); hr != nil { + return + } + r0, _, _ := syscall.Syscall(procProcessUtilityImage.Addr(), 1, uintptr(unsafe.Pointer(path)), 0, 0) + if int32(r0) < 0 { + hr = syscall.Errno(win32FromHresult(r0)) + } + return +} + func importLayerBegin(info *driverInfo, id string, descriptors []WC_LAYER_DESCRIPTOR, context *uintptr) (hr error) { var _p0 *uint16 _p0, hr = syscall.UTF16PtrFromString(id)