pub trait BootConfigurator {
// Required method
fn write_bootparams<M>(params: &BootParams, guest_memory: &M) -> Result<()>
where M: GuestMemory;
}
elf
or pe
or bzimage
only.Expand description
Trait that defines interfaces for building (TBD) and configuring boot parameters.
Currently, this trait exposes a single function which writes user-provided boot parameters into guest memory at the user-specified addresses. It’s meant to be called after the kernel is loaded and after the boot parameters are built externally (in the VMM).
This trait will be extended with additional functionality to build boot parameters.
Required Methods§
Sourcefn write_bootparams<M>(params: &BootParams, guest_memory: &M) -> Result<()>where
M: GuestMemory,
fn write_bootparams<M>(params: &BootParams, guest_memory: &M) -> Result<()>where
M: GuestMemory,
Writes the boot parameters (configured elsewhere) into guest memory.
The arguments are split into header
and sections
to accommodate different boot
protocols like Linux boot and PVH. In Linux boot, the e820 map could be considered as
sections
, but it’s already encapsulated in the boot_params
and thus all the boot
parameters are passed through a single struct. In PVH, the memory map table is separated
from the hvm_start_info
struct, therefore it’s passed separately.
§Arguments
params
- struct containing the header section of the boot parameters, additional sections and modules, and their associated addresses in guest memory. These vary with the boot protocol used.guest_memory
- guest’s physical memory.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
impl BootConfigurator for LinuxBootConfigurator
impl BootConfigurator for PvhBootConfigurator
elf
or bzimage
) and (x86 or x86-64) only.