feature(oci): add configuration value for oci seed file (#220)

This commit is contained in:
Alex Zenla 2024-07-01 12:36:21 -07:00 committed by GitHub
parent 367d31b11f
commit fe8e1d5521
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 2 deletions

View File

@ -6,10 +6,18 @@ use tokio::fs;
#[derive(Serialize, Deserialize, Clone, Debug, Default)]
pub struct DaemonConfig {
#[serde(default)]
pub oci: OciConfig,
#[serde(default)]
pub pci: DaemonPciConfig,
}
#[derive(Serialize, Deserialize, Clone, Debug, Default)]
pub struct OciConfig {
#[serde(default)]
pub seed: Option<String>,
}
#[derive(Serialize, Deserialize, Clone, Debug, Default)]
pub struct DaemonPciConfig {
#[serde(default)]

View File

@ -93,7 +93,8 @@ impl Daemon {
let kernel_path = detect_guest_path(&store, "kernel")?;
let addons_path = detect_guest_path(&store, "addons.squashfs")?;
let packer = OciPackerService::new(None, &image_cache_dir, OciPlatform::current()).await?;
let seed = config.oci.seed.clone().map(PathBuf::from);
let packer = OciPackerService::new(seed, &image_cache_dir, OciPlatform::current()).await?;
let runtime = Runtime::new(host_uuid).await?;
let glt = GuestLookupTable::new(0, host_uuid);
let guests_db_path = format!("{}/guests.db", store);
@ -128,7 +129,9 @@ impl Daemon {
// TODO: Make initial power management policy configurable.
let power = runtime.power_management_context().await?;
power.set_smt_policy(true).await?;
power.set_scheduler_policy("performance".to_string()).await?;
power
.set_scheduler_policy("performance".to_string())
.await?;
Ok(Self {
store,