From cfe1de26c8ab870ea56d34894827a94776f8b108 Mon Sep 17 00:00:00 2001 From: Tyler Fanelli Date: Wed, 17 Jul 2024 12:55:18 -0400 Subject: [PATCH 1/2] context: Add max vCPU check Signed-off-by: Tyler Fanelli --- src/context.rs | 4 ++++ 1 file changed, 4 insertions(+) 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 { From 377c03293cb51a865073b5f31a97c5b75cb8cc42 Mon Sep 17 00:00:00 2001 From: Tyler Fanelli Date: Wed, 17 Jul 2024 12:56:09 -0400 Subject: [PATCH 2/2] Update to 0.1.2 Signed-off-by: Tyler Fanelli --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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"