vmm: Propagate the set of memory slots to FDs received in migration

Create the VM using the FDs (wrapped in Files) that have been received
during the migration process.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford
2022-01-14 08:19:43 +00:00
parent 735658a49d
commit 1daef5e8c9
2 changed files with 12 additions and 3 deletions

View File

@@ -867,6 +867,7 @@ impl Vm {
)
}
#[allow(clippy::too_many_arguments)]
pub fn new_from_migration(
config: Arc<Mutex<VmConfig>>,
exit_evt: EventFd,
@@ -875,6 +876,7 @@ impl Vm {
hypervisor: Arc<dyn hypervisor::Hypervisor>,
activate_evt: EventFd,
memory_manager_data: &MemoryManagerSnapshotData,
existing_memory_files: Option<HashMap<u32, File>>,
) -> Result<Self> {
hypervisor.check_required_extensions().unwrap();
let vm = hypervisor.create_vm().unwrap();
@@ -897,7 +899,7 @@ impl Vm {
#[cfg(feature = "tdx")]
false,
Some(memory_manager_data),
None,
existing_memory_files,
#[cfg(target_arch = "x86_64")]
None,
)