mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
libcontainer/configs/validate: check that intelrdt is enabled
If intelRdt is specified in the spec, check that the resctrl fs is actually mounted. Fixes e.g. the case where "intelRdt.closID" is specified but runc silently ignores this if resctrl is not mounted. Signed-off-by: Markus Lehtonen <markus.lehtonen@intel.com>
This commit is contained in:
@@ -416,6 +416,12 @@ func WriteIntelRdtTasks(dir string, pid int) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// IsEnabled checks if Intel RDT is enabled.
|
||||
func IsEnabled() bool {
|
||||
fsroot, err := Root()
|
||||
return err == nil && fsroot != ""
|
||||
}
|
||||
|
||||
// IsCATEnabled checks if Intel RDT/CAT is enabled.
|
||||
func IsCATEnabled() bool {
|
||||
featuresInit()
|
||||
|
||||
Reference in New Issue
Block a user