From 9e755d12e2e71189564addf954e9de5378304adb Mon Sep 17 00:00:00 2001 From: Markus Lehtonen Date: Wed, 7 Apr 2021 11:16:09 +0300 Subject: [PATCH] cmd: add --rdt-class command line option A new option for setting the RDT class (or CLOS) from the command line. Signed-off-by: Markus Lehtonen --- cmd/ctr/commands/commands.go | 4 ++++ cmd/ctr/commands/run/run_unix.go | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/cmd/ctr/commands/commands.go b/cmd/ctr/commands/commands.go index f4c5ec034..d0e52a652 100644 --- a/cmd/ctr/commands/commands.go +++ b/cmd/ctr/commands/commands.go @@ -193,6 +193,10 @@ var ( Name: "apparmor-profile", Usage: "enable AppArmor with an existing custom profile", }, + cli.StringFlag{ + Name: "rdt-class", + Usage: "name of the RDT class to associate the container with. Specifies a Class of Service (CLOS) for cache and memory bandwidth management.", + }, } ) diff --git a/cmd/ctr/commands/run/run_unix.go b/cmd/ctr/commands/run/run_unix.go index 019d0d7e7..7641ba61b 100644 --- a/cmd/ctr/commands/run/run_unix.go +++ b/cmd/ctr/commands/run/run_unix.go @@ -324,6 +324,10 @@ func NewContainer(ctx gocontext.Context, client *containerd.Client, context *cli return nil }) } + + if c := context.String("rdt-class"); c != "" { + opts = append(opts, oci.WithRdt(c, "", "")) + } } runtimeOpts, err := getRuntimeOptions(context)