From e93077bcdf77be2e7e3aec9f9686dace9e18c850 Mon Sep 17 00:00:00 2001 From: "Justin Terry (VM)" Date: Mon, 23 Jul 2018 09:11:13 -0700 Subject: [PATCH] Adds LinuxMetadata support by default on Windows 1. Sets the LinuxMetadata flag by default on Windows LCOW v1 MappedDirectories. Signed-off-by: Justin Terry (VM) --- libcontainerd/client_local_windows.go | 4 ++++ vendor.conf | 2 +- vendor/github.com/Microsoft/hcsshim/interface.go | 11 +++++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/libcontainerd/client_local_windows.go b/libcontainerd/client_local_windows.go index 6e3454e514..89d18c6ba7 100644 --- a/libcontainerd/client_local_windows.go +++ b/libcontainerd/client_local_windows.go @@ -494,6 +494,10 @@ func (c *client) createLinux(id string, spec *specs.Spec, runtimeOptions interfa CreateInUtilityVM: true, ReadOnly: readonly, } + // If we are 1803/RS4+ enable LinuxMetadata support by default + if system.GetOSVersion().Build >= 17134 { + md.LinuxMetadata = true + } mds = append(mds, md) specMount.Source = path.Join(uvmPath, mount.Destination) } diff --git a/vendor.conf b/vendor.conf index 0a015862bd..5042274eb8 100644 --- a/vendor.conf +++ b/vendor.conf @@ -1,6 +1,6 @@ # the following lines are in sorted order, FYI github.com/Azure/go-ansiterm d6e3b3328b783f23731bc4d058875b0371ff8109 -github.com/Microsoft/hcsshim v0.6.11 +github.com/Microsoft/hcsshim v0.6.12 github.com/Microsoft/go-winio v0.4.8 github.com/docker/libtrust 9cbd2a1374f46905c68a4eb3694a130610adc62a github.com/go-check/check 4ed411733c5785b40214c70bce814c3a3a689609 https://github.com/cpuguy83/check.git diff --git a/vendor/github.com/Microsoft/hcsshim/interface.go b/vendor/github.com/Microsoft/hcsshim/interface.go index e21f30025a..b8fa736447 100644 --- a/vendor/github.com/Microsoft/hcsshim/interface.go +++ b/vendor/github.com/Microsoft/hcsshim/interface.go @@ -36,6 +36,8 @@ type MappedDir struct { BandwidthMaximum uint64 IOPSMaximum uint64 CreateInUtilityVM bool + // LinuxMetadata - Support added in 1803/RS4+. + LinuxMetadata bool `json:",omitempty"` } type MappedPipe struct { @@ -62,6 +64,14 @@ type MappedVirtualDisk struct { AttachOnly bool `json:",omitempty:` } +// AssignedDevice represents a device that has been directly assigned to a container +// +// NOTE: Support added in RS5 +type AssignedDevice struct { + // InterfaceClassGUID of the device to assign to container. + InterfaceClassGUID string `json:"InterfaceClassGuid,omitempty"` +} + // ContainerConfig is used as both the input of CreateContainer // and to convert the parameters to JSON for passing onto the HCS type ContainerConfig struct { @@ -93,6 +103,7 @@ type ContainerConfig struct { ContainerType string `json:",omitempty"` // "Linux" for Linux containers on Windows. Omitted otherwise. TerminateOnLastHandleClosed bool `json:",omitempty"` // Should HCS terminate the container once all handles have been closed MappedVirtualDisks []MappedVirtualDisk `json:",omitempty"` // Array of virtual disks to mount at start + AssignedDevices []AssignedDevice `json:",omitempty"` // Array of devices to assign. NOTE: Support added in RS5 } type ComputeSystemQuery struct {