@@ -167,13 +167,19 @@ compare_rdt_configurations (const char *a, const char *b)
167
167
return 0 ;
168
168
}
169
169
170
+ static bool
171
+ is_default_clos (const char * name )
172
+ {
173
+ return strcmp (name , "/" ) == 0 ;
174
+ }
175
+
170
176
static int
171
177
get_resctrl_path (char * * path , const char * file , const char * name , libcrun_error_t * err )
172
178
{
173
- if (file )
174
- return append_paths (path , err , INTEL_RDT_MOUNT_POINT , name , file , NULL );
175
- else
176
- return append_paths (path , err , INTEL_RDT_MOUNT_POINT , name , NULL );
179
+ if (is_default_clos ( name ) )
180
+ return append_paths (path , err , INTEL_RDT_MOUNT_POINT , file , NULL );
181
+
182
+ return append_paths (path , err , INTEL_RDT_MOUNT_POINT , name , file , NULL );
177
183
}
178
184
179
185
static int
@@ -282,7 +288,7 @@ resctl_create (const char *name, bool explicit_clos_id, bool *created, const cha
282
288
must exist. */
283
289
if (explicit_clos_id && l3_cache_schema == NULL && mem_bw_schema == NULL )
284
290
{
285
- if (exist )
291
+ if (exist || is_default_clos ( name ) )
286
292
return 0 ;
287
293
288
294
return crun_make_error (err , 0 , "the resctl group `%s` does not exist" , name );
@@ -292,6 +298,9 @@ resctl_create (const char *name, bool explicit_clos_id, bool *created, const cha
292
298
if (exist && (l3_cache_schema != NULL || mem_bw_schema != NULL ))
293
299
return validate_rdt_configuration (name , l3_cache_schema , mem_bw_schema , err );
294
300
301
+ if (is_default_clos (name ))
302
+ return 0 ;
303
+
295
304
/* At this point, assume it was created. */
296
305
ret = crun_ensure_directory (path , 0755 , true, err );
297
306
if (UNLIKELY (ret < 0 ))
@@ -357,6 +366,9 @@ resctl_destroy (const char *name, libcrun_error_t *err)
357
366
cleanup_free char * path = NULL ;
358
367
int ret ;
359
368
369
+ if (is_default_clos (name ))
370
+ return 0 ;
371
+
360
372
ret = get_resctrl_path (& path , NULL , name , err );
361
373
if (UNLIKELY (ret < 0 ))
362
374
return ret ;
0 commit comments