vmm: Enable Landlock in restore path

Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>
This commit is contained in:
Praveen K Paladugu 2024-03-01 21:05:17 +00:00 committed by Liu Wei
parent 11c17ca319
commit eea45a2c78

View File

@ -1459,6 +1459,18 @@ impl RequestHandler for Vmm {
)?; )?;
self.vm = Some(vm); self.vm = Some(vm);
if self
.vm_config
.as_ref()
.unwrap()
.lock()
.unwrap()
.landlock_enable
{
apply_landlock(self.vm_config.as_ref().unwrap().clone())
.map_err(VmError::ApplyLandlock)?;
}
// Now we can restore the rest of the VM. // Now we can restore the rest of the VM.
if let Some(ref mut vm) = self.vm { if let Some(ref mut vm) = self.vm {
vm.restore() vm.restore()