pub fn initrd_load_addr(guest_mem: &GuestMemoryMmap, initrd_size: usize) -> super::Result<u64> {
    let first_region = guest_mem
        .find_region(GuestAddress::new(0))
        .ok_or(Error::InitrdAddress)?;
    // It's safe to cast to usize because the size of a region can't be greater than usize.
    let lowmem_size = first_region.len() as usize;

    if lowmem_size < initrd_size {
        return Err(Error::InitrdAddress);
    }

    let align_to_pagesize = |address| address & !(super::PAGE_SIZE - 1);
    Ok(align_to_pagesize(lowmem_size - initrd_size) as u64)
}
/// Returns the memory address where the initrd could be loaded.
Returns the memory address where the initrd could be loaded.
Returns the memory address where the initrd could be loaded .
pub fn initrd_load_addr(guest_mem: &GuestMemoryMmap, initrd_size: usize) -> super::Result<u64> {
    let first_region = guest_mem
        .find_region(GuestAddress::new(0))
        .ok_or(Error::InitrdAddress)?;
    // It's safe to cast to usize because the size of a region can't be greater than usize.
    let lowmem_size = first_region.len() as usize;
    if lowmem_size < initrd_size {
        return Err(Error::InitrdAddress);
    }
    let align_to_pagesize = |address| address & !(super::PAGE_SIZE - 1);
    Ok(align_to_pagesize(lowmem_size - initrd_size) as u64)
}
pub fn initrd_load_addr ( guest_mem : & GuestMemoryMmap , initrd_size : usize ) -> super :: Result < u64 > { let first_region = guest_mem . find_region ( GuestAddress :: new ( 0 ) ) . ok_or ( Error :: InitrdAddress ) ? ; // It's safe to cast to usize because the size of a region can't be greater than usize. let lowmem_size = first_region . len ( ) as usize ; if lowmem_size < initrd_size { return Err ( Error :: InitrdAddress ) ; } let align_to_pagesize = | address | address & ! ( super :: PAGE_SIZE - 1 ) ; Ok ( align_to_pagesize ( lowmem_size - initrd_size ) as u64 ) }
Returns the memory address where the initrd could be loaded.
Returns the memory address where the initrd could be loaded .
guest_mem
&GuestMemoryMmap
initrd_size
usize