Commit 9e627a7
fix: do not panic if malformed snapshot file contains vhost devices
If a snapshot file is corrupted in a way that makes it _look_ like it
contains a vhost-user-blk device, restoring will hit an `unimplemented!`
inside `block::vhost_user/persist.rs`. So instead of using
`unimplemented!`, just unconditionally return an error here. These
errors are handled properly and cause Firecracker to exit gracefully
instead.
Signed-off-by: Patrick Roy <[email protected]>1 parent e7a952e commit 9e627a7
File tree
2 files changed
+3
-3
lines changed- src/vmm/src/devices/virtio/block/vhost_user
2 files changed
+3
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | | - | |
| 22 | + | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
0 commit comments