feat: pci passthrough

This commit is contained in:
Alex Zenla
2024-04-23 22:36:36 -07:00
parent 95fbc62486
commit afbc0a88bd
13 changed files with 530 additions and 10 deletions

View File

@ -13,7 +13,8 @@ use krata::launchcfg::{
use krataoci::packer::OciPackedImage;
use tokio::sync::Semaphore;
use uuid::Uuid;
use xenclient::{DomainChannel, DomainConfig, DomainDisk, DomainNetworkInterface};
pub use xenclient::pci::PciBdf;
use xenclient::{DomainChannel, DomainConfig, DomainDisk, DomainNetworkInterface, DomainPciDevice};
use xenstore::XsdInterface;
use crate::cfgblk::ConfigBlock;
@ -31,6 +32,7 @@ pub struct GuestLaunchRequest {
pub mem: u64,
pub env: HashMap<String, String>,
pub run: Option<Vec<String>>,
pub pcis: Vec<PciBdf>,
pub debug: bool,
pub image: OciPackedImage,
}
@ -204,6 +206,12 @@ impl GuestLauncher {
bridge: None,
script: None,
}],
pcis: request
.pcis
.clone()
.into_iter()
.map(|bdf| DomainPciDevice { bdf })
.collect::<Vec<_>>(),
filesystems: vec![],
event_channels: vec![],
extra_keys,