Struct linux_loader::configurator::pvh::PvhBootConfigurator [−][src]
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]
M: GuestMemory,
Writes the boot parameters (configured elsewhere) into guest memory.
Arguments
params
- boot parameters. The header contains ahvm_start_info
struct. The sections contain the memory map in a vector ofhvm_memmap_table_entry
structs. The modules, if specified, containhvm_modlist_entry
structs.guest_memory
- guest’s physical memory.
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
impl RefUnwindSafe for PvhBootConfigurator
impl Send for PvhBootConfigurator
impl Sync for PvhBootConfigurator
impl Unpin for PvhBootConfigurator
impl UnwindSafe for PvhBootConfigurator
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,