We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cf248db commit 859b0b4Copy full SHA for 859b0b4
src/vmm/src/vstate/memory.rs
@@ -482,8 +482,9 @@ impl GuestMemoryExtension for GuestMemoryMmap {
482
483
/// Convert guest physical address to file offset
484
fn gpa_to_offset(&self, gpa: GuestAddress) -> Option<u64> {
485
- self.find_region(gpa).map(|r| {
486
- gpa.0 - r.start_addr().0 + r.file_offset().expect("File offset is None").start()
+ self.find_region(gpa).and_then(|r| {
+ r.file_offset()
487
+ .map(|file_offset| gpa.0 - r.start_addr().0 + file_offset.start())
488
})
489
}
490
0 commit comments