Skip to content

Commit

Permalink
features: export intelRDT status
Browse files Browse the repository at this point in the history
Signed-off-by: Giuseppe Scrivano <[email protected]>
  • Loading branch information
giuseppe committed Oct 11, 2023
1 parent e2f9853 commit bdb95d6
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/libcrun/container.c
Original file line number Diff line number Diff line change
Expand Up @@ -3953,6 +3953,8 @@ libcrun_container_get_features (libcrun_context_t *context, struct features_info
(*info)->linux.apparmor.enabled = true;
(*info)->linux.selinux.enabled = true;

(*info)->linux.intel_rdt.enabled = true;

// Put the values for mount extensions
(*info)->linux.mount_ext.idmap.enabled = true;

Expand Down
6 changes: 6 additions & 0 deletions src/libcrun/container.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ struct idmap_info_s
bool enabled;
};

struct intel_rdt_s
{
bool enabled;
};

struct mount_ext_info_s
{
struct idmap_info_s idmap;
Expand All @@ -140,6 +145,7 @@ struct linux_info_s
struct apparmor_info_s apparmor;
struct selinux_info_s selinux;
struct mount_ext_info_s mount_ext;
struct intel_rdt_s intel_rdt;
};

struct annotations_info_s
Expand Down
10 changes: 10 additions & 0 deletions src/oci_features.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,15 @@ crun_features_add_mount_ext_info (yajl_gen json_gen, const struct linux_info_s *
yajl_gen_map_close (json_gen);
}

void
crun_features_add_intel_rdt (yajl_gen json_gen, const struct linux_info_s *linux)
{
yajl_gen_string (json_gen, (const unsigned char *) "intelRdt", strlen ("intelRdt"));
yajl_gen_map_open (json_gen);
add_bool_to_json (json_gen, "enabled", linux->intel_rdt.enabled);
yajl_gen_map_close (json_gen);
}

void
crun_features_add_linux_info (yajl_gen json_gen, const struct linux_info_s *linux)
{
Expand All @@ -197,6 +206,7 @@ crun_features_add_linux_info (yajl_gen json_gen, const struct linux_info_s *linu
crun_features_add_apparmor_info (json_gen, linux);
crun_features_add_selinux_info (json_gen, linux);
crun_features_add_mount_ext_info (json_gen, linux);
crun_features_add_intel_rdt (json_gen, linux);

yajl_gen_map_close (json_gen);
}
Expand Down

0 comments on commit bdb95d6

Please sign in to comment.