mirror of
https://github.com/edera-dev/krata.git
synced 2025-08-03 13:11:31 +00:00
hypha: name domain with uuid
This commit is contained in:
@ -4,6 +4,7 @@ use crate::image::{ImageCompiler, ImageInfo};
|
||||
use ocipkg::ImageName;
|
||||
use std::fs;
|
||||
use std::path::PathBuf;
|
||||
use uuid::Uuid;
|
||||
use xenclient::{DomainConfig, XenClient};
|
||||
|
||||
pub struct Controller {
|
||||
@ -50,8 +51,11 @@ impl Controller {
|
||||
}
|
||||
|
||||
pub fn launch(&mut self) -> Result<u32> {
|
||||
let uuid = Uuid::new_v4();
|
||||
let name = format!("hypha-{uuid}");
|
||||
let _image_info = self.compile()?;
|
||||
let config = DomainConfig {
|
||||
name: &name,
|
||||
max_vcpus: self.vcpus,
|
||||
mem_mb: self.mem,
|
||||
kernel_path: self.kernel_path.as_str(),
|
||||
|
@ -33,7 +33,7 @@ impl ImageCache {
|
||||
{
|
||||
let manifest_text = fs::read_to_string(&manifest_path)?;
|
||||
let manifest: ImageManifest = serde_json::from_str(&manifest_text)?;
|
||||
let config_text = fs::read_to_string(&manifest_path)?;
|
||||
let config_text = fs::read_to_string(&config_path)?;
|
||||
let config: ImageConfiguration = serde_json::from_str(&config_text)?;
|
||||
debug!("cache hit digest={}", digest);
|
||||
Some(ImageInfo::new(squashfs_path.clone(), manifest, config)?)
|
||||
|
Reference in New Issue
Block a user