Skip to content

Commit dad1b60

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 4c7b825 commit dad1b60

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
@@ -595,7 +595,7 @@ impl<'a> Persist<'a> for MMIODeviceManager {
595595

596596
if let Some(memory_state) = &state.memory_device {
597597
let ctor_args = VirtioMemConstructorArgs::new(Arc::clone(vm));
598-
let device = VirtioMem::restore(ctor_args, &memory_state.device_state).unwrap();
598+
let device = VirtioMem::restore(ctor_args, &memory_state.device_state)?;
599599

600600
constructor_args.vm_resources.memory_hotplug = Some(MemoryHotplugConfig {
601601
total_size_mib: device.total_size_mib(),

0 commit comments

Comments
 (0)