Skip to content

Commit

Permalink
resourcecontrol: convert stats dev_t to unit64types
Browse files Browse the repository at this point in the history
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 <eric_ernst@apple.com>
  • Loading branch information
egernst committed Feb 28, 2022
1 parent 5be188c commit cc58cf6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/runtime/pkg/resourcecontrol/utils.go
Expand Up @@ -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

Expand Down

0 comments on commit cc58cf6

Please sign in to comment.