fix support for pv

This commit is contained in:
Alex Zenla 2024-06-06 07:38:25 +00:00
parent c3515ebe48
commit 4e9850293f
No known key found for this signature in database
GPG Key ID: 067B238899B51269
3 changed files with 10 additions and 1 deletions

View File

@ -167,7 +167,7 @@ impl<I: BootImageLoader, P: BootSetupPlatform> BootSetup<I, P> {
cmdline: &str,
) -> Result<BootDomain> {
let total_pages = mem_mb << (20 - self.platform.page_shift());
let image_info = self.image_loader.parse(true).await?;
let image_info = self.image_loader.parse(self.platform.hvm()).await?;
let mut domain = BootDomain {
domid: self.domid,
call: self.call.clone(),
@ -266,6 +266,7 @@ pub trait BootSetupPlatform: Clone {
fn page_size(&self) -> u64;
fn page_shift(&self) -> u64;
fn needs_early_kernel(&self) -> bool;
fn hvm(&self) -> bool;
async fn initialize_early(&mut self, domain: &mut BootDomain) -> Result<()>;

View File

@ -453,6 +453,10 @@ impl BootSetupPlatform for X86PvPlatform {
false
}
fn hvm(&self) -> bool {
false
}
async fn initialize_early(&mut self, _: &mut BootDomain) -> Result<()> {
Ok(())
}

View File

@ -330,6 +330,10 @@ impl BootSetupPlatform for X86PvhPlatform {
false
}
fn hvm(&self) -> bool {
true
}
async fn initialize_early(&mut self, domain: &mut BootDomain) -> Result<()> {
{
let mut config: acpi_config = unsafe { MaybeUninit::zeroed().assume_init() };