feat: rework to support multiple platforms

This commit is contained in:
Alex Zenla
2024-05-05 07:27:35 -07:00
parent e8e3982b4e
commit 007f849a59
11 changed files with 369 additions and 180 deletions

View File

@ -5,7 +5,7 @@ use ipnetwork::IpNetwork;
use loopdev::LoopControl;
use tokio::sync::Semaphore;
use uuid::Uuid;
use xenclient::XenClient;
use xenclient::{x86pv::X86PvPlatform, XenClient};
use xenstore::{XsdClient, XsdInterface};
use self::{
@ -46,12 +46,12 @@ pub struct GuestInfo {
#[derive(Clone)]
pub struct RuntimeContext {
pub autoloop: AutoLoop,
pub xen: XenClient,
pub xen: XenClient<X86PvPlatform>,
}
impl RuntimeContext {
pub async fn new() -> Result<Self> {
let xen = XenClient::open(0).await?;
let xen = XenClient::new(0, X86PvPlatform::new()).await?;
Ok(RuntimeContext {
autoloop: AutoLoop::new(LoopControl::open()?),
xen,