Skip to content

Commit 5488897

Browse files
committed
refactor(vmm): drop validate_tee_image_mode check
no-TEE mode does not need an is_dev image gate; remove the helper, call sites, and unit test.
1 parent e61b555 commit 5488897

2 files changed

Lines changed: 1 addition & 19 deletions

File tree

dstack/vmm/src/app.rs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,6 @@ pub struct Manifest {
7474
pub networking: Option<Networking>,
7575
}
7676

77-
pub(crate) fn validate_tee_image_mode(no_tee: bool, image_is_dev: bool) -> Result<()> {
78-
if no_tee && !image_is_dev {
79-
bail!("no-TEE mode requires a development image");
80-
}
81-
Ok(())
82-
}
83-
8477
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
8578
#[serde(rename_all = "snake_case")]
8679
pub enum AttachMode {
@@ -282,7 +275,6 @@ impl App {
282275
}
283276
let image_path = self.config.image.path.join(&manifest.image);
284277
let image = Image::load(&image_path).context("Failed to load image")?;
285-
validate_tee_image_mode(manifest.no_tee, image.info.is_dev)?;
286278
let vm_id = manifest.id.clone();
287279
let app_compose = vm_work_dir
288280
.app_compose()
@@ -862,7 +854,6 @@ impl App {
862854
}
863855
let image_path = self.config.image.path.join(&manifest.image);
864856
let image = Image::load(&image_path).context("Failed to load image")?;
865-
validate_tee_image_mode(manifest.no_tee, image.info.is_dev)?;
866857
let vm_id = manifest.id.clone();
867858
let already_running = cids_assigned.contains_key(&vm_id);
868859
let app_compose = vm_work_dir
@@ -1631,14 +1622,6 @@ mod tests {
16311622
assert_eq!(effective_vcpu_count(0, Some(1)), 1);
16321623
}
16331624

1634-
#[test]
1635-
fn no_tee_requires_a_development_image() {
1636-
assert!(validate_tee_image_mode(false, false).is_ok());
1637-
assert!(validate_tee_image_mode(false, true).is_ok());
1638-
assert!(validate_tee_image_mode(true, true).is_ok());
1639-
assert!(validate_tee_image_mode(true, false).is_err());
1640-
}
1641-
16421625
#[test]
16431626
fn effective_vcpu_count_rounds_for_hugepage_numa_split() {
16441627
assert_eq!(effective_vcpu_count(3, Some(2)), 4);

dstack/vmm/src/one_shot.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// SPDX-License-Identifier: Apache-2.0
44

5-
use crate::app::{make_sys_config, validate_tee_image_mode, Image, VmConfig, VmWorkDir};
5+
use crate::app::{make_sys_config, Image, VmConfig, VmWorkDir};
66
use crate::config::Config;
77
use crate::main_service;
88
use anyhow::{Context, Result};
@@ -82,7 +82,6 @@ pub async fn run_one_shot(
8282
let image_path = config.image.path.join(&manifest.image);
8383
let image = Image::load(&image_path)
8484
.with_context(|| format!("Failed to load image: {}", image_path.display()))?;
85-
validate_tee_image_mode(manifest.no_tee, image.info.is_dev)?;
8685

8786
// Create or use specified workdir and setup files
8887
let workdir_path = match workdir_option {

0 commit comments

Comments
 (0)