diff --git a/Cargo.toml b/Cargo.toml index db8f933..90240cc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "krunkit" -version = "0.1.1" +version = "0.1.2" authors = ["Tyler Fanelli "] edition = "2021" description = "CLI tool to start VMs with libkrun" diff --git a/src/context.rs b/src/context.rs index 5ac003f..c866539 100644 --- a/src/context.rs +++ b/src/context.rs @@ -46,8 +46,12 @@ impl TryFrom for KrunContext { let id = u32::try_from(id).unwrap(); // Set the krun VM's number of vCPUs and amount of memory allocated. + // + // libkrun has a max of 8 vCPUs allowed. if args.cpus == 0 { return Err(anyhow!("zero vcpus inputted (invalid)")); + } else if args.cpus > 8 { + return Err(anyhow!("too many vCPUs configured (max 8)")); } if args.memory == 0 {