Files
cloud-hypervisor/pci/src
Dylan Reid ab38a77c01 pci: vfio_user: replace unwrap() with explicit error
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>
2026-05-19 08:15:54 +00:00
..