Skip to content

arch: Enable EROFS in the CH defconfigs - #32

Closed
bennyz wants to merge 1 commit into
cloud-hypervisor:ch-7.2.8from
qarax:enable-erofs
Closed

bennyz wants to merge 1 commit into
cloud-hypervisor:ch-7.2.8from
qarax:enable-erofs

Conversation

@bennyz

@bennyz bennyz commented Dec 4, 2026

Copy link
Copy Markdown

Enable EROFS in the x86, arm64 and riscv defconfigs, with the kernel's default sub-options. arm64 and riscv already have the Miscellaneous filesystems menu on; on x86 this turns it on, with every other filesystem in it left off (X86_CPU_RESCTRL, which depends on the menu, shows up as not set).

The use case is booting container images from an EROFS image on a virtio-pmem device mounted with dax=always, under an overlayfs with a tmpfs upper. With DAX the guest reads the image from the host page cache, so VMs that share an image don't each keep a copy of it in guest memory.

The diff is what olddefconfig writes for CONFIG_MISC_FILESYSTEMS=y (x86) and CONFIG_EROFS_FS=y, applied to the existing files, so the toolchain lines are unchanged.

Tested on x86_64 with a vmlinux built from this branch (GCC 13.3.0) and Cloud Hypervisor v55.0:

  • python:3.13-slim flattened into one EROFS image and booted from --pmem file=...,discard_writes=on: Python starts with 1.1 MB of guest page cache, against 23 MB with the same image on --disk ...,readonly=on.
  • A snapshot of that VM restored twice with memory_restore_mode=CopyOnWrite: both restored VMs keep reading files from the pmem image that they had not touched before the snapshot.

EROFS lets a guest mount a read-only image, such as a container image
flattened into one file, straight from a virtio-pmem device with DAX,
so VMs that share the image read it from the host page cache instead
of each keeping a copy in guest memory. arm64 and riscv already enable
the Miscellaneous filesystems menu; on x86 enable it too.

CONFIG_MISC_FILESYSTEMS=y (x86), CONFIG_EROFS_FS=y
# CONFIG_PSTORE is not set
# CONFIG_UFS_FS is not set
# CONFIG_EROFS_FS is not set
CONFIG_EROFS_FS=y

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay. You need to git commit --amend -s.

bennyz added a commit to bennyz/qarax that referenced this pull request Dec 4, 2026
Cloud Hypervisor's kernel releases don't enable EROFS yet
(cloud-hypervisor/linux#32), so the node images take their guest kernel
from a release of our fork, qarax/linux: upstream's 7.2.8 plus that
commit. CH_KERNEL_REPO names the repository, and Renovate follows it.

The appliance's CentOS Stream 10 ships erofs-utils 1.8.10, which can't
merge layers, so it builds 1.9.4 from source into /usr/local/bin, and
qarax-node.service points the node at it. The version is pinned once in
versions/node-artifacts.env, which CI's test job reads too.
@bennyz bennyz closed this Dec 4, 2026
@bennyz
bennyz deleted the enable-erofs branch December 4, 2026 17:07
bennyz added a commit to qarax/qarax that referenced this pull request Dec 4, 2026
* Boot OCI images from EROFS over virtio-pmem

A VM created with image_boot: erofs boots its OCI image without OverlayBD
or TCMU. Its host flattens the image into one read-only EROFS file per
manifest digest and maps it into the guest as /dev/pmem0, and a per-VM
initramfs runs qarax-init, which mounts it with DAX under a tmpfs overlay.
The guest reads image pages in place from the host page cache, shared by
every VM of the image, instead of copying them into its own memory.

OverlayBD stays the default: EROFS VMs keep their root's writes in guest
memory, so they refuse persistent uppers, commit and live migration.

* Schedule EROFS VMs only onto hosts that can boot them

A node without erofs-utils 1.9.4 and qarax-init turns image boot off, so an
EROFS VM placed on it failed its import and was left unknown. Nodes now
report whether they boot EROFS images, and the scheduler, including HA
evacuation, places EROFS VMs only on hosts that do.

* Ship an EROFS guest kernel and erofs-utils in the node images

Cloud Hypervisor's kernel releases don't enable EROFS yet
(cloud-hypervisor/linux#32), so the node images take their guest kernel
from a release of our fork, qarax/linux: upstream's 7.2.8 plus that
commit. CH_KERNEL_REPO names the repository, and Renovate follows it.

The appliance's CentOS Stream 10 ships erofs-utils 1.8.10, which can't
merge layers, so it builds 1.9.4 from source into /usr/local/bin, and
qarax-node.service points the node at it. The version is pinned once in
versions/node-artifacts.env, which CI's test job reads too.

* Pull images over plain HTTP from the node's insecure registries

qarax-node's README documents INSECURE_REGISTRIES and the e2e stack sets it
for its local registry, but nothing has read it since #240. OverlayBD
imports reached that registry anyway, through their pool's http:// URL;
EROFS imports have no pool, so they tried HTTPS and failed. The node
takes it again as --insecure-registry, for both kinds of import.

* Pin the guest kernel to the fork's trimmed EROFS release

The fork's releases are now named after the upstream release they build
on, plus -erofs, and enable only what EROFS on pmem with DAX uses (no
compression, no file-backed mounts). Renovate compares only releases with
the same suffix, so it won't offer the older, untrimmed
ch-release-v7.2.8-20261204 as an update.

* Number the image_boot migration after master's guest agent one

* Read the EROFS test's guest output from the process #459 returns
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants