Skip to content

Commit b8a83ac

Browse files
committed
libcontainer/intelrdt: support explicit assignment to root CLOS
Makes it possible e.g. to enable monitoring (linux.intelRdt.enableMonitoring) without creating a CLOS (resctrl group) for the container. Implements opencontainers/runtime-spec#1289. Signed-off-by: Markus Lehtonen <[email protected]>
1 parent 1398ba7 commit b8a83ac

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

libcontainer/configs/validate/validator.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,9 @@ func intelrdtCheck(config *configs.Config) error {
287287
return fmt.Errorf("intelRdt is specified in config, but Intel RDT is not enabled")
288288
}
289289

290-
if config.IntelRdt.ClosID == "." || config.IntelRdt.ClosID == ".." || strings.Contains(config.IntelRdt.ClosID, "/") {
291-
return fmt.Errorf("invalid intelRdt.ClosID %q", config.IntelRdt.ClosID)
290+
switch clos := config.IntelRdt.ClosID; {
291+
case clos == ".", clos == "..", len(clos) > 1 && strings.Contains(clos, "/"):
292+
return fmt.Errorf("invalid intelRdt.ClosID %q", clos)
292293
}
293294

294295
if !intelrdt.IsCATEnabled() && config.IntelRdt.L3CacheSchema != "" {

0 commit comments

Comments
 (0)