Skip to content

CPR: shared RAM with /dev/fdset for LUO kexec reboot

Li Chen qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3system/physmem: allow /dev/fdset for file-backed RAMsystem/physmem.c tests/qtest/migration/cpr-tests.c+52 -30 replies
2/3docs: CPR: document shared RAM with x-ignore-shareddocs/devel/migration/CPR.rst+14 -30 replies
3/3tests/qtest: cpr-reboot: check ignore-shared transfertests/qtest/migration/cpr-tests.c+18 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] CPR: shared RAM with /dev/fdset for LUO kexec reboot

Hi,

This series improves a CPR workflow for large guests where guest RAM is shared/external and preserved in place. With shared RAM and x-ignore-shared enabled, the migration stream skips guest RAM pages and transfers only non-RAM VM state (vmstate). This avoids copying guest RAM to the on-disk migration URI, which can significantly reduce checkpoint/restore downtime for multi-GB guests.

In the LUO/KHO update flow [1], a LUO agent coordinates a host kexec reboot while keeping VM RAM content intact. LUO creates the guest RAM backing as a memfd and passes it to QEMU via -add-fd on the initial launch, so that memory-backend-file can use it as the shared RAM backing. On update, LUO checkpoints QEMU, reboots the host kernel via kexec, and then re-launches QEMU to restore vmstate while reusing the same preserved memfd-backed RAM FD. Today LUO only supports handing off guest RAM via memfd [2].

To re-attach that preserved RAM backing without reopening non-persistent paths, QEMU needs to let memory-backend-file consume the pre-opened FD using mem-path=/dev/fdset/<id>. However, memory-backend-file currently uses open()/creat() directly, so /dev/fdset/<id> cannot be resolved through the fdset mechanism, making this workflow impossible.

This series allows /dev/fdset/<id> for file-backed RAM, documents the setup, and adds qtests to validate that x-ignore-shared keeps RAM transfer minimal in the cpr-reboot path.

[1]: https://docs.kernel.org/next/core-api/liveupdate.html
[2]: https://docs.kernel.org/mm/memfd_preservation.html

Li Chen (3):
system/physmem: allow /dev/fdset for file-backed RAM
docs: CPR: document shared RAM with x-ignore-shared tests/qtest: cpr-reboot: check ignore-shared transfer

 docs/devel/migration/CPR.rst      | 17 ++++++++--
 system/physmem.c                  | 17 ++++++++--
 tests/qtest/migration/cpr-tests.c | 56 ++++++++++++++++++++++++++++++-
 3 files changed, 84 insertions(+), 6 deletions(-)
Signature · 1 line
2.52.0