Thanks to visit codestin.com
Credit goes to github.com

Skip to content

vmm: Improved config validation - #8511

Merged
rbradford merged 4 commits into
cloud-hypervisor:mainfrom
rbradford:202607/virtio-validation
Jul 2, 2026
Merged

rbradford merged 4 commits into
cloud-hypervisor:mainfrom
rbradford:202607/virtio-validation

Conversation

@rbradford

Copy link
Copy Markdown
Member

Fix some configuration parsing/validation issues that can result in a panic if
the configuration is malformed.

  • option_parser: Make IntegerList generic
  • vmm: config: Replace integer list conversion
  • vmm: config: Reject invalid virtio queue sizes
  • vmm: config: Check NetConfig::socket set if vhost_user is set

@rbradford
rbradford requested a review from a team as a code owner July 2, 2026 07:51

@phip1611 phip1611 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm!

Comment thread vmm/src/config.rs
rbradford added 4 commits July 2, 2026 13:35
This allows its use for all integer types and will generate an error if
the value is too wide for the type.

Assisted-by: Claude:Opus-4.8
Signed-off-by: Rob Bradford <[email protected]>
Now that IntegerList can handle any width number type use that for the
queue_sizes parameter on `--generic-vhost-user`

Signed-off-by: Rob Bradford <[email protected]>
The queue size must fit into a u16 and be a power of 2 according to the
spec.

Signed-off-by: Rob Bradford <[email protected]>
This check was already included in the DiskConfig validation but missing
for NetConfig.

Signed-off-by: Rob Bradford <[email protected]>
@rbradford
rbradford force-pushed the 202607/virtio-validation branch from ee8376d to c68ace8 Compare July 2, 2026 14:50
@rbradford
rbradford enabled auto-merge July 2, 2026 14:54
@rbradford
rbradford added this pull request to the merge queue Jul 2, 2026
Merged via the queue into cloud-hypervisor:main with commit 6f815c4 Jul 2, 2026
39 checks passed
@github-project-automation github-project-automation Bot moved this from 🆕 New to ✅ Done in Cloud Hypervisor Roadmap Jul 8, 2026
@rbradford rbradford added the bug-fix Bug fix to include in release notes label Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug-fix Bug fix to include in release notes

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

2 participants