Skip to main content

try_build_gpn_list

Function try_build_gpn_list 

Source
pub fn try_build_gpn_list(
    regions: impl IntoIterator<Item = impl Borrow<DataRegion>>,
) -> Option<(Vec<u64>, usize, usize)>
Expand description

Try to build a single PagedRange GPN list from the data regions.

Returns Some((gpns, offset, len)) if every region boundary falls on a page boundary (or regions are GPA-contiguous), so the whole chain can be expressed as one [guestmem::ranges::PagedRange]. Returns None if any interior boundary violates the constraint.