From 4e9850293f9a5879ce0522475cef8c4902329d71 Mon Sep 17 00:00:00 2001 From: Alex Zenla Date: Thu, 6 Jun 2024 07:38:25 +0000 Subject: [PATCH] fix support for pv --- crates/xen/xenclient/src/boot.rs | 3 ++- crates/xen/xenclient/src/x86pv.rs | 4 ++++ crates/xen/xenclient/src/x86pvh.rs | 4 ++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/crates/xen/xenclient/src/boot.rs b/crates/xen/xenclient/src/boot.rs index bbf4497..6c846b2 100644 --- a/crates/xen/xenclient/src/boot.rs +++ b/crates/xen/xenclient/src/boot.rs @@ -167,7 +167,7 @@ impl BootSetup { cmdline: &str, ) -> Result { 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<()>; diff --git a/crates/xen/xenclient/src/x86pv.rs b/crates/xen/xenclient/src/x86pv.rs index 604239c..dc3a0d1 100644 --- a/crates/xen/xenclient/src/x86pv.rs +++ b/crates/xen/xenclient/src/x86pv.rs @@ -453,6 +453,10 @@ impl BootSetupPlatform for X86PvPlatform { false } + fn hvm(&self) -> bool { + false + } + async fn initialize_early(&mut self, _: &mut BootDomain) -> Result<()> { Ok(()) } diff --git a/crates/xen/xenclient/src/x86pvh.rs b/crates/xen/xenclient/src/x86pvh.rs index fbc2284..8d99318 100644 --- a/crates/xen/xenclient/src/x86pvh.rs +++ b/crates/xen/xenclient/src/x86pvh.rs @@ -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() };