Skip to content

Commit a6fadf6

Browse files
committed
ephemeral: Use systemd.journald.storage=volatile
Tracing through a virtiofs hang in nested virt, this reportedly significantly lessens the traffic to the host virtiofsd. While we're here, clean up how we generate the kargs to use a combinator and add comments to them. Signed-off-by: Colin Walters <[email protected]>
1 parent 8a3dd72 commit a6fadf6

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

crates/kit/src/run_ephemeral.rs

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,13 +1007,23 @@ StandardOutput=file:/dev/virtio-ports/executestatus
10071007
qemu_config.add_smbios_credential(credential);
10081008
}
10091009
// Build kernel command line
1010-
let mut kernel_cmdline = vec![
1011-
"rootfstype=virtiofs".to_string(),
1012-
"root=rootfs".to_string(),
1013-
"rootflags=ro".to_string(),
1014-
"selinux=0".to_string(),
1015-
"systemd.volatile=overlay".to_string(),
1016-
];
1010+
let mut kernel_cmdline = [
1011+
// At the core we boot from the mounted container's root,
1012+
"rootfstype=virtiofs",
1013+
"root=rootfs",
1014+
// But read-only, with an overlayfs in the VM backed
1015+
// by tmpfs
1016+
"rootflags=ro",
1017+
"systemd.volatile=overlay",
1018+
// This avoids having journald interact with the rootfs
1019+
// at all, which lessens the I/O traffic for virtiofs
1020+
"systemd.journald.storage=volatile",
1021+
// See https://github.com/bootc-dev/bcvk/issues/22
1022+
"selinux=0",
1023+
]
1024+
.into_iter()
1025+
.map(ToOwned::to_owned)
1026+
.collect::<Vec<_>>();
10171027

10181028
if opts.common.console {
10191029
kernel_cmdline.push("console=hvc0".to_string());

0 commit comments

Comments
 (0)