mirror of
https://github.com/edera-dev/krata.git
synced 2025-08-03 21:21:32 +00:00
feature(xen): dynamic platform architecture (#194)
* wip hvm * feat: move platform stuff all into it's own thing * hvm work * more hvm work * more hvm work * feat: rework to support multiple platforms * hvm nonredist * more hvm work * more hvm work * pvh work * work on loading cmdline * implement initrd loading for pvh * partially working pvh support * fix merge issues * pvh works! * swap over to pv support * remove old kernel stuff * fix support for pv * pvh is gone for now * fix(runtime): debug should be respected * fix(xen): arm64 is currently unsupported, treat it as such at runtime * fix(examples): use architecture cfg for boot example * fix(x86): use IOMMU only when needed for passthrough * chore(build): print kernel architecture during fetch
This commit is contained in:
@ -3,6 +3,12 @@ use tokio::fs;
|
||||
use xenclient::error::Result;
|
||||
use xenclient::{DomainConfig, XenClient};
|
||||
|
||||
#[cfg(target_arch = "x86_64")]
|
||||
type RuntimePlatform = xenclient::x86pv::X86PvPlatform;
|
||||
|
||||
#[cfg(not(target_arch = "x86_64"))]
|
||||
type RuntimePlatform = xenclient::unsupported::UnsupportedPlatform;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<()> {
|
||||
env_logger::init();
|
||||
@ -14,7 +20,7 @@ async fn main() -> Result<()> {
|
||||
}
|
||||
let kernel_image_path = args.get(1).expect("argument not specified");
|
||||
let initrd_path = args.get(2).expect("argument not specified");
|
||||
let client = XenClient::open(0).await?;
|
||||
let client = XenClient::new(0, RuntimePlatform::new()).await?;
|
||||
let config = DomainConfig {
|
||||
backend_domid: 0,
|
||||
name: "xenclient-test".to_string(),
|
||||
@ -22,8 +28,8 @@ async fn main() -> Result<()> {
|
||||
mem_mb: 512,
|
||||
kernel: fs::read(&kernel_image_path).await?,
|
||||
initrd: fs::read(&initrd_path).await?,
|
||||
cmdline: "debug elevator=noop".to_string(),
|
||||
use_console_backend: None,
|
||||
cmdline: "earlyprintk=xen earlycon=xen console=hvc0 init=/init".to_string(),
|
||||
swap_console_backend: None,
|
||||
disks: vec![],
|
||||
channels: vec![],
|
||||
vifs: vec![],
|
||||
|
Reference in New Issue
Block a user