Skip to content

Conversation

@k-veda
Copy link
Contributor

@k-veda k-veda commented Dec 12, 2025

Fix for issue #3987. Added code to function func YQExpressions() to give an error if number of CPU's is negative in file lima/cmd/limactl/editflags/editflags.go.

Signed-off-by: Veda Kutagula <veda.kutagula@utexas.edu>
if err != nil {
return nil, err
}
if numCpus < 0 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting to negative numbers is not caught by validation, but will cause a failure to start the VM. This must be caught; limactl edit should never leave lima.yaml in a non-startable state.

Can we just say -1 means the same amount as the host?
Other negative values such as -2 should be invalid.

Originally posted by @AkihiroSuda in #3987

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Can be revisited in another PR)

Copy link
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@AkihiroSuda AkihiroSuda added this to the v2.0.3 milestone Dec 15, 2025
@AkihiroSuda AkihiroSuda merged commit 3fa003c into lima-vm:master Dec 15, 2025
62 of 64 checks passed
@AkihiroSuda AkihiroSuda linked an issue Dec 15, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Number of CPUs is not validated

2 participants