Skip to content

Commit 6436c65

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 8c9412c commit 6436c65

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)