vmm: enable landlock during live migration

Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>
This commit is contained in:
Praveen K Paladugu 2024-06-12 11:59:30 +00:00 committed by Liu Wei
parent eea45a2c78
commit 457fd9ef96

View File

@ -766,6 +766,19 @@ impl Vmm {
MigratableError::MigrateReceive(anyhow!("Error creating console devices: {:?}", e))
})?);
if self
.vm_config
.as_ref()
.unwrap()
.lock()
.unwrap()
.landlock_enable
{
apply_landlock(self.vm_config.as_ref().unwrap().clone()).map_err(|e| {
MigratableError::MigrateReceive(anyhow!("Error applying landlock: {:?}", e))
})?;
}
let vm = Vm::create_hypervisor_vm(
&self.hypervisor,
#[cfg(feature = "tdx")]