Function arch::load_image

source ·
pub fn load_image<F>(
    guest_mem: &GuestMemory,
    image: &mut F,
    guest_addr: GuestAddress,
    max_size: u64
) -> Result<usize, LoadImageError>
Expand description

Load an image from a file into guest memory.

§Arguments

  • guest_mem - The memory to be used by the guest.
  • guest_addr - The starting address to load the image in the guest memory.
  • max_size - The amount of space in bytes available in the guest memory for the image.
  • image - The file containing the image to be loaded.

The size in bytes of the loaded image is returned.