Skip to content

criu: introduce LUO image backend#2947

Draft
Thesola10 wants to merge 1 commit intocheckpoint-restore:criu-devfrom
Thesola10:luo-backend-clean
Draft

criu: introduce LUO image backend#2947
Thesola10 wants to merge 1 commit intocheckpoint-restore:criu-devfrom
Thesola10:luo-backend-clean

Conversation

@Thesola10
Copy link
Copy Markdown
Contributor

@Thesola10 Thesola10 commented Mar 9, 2026

This patch adds Live Update Orchestrator as a storage backend for CRIU images.

What this PR does

It adds two flags, --luo-session and --luo-session-fd, which specify a LUO session to save CRIU images into.

If CRIU owns the session file descriptor, that is the flag --luo-session is used, CRIU will remain open in order for the session file descriptor to be preserved when kexec is called.

How it works

A new module, luo.c, has been introduced to manage LUO session file descriptors as a storage medium, by preserving memfds as is recommended in the kernel documentation.

Dump side:

  • If --luo-session is specified, a new LUO session is allocated with the name given as argument.
  • For each image, a new memfd is opened and returned as the target file descriptor
  • Once the image is closed, a token is generated from the image type and its numerical parameter (usually the PID or a small index) for subsequent retrieval.
  • Again, if --luo-session is specified, CRIU hangs on a no-op in order to keep the session FD open until kexec

Restore side:

  • If --luo-session is specified, CRIU will query /dev/liveupdate for a session with that name.
  • When opening an image, the token is derived from the requested file name as above, and the corresponding file descriptor is returned.
  • If --luo-session is specified, the LUO session is finalized and its resources are freed.

Implementation notes

  • The UAPI header for Live Update Orchestrator has been added into criu/include/linux/liveupdate.h
  • --luo-session-fd is intended for an externally managed file descriptor (ideally systemd?) and CRIU will not attempt to close or preserve it.

TODO:

  • Short out the current file descriptor serializer in favor of natively preserving file descriptors as-is in the LUO session
  • Save memory pages with zero-copy into the target memfd
  • Introduce an end-to-end test for proper image persistence on LUO-enabled systems

This is a simple approach to introduce LUO support into CRIU, by storing
our checkpoint images into memfds, and persisting them into a single LUO
session.

If the session descriptor is created by CRIU, we will halt instead of
exiting since session descriptors must remain open when kexec is called
in order to be preserved.

Signed-off-by: Karim Vergnes <me@thesola.io>
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.

1 participant