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:
Markus Lehtonen
2025-08-01 09:57:00 +03:00
parent 5d04e7f60c
commit e846add595
2 changed files with 10 additions and 0 deletions
+6
View File
@@ -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()