mirror of
https://github.com/edera-dev/krata.git
synced 2025-08-03 05:10:55 +00:00
implement support for creating domains
This commit is contained in:
16
xenclient/examples/simple.rs
Normal file
16
xenclient/examples/simple.rs
Normal file
@ -0,0 +1,16 @@
|
||||
use xenclient::create::{DomainConfig, PvDomainConfig};
|
||||
use xenclient::{XenClient, XenClientError};
|
||||
|
||||
fn main() -> Result<(), XenClientError> {
|
||||
let mut client = XenClient::open()?;
|
||||
let mut config = DomainConfig::new();
|
||||
config.configure_cpus(1);
|
||||
config.configure_memory(524288, 524288, 0);
|
||||
config.configure_pv(PvDomainConfig::new(
|
||||
"/boot/vmlinuz-6.1.0-17-amd64".to_string(),
|
||||
None,
|
||||
None,
|
||||
));
|
||||
client.create(2, config)?;
|
||||
Ok(())
|
||||
}
|
Reference in New Issue
Block a user