diff options
author | Alyssa Ross <hi@alyssa.is> | 2023-06-25 08:08:53 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2024-01-19 12:02:09 +0100 |
commit | d98eb958ee345499c21ec99660fe3cce31b1342e (patch) | |
tree | c0eb43c4c673fa1ed51d79deeec880b3591ba54e | |
parent | fa82aab3e9e296c0c4177f2e991338842ad638b8 (diff) | |
download | spectrum-d98eb958ee345499c21ec99660fe3cce31b1342e.tar spectrum-d98eb958ee345499c21ec99660fe3cce31b1342e.tar.gz spectrum-d98eb958ee345499c21ec99660fe3cce31b1342e.tar.bz2 spectrum-d98eb958ee345499c21ec99660fe3cce31b1342e.tar.lz spectrum-d98eb958ee345499c21ec99660fe3cce31b1342e.tar.xz spectrum-d98eb958ee345499c21ec99660fe3cce31b1342e.tar.zst spectrum-d98eb958ee345499c21ec99660fe3cce31b1342e.zip |
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 <hi@alyssa.is>
-rw-r--r-- | host/start-vmm/lib.rs | 15 |
1 files changed, 0 insertions, 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<Command, String> { 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); - } -} |