@@ -102,14 +102,14 @@ type JailerCommandBuilder struct {
102102 uid int
103103 gid int
104104 execFile string
105- node int
106105
107106 // optional params
108107 chrootBaseDir string
109108 netNS string
110109 daemonize bool
111110 firecrackerArgs []string
112111 cgroupVersion string
112+ node * int
113113
114114 stdin io.Reader
115115 stdout io.Writer
@@ -139,9 +139,11 @@ func (b JailerCommandBuilder) Args() []string {
139139 args = append (args , "--gid" , strconv .Itoa (b .gid ))
140140 args = append (args , "--exec-file" , b .execFile )
141141
142- if cpulist := getNumaCpuset (b .node ); len (cpulist ) > 0 {
143- args = append (args , "--cgroup" , fmt .Sprintf ("cpuset.mems=%d" , b .node ))
144- args = append (args , "--cgroup" , fmt .Sprintf ("cpuset.cpus=%s" , cpulist ))
142+ if b .node != nil {
143+ if cpulist := getNumaCpuset (* b .node ); len (cpulist ) > 0 {
144+ args = append (args , "--cgroup" , fmt .Sprintf ("cpuset.mems=%d" , b .node ))
145+ args = append (args , "--cgroup" , fmt .Sprintf ("cpuset.cpus=%s" , cpulist ))
146+ }
145147 }
146148
147149 if len (b .cgroupVersion ) > 0 {
@@ -208,7 +210,7 @@ func (b JailerCommandBuilder) WithExecFile(path string) JailerCommandBuilder {
208210// WithNumaNode uses the specfied node for the jailer. This represents the numa
209211// node that the process will get assigned to.
210212func (b JailerCommandBuilder ) WithNumaNode (node int ) JailerCommandBuilder {
211- b .node = node
213+ b .node = & node
212214 return b
213215}
214216
@@ -344,7 +346,6 @@ func jail(ctx context.Context, m *Machine, cfg *Config) error {
344346 WithID (cfg .JailerCfg .ID ).
345347 WithUID (* cfg .JailerCfg .UID ).
346348 WithGID (* cfg .JailerCfg .GID ).
347- WithNumaNode (* cfg .JailerCfg .NumaNode ).
348349 WithExecFile (cfg .JailerCfg .ExecFile ).
349350 WithChrootBaseDir (cfg .JailerCfg .ChrootBaseDir ).
350351 WithDaemonize (cfg .JailerCfg .Daemonize ).
@@ -365,6 +366,10 @@ func jail(ctx context.Context, m *Machine, cfg *Config) error {
365366 builder = builder .WithStdin (stdin )
366367 }
367368
369+ if cfg .JailerCfg .NumaNode != nil {
370+ builder = builder .WithNumaNode (* cfg .JailerCfg .NumaNode )
371+ }
372+
368373 m .cmd = builder .Build (ctx )
369374
370375 if err := cfg .JailerCfg .ChrootStrategy .AdaptHandlers (& m .Handlers ); err != nil {
0 commit comments