mirror of
https://github.com/edera-dev/krata.git
synced 2025-08-03 05:10:55 +00:00
fix(examples): use architecture cfg for boot example
This commit is contained in:
@ -1,9 +1,14 @@
|
|||||||
use std::{env, process};
|
use std::{env, process};
|
||||||
use tokio::fs;
|
use tokio::fs;
|
||||||
use xenclient::error::Result;
|
use xenclient::error::Result;
|
||||||
use xenclient::x86pv::X86PvPlatform;
|
|
||||||
use xenclient::{DomainConfig, XenClient};
|
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]
|
#[tokio::main]
|
||||||
async fn main() -> Result<()> {
|
async fn main() -> Result<()> {
|
||||||
env_logger::init();
|
env_logger::init();
|
||||||
@ -15,7 +20,7 @@ async fn main() -> Result<()> {
|
|||||||
}
|
}
|
||||||
let kernel_image_path = args.get(1).expect("argument not specified");
|
let kernel_image_path = args.get(1).expect("argument not specified");
|
||||||
let initrd_path = args.get(2).expect("argument not specified");
|
let initrd_path = args.get(2).expect("argument not specified");
|
||||||
let client = XenClient::new(0, X86PvPlatform::new()).await?;
|
let client = XenClient::new(0, RuntimePlatform::new()).await?;
|
||||||
let config = DomainConfig {
|
let config = DomainConfig {
|
||||||
backend_domid: 0,
|
backend_domid: 0,
|
||||||
name: "xenclient-test".to_string(),
|
name: "xenclient-test".to_string(),
|
||||||
|
Reference in New Issue
Block a user