oci: implement WithRdt

Helper for setting the (Linux) container's RDT parameters.

Signed-off-by: Markus Lehtonen <markus.lehtonen@intel.com>
This commit is contained in:
Markus Lehtonen
2021-04-07 10:51:42 +03:00
parent 4045b7ce86
commit 2946db8903
2 changed files with 20 additions and 0 deletions

View File

@@ -141,3 +141,15 @@ var WithAllKnownCapabilities = func(ctx context.Context, client Client, c *conta
func WithoutRunMount(ctx context.Context, client Client, c *containers.Container, s *Spec) error {
return WithoutMounts("/run")(ctx, client, c, s)
}
// WithRdt sets the container's RDT parameters
func WithRdt(closID, l3CacheSchema, memBwSchema string) SpecOpts {
return func(ctx context.Context, _ Client, c *containers.Container, s *Spec) error {
s.Linux.IntelRdt = &specs.LinuxIntelRdt{
ClosID: closID,
L3CacheSchema: l3CacheSchema,
MemBwSchema: memBwSchema,
}
return nil
}
}