vmm: config: add memory_restore_mode to RestoreConfig

Add a MemoryRestoreMode enum (Copy | OnDemand) to RestoreConfig so
the restore path can be selected at restore time. Copy preserves the
existing eager read-copy behavior. OnDemand enables userfaultfd-based
demand paging and fails restore if the kernel does not support it.

Validate that prefault=on is not combined with OnDemand mode.

Update the OpenAPI spec with the new enum field.

Signed-off-by: Shayon Mukherjee <shayonj@gmail.com>
This commit is contained in:
Shayon Mukherjee
2026-03-13 05:47:16 -07:00
committed by Rob Bradford
parent 8340307ace
commit bf85af907e
3 changed files with 121 additions and 3 deletions

View File

@@ -1342,6 +1342,11 @@ components:
destination_url:
type: string
MemoryRestoreMode:
type: string
enum: [Copy, OnDemand]
default: Copy
RestoreConfig:
required:
- source_url
@@ -1351,6 +1356,8 @@ components:
type: string
prefault:
type: boolean
memory_restore_mode:
$ref: "#/components/schemas/MemoryRestoreMode"
ReceiveMigrationData:
required: