From cc58cf69931eb3d29ebc95a8053f8125146dfd78 Mon Sep 17 00:00:00 2001 From: Eric Ernst Date: Fri, 25 Feb 2022 11:50:04 -0800 Subject: [PATCH] resourcecontrol: convert stats dev_t to unit64types Their types may differ on various host OSes, but unix.Major|Minor always takes a uint64 Depends-on: github.com/kata-containers/tests#4516 Signed-off-by: Eric Ernst --- src/runtime/pkg/resourcecontrol/utils.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/runtime/pkg/resourcecontrol/utils.go b/src/runtime/pkg/resourcecontrol/utils.go index 9ab592be17..6fafe2d6a0 100644 --- a/src/runtime/pkg/resourcecontrol/utils.go +++ b/src/runtime/pkg/resourcecontrol/utils.go @@ -35,8 +35,8 @@ func DeviceToCgroupDeviceRule(device string) (*devices.Rule, error) { return nil, fmt.Errorf("unsupported device type: %v", devType) } - major := int64(unix.Major(st.Rdev)) - minor := int64(unix.Minor(st.Rdev)) + major := int64(unix.Major(uint64(st.Rdev))) + minor := int64(unix.Minor(uint64(st.Rdev))) deviceRule.Major = major deviceRule.Minor = minor