STRUCT LIVEUPDATE_SESSION_PRESERVE_FD(9)
β¨ struct live..._preserve_fd(9) β¨
hiii bestie π welcome to the Kernel API Manual β today's main character is struct liveupdate_session_preserve_fd, aka the lil parameter bucket for ioctl(LIVEUPDATE_SESSION_PRESERVE_FD). no cap, this one is all about preserving a file descriptor. π«Ά
πΈ NAME πΈ
struct liveupdate_session_preserve_fd β ioctl(LIVEUPDATE_SESSION_PRESERVE_FD)
π¦ SYNOPSIS π¦
struct liveupdate_session_preserve_fd {
__u32 size;
__s32 fd;
__aligned_u64 token;
};
π Members π
sizeβ Input; it is literallysizeof(struct liveupdate_session_preserve_fd), bestie.fdβ Input; the user-space file descriptor to be preserved.tokenβ Input; an opaque, unique token for the preserved resource.
β¨ Description β¨
okay so this struct holds parameters for preserving a file descriptor. very demure, very mindful. π
You set the fd field to identify the file descriptor you want to preserve β think memfd, kvm, iommufd, VFIO, yep those cuties. Then the kernel validates whether this FD type and its dependencies are supported for preservation. π΅οΈββοΈ
If validation passes, the kernel marks the FD internally and initiates the process of preparing its state for saving. The actual snapshotting of the state typically happens during the subsequent LIVEUPDATE_IOCTL_PREPARE execution phase β though some finalization might occur during freeze. π§
On successful validation and initiation, the kernel uses the token field with an opaque identifier representing the resource being preserved. This token confirms the FD is targeted for preservation and is required for the subsequent LIVEUPDATE_SESSION_RETRIEVE_FD call after the live update. slay. π₯
π Return π
0 on success (validation passed, preservation initiated), negative error code on failure (e.g., unsupported FD type, dependency issue, validation failed).
π SEE ALSO π
- Kernel file
./include/uapi/linux/liveupdate.h - General ioctl
format(9) struct liveupdate_ioctl_create_session(9)struct liveupdate_ioctl_retrieve_session(9)struct liveupdate_session_retrieve_fd(9)struct liveupdate_session_finish(9)struct liveupdate_session_get_name(9)
mwah π β this fab page comes from ./include/uapi/linux, dated October 2026, and it is the Kernel API Manual entry for struct live..._preserve_fd(9). bye bestie! π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms