From ab8929cf7388299a08e809bd6effdb76be9147de Mon Sep 17 00:00:00 2001 From: Kathryn Baldauf Date: Tue, 7 Sep 2021 15:49:16 -0700 Subject: [PATCH] Update test modules with up to date hcsshim code Signed-off-by: Kathryn Baldauf --- .../hcsshim/internal/hcsoci/resources_lcow.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hcsoci/resources_lcow.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hcsoci/resources_lcow.go index 00253e8928..c01a1c18f6 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/hcsoci/resources_lcow.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hcsoci/resources_lcow.go @@ -116,9 +116,21 @@ func allocateLinuxResources(ctx context.Context, coi *createOptionsInternal, r * uvmPathForFile = scsiMount.UVMPath r.Add(scsiMount) coi.Spec.Mounts[i].Type = "none" - } else if strings.HasPrefix(mount.Source, "sandbox://") || strings.HasPrefix(mount.Source, "hugepages://") { + } else if strings.HasPrefix(mount.Source, "sandbox://") { // Mounts that map to a path in UVM are specified with 'sandbox://' prefix. // example: sandbox:///a/dirInUvm destination:/b/dirInContainer + uvmPathForFile = mount.Source + } else if strings.HasPrefix(mount.Source, "hugepages://") { + // currently we only support 2M hugepage size + hugePageSubDirs := strings.Split(strings.TrimPrefix(mount.Source, "hugepages://"), "/") + if len(hugePageSubDirs) < 2 { + return errors.Errorf(`%s mount path is invalid, expected format: hugepages:///`, mount.Source) + } + + // hugepages:// should be followed by pagesize + if hugePageSubDirs[0] != "2M" { + return errors.Errorf(`only 2M (megabytes) pagesize is supported, got %s`, hugePageSubDirs[0]) + } // Hugepages inside a container are backed by a mount created inside a UVM. uvmPathForFile = mount.Source } else {