From d98eb958ee345499c21ec99660fe3cce31b1342e Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Sun, 25 Jun 2023 08:08:53 +0000 Subject: host/start-vmm: allow VM names to contain commas This restriction was in place because we needed to be able to refer to VM directories on the cloud-hypervisor command line, where commas have special meaning. Now that we're instead using the JSON API for VM configuration, there's no need for the restriction. Signed-off-by: Alyssa Ross --- host/start-vmm/lib.rs | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/host/start-vmm/lib.rs b/host/start-vmm/lib.rs index f927bf2..9c2b4b6 100644 --- a/host/start-vmm/lib.rs +++ b/host/start-vmm/lib.rs @@ -207,10 +207,6 @@ pub fn create_vm(dir: &Path, config_root: &Path) -> Result<(), String> { return Err("not running from a VM service directory".to_string()); } - if vm_name.contains(',') { - return Err(format!("VM name may not contain a comma: {:?}", vm_name)); - } - let vm_name = &vm_name[3..]; let config = vm_config(vm_name, config_root)?; @@ -232,14 +228,3 @@ pub fn vm_command(api_socket_fd: RawFd) -> Result { Ok(command) } - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn test_vm_name_comma() { - let e = create_vm(Path::new("/vm-,"), Path::new("/")).unwrap_err(); - assert!(e.contains("comma"), "unexpected error: {:?}", e); - } -} -- cgit 1.4.1