Struct linux_loader::configurator::pvh::PvhBootConfigurator[][src]

pub struct PvhBootConfigurator {}

Boot configurator for the PVH boot protocol.

Trait Implementations

impl BootConfigurator for PvhBootConfigurator[src]

fn write_bootparams<M>(params: &BootParams, guest_memory: &M) -> Result<()> where
    M: GuestMemory
[src]

Writes the boot parameters (configured elsewhere) into guest memory.

Arguments

Examples

fn create_guest_memory() -> GuestMemoryMmap {
    GuestMemoryMmap::from_ranges(&[(GuestAddress(0x0), (MEM_SIZE as usize))]).unwrap()
}

fn build_boot_params() -> (hvm_start_info, Vec<hvm_memmap_table_entry>) {
    let mut start_info = hvm_start_info::default();
    let memmap_entry = hvm_memmap_table_entry {
        addr: 0x7000,
        size: 0,
        type_: E820_RAM,
        reserved: 0,
  };
  start_info.magic = XEN_HVM_START_MAGIC_VALUE;
  start_info.version = 1;
  start_info.nr_modules = 0;
  start_info.memmap_entries = 0;
  (start_info, vec![memmap_entry])
}

fn main() {
    let guest_mem = create_guest_memory();
    let (mut start_info, memmap_entries) = build_boot_params();
    let start_info_addr = GuestAddress(0x6000);
    let memmap_addr = GuestAddress(0x7000);
    start_info.memmap_paddr = memmap_addr.raw_value();

    let mut boot_params = BootParams::new::<hvm_start_info>(&start_info, start_info_addr);
    boot_params.set_sections::<hvm_memmap_table_entry>(&memmap_entries, memmap_addr);
    PvhBootConfigurator::write_bootparams::<GuestMemoryMmap>(&boot_params, &guest_mem).unwrap();
}

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.