Skip to content

[WIP] openvmm: emulated nvme configuration #1833

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 8, 2025

Working on issue #1534 to add NVMe emulated configuration options.

Implementation Complete ✅

  • Analyze existing NVMe implementation and CLI structure
  • Add max_ioqpairs parameter support to --nvme CLI option
  • Add support for multiple NVMe controllers (automatic based on max_ioqpairs)
  • Update storage builder to group namespaces by max_ioqpairs values
  • Add CLI help documentation for new parameter
  • Add unit tests for NvmeCli parsing
  • Generate unique controller instance IDs
  • Add integration tests for new functionality (optional)
  • Research qcow2 support (separate task)

Features Implemented

1. max_ioqpairs configuration

  • Users can specify --nvme file:disk.vhd,max_ioqpairs=128
  • Defaults to 64 if not specified (backward compatible)
  • Both VTL0 and VTL2 supported

2. Multiple NVMe controllers (automatic)

  • Different max_ioqpairs values automatically create separate controllers
  • No need for explicit controller IDs - system handles this intelligently
  • Each controller gets unique instance ID and subsystem ID
  • Namespaces with same max_ioqpairs are grouped together

CLI Examples

# Single controller with default max_ioqpairs=64
openvmm --nvme file:mydisk.vhd

# Single controller with custom max_ioqpairs
openvmm --nvme file:mydisk.vhd,max_ioqpairs=128

# Multiple controllers created automatically based on max_ioqpairs
openvmm --nvme file:disk1.vhd,max_ioqpairs=64 \
        --nvme file:disk2.vhd,max_ioqpairs=128 \
        --nvme file:disk3.vhd,max_ioqpairs=64 \
        --nvme file:disk4.vhd,max_ioqpairs=256

# This creates 3 controllers:
#   Controller 1: max_ioqpairs=64  (disk1.vhd, disk3.vhd)  
#   Controller 2: max_ioqpairs=128 (disk2.vhd)
#   Controller 3: max_ioqpairs=256 (disk4.vhd)

Implementation Notes

  • Smart controller creation: Controllers are created automatically when different max_ioqpairs values are used
  • Namespace grouping: All namespaces with the same max_ioqpairs go to the same controller
  • Unique instance IDs: Each controller gets a unique GUID derived from base + max_ioqpairs
  • VTL support: Works for both VTL0 and VTL2
  • Backward compatibility: Existing CLI usage continues to work unchanged

This implementation satisfies both requirements from the issue:

  1. ✅ max_ioqpairs=UINT32 configuration
  2. ✅ Support for additional NVMe controllers

Fixes #1534.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI and others added 2 commits August 8, 2025 23:00
- Add NvmeCli struct with max_ioqpairs parameter support
- Update CLI parsing to handle max_ioqpairs=UINT32 option
- Modify storage builder to track max_ioqpairs per VTL
- Apply configurable max_ioqpairs to NVMe controller creation
- Add validation to prevent conflicting max_ioqpairs values within VTL
- Add comprehensive tests for NvmeCli parsing

Co-authored-by: benhillis <[email protected]>
- Add controller_id field to NvmeCli struct
- Update CLI parsing to handle controller=UINT32 parameter
- Update method signatures and tests
- Begin refactoring storage builder for multiple controller support

Note: Implementation in progress, will complete controller grouping logic in next commit

Co-authored-by: benhillis <[email protected]>
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.

openvmm: emulated nvme configuration
2 participants