mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
VfioUserDmaMapping::map panicked when find_region returned an anonymous mmap region. Change this so a user gets an error instead of a panic. When the VMM hotplugs a region into a guest that also has a vfio-user device, all region's handlers are called. With the anonymous memory backing (no file=, shared=on, or hugepages), region.file_offset() returns None and the .unwrap() panics the VMM. Replace the unwrap with an explicit error and use checked_add for the offset combine. Signed-off-by: Dylan Reid <dgreid@fb.com>