Skip to content

Commit 2a5e5e0

Browse files
committed
imp: remove validate_only.
1 parent 7a5a47f commit 2a5e5e0

File tree

3 files changed

+4
-547
lines changed

3 files changed

+4
-547
lines changed

vmm/src/main.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ mod host_api_service;
2929
mod main_routes;
3030
mod main_service;
3131
mod one_shot;
32-
mod validation;
3332

3433
const CARGO_PKG_VERSION: &str = env!("CARGO_PKG_VERSION");
3534
const GIT_REV: &str = git_version::git_version!(
@@ -51,9 +50,6 @@ struct Args {
5150
/// One-shot mode: setup VM and execute QEMU command from VM configuration file
5251
#[arg(long)]
5352
one_shot: Option<String>,
54-
/// Validate JSON configuration file without executing (useful for debugging)
55-
#[arg(long)]
56-
validate_only: Option<String>,
5753
/// Working directory for one-shot mode (default: create in current directory)
5854
#[arg(long)]
5955
workdir: Option<String>,
@@ -154,10 +150,6 @@ async fn main() -> Result<()> {
154150
return one_shot::run_one_shot(&vm_config_path, config, args.workdir, args.dry_run).await;
155151
}
156152

157-
// Handle validate-only mode
158-
if let Some(vm_config_path) = args.validate_only {
159-
return validation::validate_config_file(&vm_config_path).await;
160-
}
161153

162154
let api_auth = ApiToken::new(config.auth.tokens.clone(), config.auth.enabled);
163155
let supervisor = {

vmm/src/one_shot.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::app::{Image, VmConfig, VmWorkDir};
22
use crate::main_service;
3-
use crate::{config::Config, validation};
3+
use crate::config::Config;
44
use anyhow::{Context, Result};
55

66
pub async fn run_one_shot(
@@ -59,9 +59,9 @@ pub async fn run_one_shot(
5959
let vm_config_json = fs_err::read_to_string(vm_config_path)
6060
.with_context(|| format!("Failed to read VM configuration file: {}", vm_config_path))?;
6161

62-
// Parse with better error messages
63-
let vm_config: VmConfiguration =
64-
validation::parse_vm_config_with_validation(&vm_config_json, vm_config_path)?;
62+
// Parse VM configuration
63+
let vm_config: VmConfiguration = serde_json::from_str(&vm_config_json)
64+
.with_context(|| format!("Failed to parse VM configuration from: {}", vm_config_path))?;
6565

6666
// Calculate compose_hash using the same logic as main_service
6767
let compose_hash = {

0 commit comments

Comments
 (0)