Skip to content

Commit 6056263

Browse files
committed
libcontainer: intelrdt: add update command support
Add runc update command support for Intel RDT/CAT. for example: runc update --l3-cache-schema "L3:0=f;1=f" <container-id> Signed-off-by: Xiaochen Shen <[email protected]>
1 parent b82d07e commit 6056263

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

update.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,10 @@ other options are ignored.
112112
Name: "pids-limit",
113113
Usage: "Maximum number of pids allowed in the container",
114114
},
115+
cli.StringFlag{
116+
Name: "l3-cache-schema",
117+
Usage: "The string of Intel RDT/CAT L3 cache schema",
118+
},
115119
},
116120
Action: func(context *cli.Context) error {
117121
if err := checkArgs(context, 1, exactArgs); err != nil {
@@ -254,6 +258,22 @@ other options are ignored.
254258
config.Cgroups.Resources.MemorySwap = *r.Memory.Swap
255259
config.Cgroups.Resources.PidsLimit = r.Pids.Limit
256260

261+
i := specs.LinuxIntelRdt{
262+
L3CacheSchema: "",
263+
}
264+
265+
if val := context.String("l3-cache-schema"); val != "" {
266+
i.L3CacheSchema = val
267+
}
268+
269+
if config.IntelRdt != nil {
270+
config.IntelRdt.L3CacheSchema = i.L3CacheSchema
271+
} else {
272+
if i.L3CacheSchema != "" {
273+
fmt.Printf("failed to update l3-cache-schema: intelRdt.l3CacheSchema is not specified in config")
274+
}
275+
}
276+
257277
return container.Set(config)
258278
},
259279
}

0 commit comments

Comments
 (0)