Skip to content

Commit

Permalink
build: introduction of archConvertStatFs function
Browse files Browse the repository at this point in the history
Fixes: kata-containers#908

Type of StatFs is not always declared as int64 for all the architecture(e.g s390x).
The function archConvertStatFs could be reimplemented for other architecture
to correctly convert the StatFs.Type.

Signed-off-by: Alice Frosi <afrosi@de.ibm.com>
  • Loading branch information
Alice Frosi committed Nov 15, 2018
1 parent 0911331 commit 2c50c93
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cli/oci.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func isCgroupMounted(cgroupPath string) bool {
return false
}

if statFs.Type != int64(cgroupFsType) {
if statFs.Type != archConvertStatFs(cgroupFsType) {
return false
}

Expand Down
10 changes: 10 additions & 0 deletions cli/utils_arch_base.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// +build !s390x
//
// SPDX-License-Identifier: Apache-2.0
//

package main

func archConvertStatFs(cgroupFsType int) int64 {
return int64(cgroupFsType)
}

0 comments on commit 2c50c93

Please sign in to comment.