pub struct JailerConfig {
pub uid: u32,
pub gid: u32,
pub chroot_base_dir: Option<String>,
pub netns: Option<String>,
pub new_pid_ns: bool,
pub cgroup_version: Option<String>,
pub parent_cgroup: Option<String>,
}Expand description
The per-VM isolation half of [firecracker.jailer].
Who the VMM runs as, where its chroot lives, which namespaces and
cgroup it enters — everything IsolationSpec carries. The jailer
binary and the rlimits it applies are node-wide and belong to whoever
builds the adapter that spawns it; they stay in the same TOML table,
read by that composer.
Fields§
§uid: u32UID the Firecracker process runs as inside the jail.
gid: u32GID the Firecracker process runs as inside the jail.
chroot_base_dir: Option<String>Base chroot directory (default: /srv/jailer).
netns: Option<String>Network namespace path (e.g., /var/run/netns/myns).
new_pid_ns: boolCreate a new PID namespace.
cgroup_version: Option<String>cgroup version ("1" or "2").
parent_cgroup: Option<String>Parent cgroup path.
Implementations§
Source§impl JailerConfig
impl JailerConfig
Sourcepub const DEFAULT_CHROOT_BASE: &'static str = "/srv/jailer"
pub const DEFAULT_CHROOT_BASE: &'static str = "/srv/jailer"
The jailer’s default chroot base, used when the config names none.
Sourcepub fn chroot_base(&self) -> &Path
pub fn chroot_base(&self) -> &Path
The chroot base the jailer actually uses: the configured directory, or the jailer’s own default.
Trait Implementations§
Source§impl Clone for JailerConfig
impl Clone for JailerConfig
Source§impl Debug for JailerConfig
impl Debug for JailerConfig
Source§impl<'de> Deserialize<'de> for JailerConfig
impl<'de> Deserialize<'de> for JailerConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for JailerConfig
impl Serialize for JailerConfig
Source§impl TryFrom<&JailerConfig> for IsolationSpec
impl TryFrom<&JailerConfig> for IsolationSpec
Source§fn try_from(jc: &JailerConfig) -> Result<Self, ComputerError>
fn try_from(jc: &JailerConfig) -> Result<Self, ComputerError>
Who the VMM runs as, where its chroot lives, which namespaces and cgroup it enters.
A parent_cgroup without a cgroup_version keeps the jailer’s own
default, version 1, made explicit here because the spec’s
CgroupSpec always names a version.