mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-08-21 07:21:15 +00:00
vmm: Allow PVH boot with initramfs
We can now allow guests that specify an initramfs to boot using the PVH boot protocol. Signed-off-by: Alejandro Jimenez <alejandro.j.jimenez@oracle.com>
This commit is contained in:
parent
0fc3936448
commit
7134f3129f
@ -539,27 +539,18 @@ impl Vm {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
None => {
|
None => {
|
||||||
// Assume by default Linux boot protocol is used and not PVH
|
let entry_point_addr: GuestAddress;
|
||||||
let mut entry_point_addr: GuestAddress = entry_addr.kernel_load;
|
let boot_prot: BootProtocol;
|
||||||
|
|
||||||
let boot_prot = if entry_addr.pvh_entry_addr.is_some() {
|
if let Some(pvh_entry_addr) = entry_addr.pvh_entry_addr {
|
||||||
// Handle the case where PVH is set but the user wants to
|
// Use the PVH kernel entry point to boot the guest
|
||||||
// boot an initramfs. At this point in time, our code does
|
entry_point_addr = pvh_entry_addr;
|
||||||
// not support initramfs along with PVH, hence we make the
|
boot_prot = BootProtocol::PvhBoot;
|
||||||
// code fallback to the legacy Linux boot.
|
|
||||||
if initramfs_config.is_some() {
|
|
||||||
warn!(
|
|
||||||
"PVH not supported with initramfs, falling back to legacy Linux boot"
|
|
||||||
);
|
|
||||||
BootProtocol::LinuxBoot
|
|
||||||
} else {
|
|
||||||
// entry_addr.pvh_entry_addr field is safe to unwrap here
|
|
||||||
entry_point_addr = entry_addr.pvh_entry_addr.unwrap();
|
|
||||||
BootProtocol::PvhBoot
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
BootProtocol::LinuxBoot
|
// Use the Linux 64-bit boot protocol
|
||||||
};
|
entry_point_addr = entry_addr.kernel_load;
|
||||||
|
boot_prot = BootProtocol::LinuxBoot;
|
||||||
|
}
|
||||||
|
|
||||||
arch::configure_system(
|
arch::configure_system(
|
||||||
&mem,
|
&mem,
|
||||||
|
Loading…
Reference in New Issue
Block a user