fn load_image(image: &mut File, start_addr: u64, sys_mem: &Arc<AddressSpace>) -> Result<()> {
    let curr_loc = image.seek(SeekFrom::Current(0))?;
    let len = image.seek(SeekFrom::End(0))?;
    image.seek(SeekFrom::Start(curr_loc))?;

    sys_mem.write(image, GuestAddress(start_addr), len - curr_loc)?;

    Ok(())
}
/// Load linux kernel or initrd image file to Guest Memory.
///
/// # Arguments
/// * `image` - image file for kernel or initrd.
/// * `start_addr` - image start address in guest memory.
/// * `sys_mem` - guest memory.
///
/// # Errors
///
/// * Write image to guest memory failed.
Load linux kernel or initrd image file to Guest Memory.
Load linux kernel or initrd image file to Guest Memory .
fn load_image(image: &mut File, start_addr: u64, sys_mem: &Arc<AddressSpace>) -> Result<()> {
    let curr_loc = image.seek(SeekFrom::Current(0))?;
    let len = image.seek(SeekFrom::End(0))?;
    image.seek(SeekFrom::Start(curr_loc))?;
    sys_mem.write(image, GuestAddress(start_addr), len - curr_loc)?;
    Ok(())
}
fn load_image ( image : & mut File , start_addr : u64 , sys_mem : & Arc < AddressSpace > ) -> Result < ( ) > { let curr_loc = image . seek ( SeekFrom :: Current ( 0 ) ) ? ; let len = image . seek ( SeekFrom :: End ( 0 ) ) ? ; image . seek ( SeekFrom :: Start ( curr_loc ) ) ? ; sys_mem . write ( image , GuestAddress ( start_addr ) , len - curr_loc ) ? ; Ok ( ( ) ) }
Load linux kernel or initrd image file to Guest Memory.
Load linux kernel or initrd image file to Guest Memory .
image
&mut File
start_addr
u64
sys_mem
&Arc<AddressSpace>
image
&mut File
start_addr
u64
sys_mem
&Arc<AddressSpace>
errors
Write image to guest memory failed.
Write image to guest memory failed .