Skip to content

Commit 32e882e

Browse files
committed
fix(mmio/persist): do not unwrap error if VirtioMem restore fails
Return the error up the stack instead of unwrapping it. Note that on PCI this error is unwrapped for every device so there's no change there. Signed-off-by: Riccardo Mancini <[email protected]>
1 parent 18367e6 commit 32e882e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/vmm/src/device_manager/persist.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ impl<'a> Persist<'a> for MMIODeviceManager {
607607

608608
if let Some(memory_state) = &state.memory_device {
609609
let ctor_args = VirtioMemConstructorArgs::new(Arc::clone(vm));
610-
let device = VirtioMem::restore(ctor_args, &memory_state.device_state).unwrap();
610+
let device = VirtioMem::restore(ctor_args, &memory_state.device_state)?;
611611

612612
constructor_args.vm_resources.memory_hotplug = Some(MemoryHotplugConfig {
613613
total_size_mib: device.total_size_mib(),

0 commit comments

Comments
 (0)