Add --virtio-queues and --virtio-vectors CLI options - #1089
Merged
kostyanf14 merged 2 commits intoAug 10, 2026
Conversation
Allow setting virtqueues and MSI-X vectors on the virtio device under test via CLI. Queues map to mq=on/num_queues=/num-queues= per device type; vectors override QEMU's auto-assignment on any virtio-pci device. Signed-off-by: Elizabeth Ashurov <eashurov@redhat.com>
Signed-off-by: Elizabeth Ashurov <eashurov@redhat.com>
elizashurov
force-pushed
the
virtio-device-vectors-queues-cli
branch
from
August 5, 2026 12:33
c34c18a to
2c95d9c
Compare
There was a problem hiding this comment.
Pull request overview
Adds new CLI-configurable virtio tuning knobs to the QemuHCK setup manager so test runs can override virtio multi-queue settings and MSI-X vector counts via template placeholders in QEMU command lines.
Changes:
- Add
--virtio-queuesand--virtio-vectorsto CLI test options and pass them into QemuHCK VM option config. - Introduce a replacement-map builder in
QemuMachineto emitmq/num_queues/num-queues,vectors, and-netdev ... queues=parameters. - Update virtio device JSON templates (and tap netdev options) to consume the new placeholders.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/setupmanagers/qemuhck/qemuhck.rb | Plumbs virtio_vectors / virtio_queues from CLI test options into VM options. |
| lib/setupmanagers/qemuhck/qemu_machine.rb | Adds replacement-map entries for virtio queues/vectors and includes them in full_replacement_map. |
| lib/setupmanagers/qemuhck/network_manager.rb | Extends tap -netdev options to include multi-queue queues= placeholder when enabled. |
| lib/setupmanagers/qemuhck/devices/virtio-vga.json | Adds vectors placeholder to virtio-vga device args. |
| lib/setupmanagers/qemuhck/devices/virtio-serial-pci.json | Adds vectors placeholder to virtio-serial-pci device args. |
| lib/setupmanagers/qemuhck/devices/virtio-scsi-pci.json | Adds queues/vectors placeholders to virtio-scsi-pci device args. |
| lib/setupmanagers/qemuhck/devices/virtio-rng-pci.json | Adds vectors placeholder to virtio-rng-pci device args. |
| lib/setupmanagers/qemuhck/devices/virtio-net-pci.json | Adds MQ/vectors placeholders to virtio-net-pci device args. |
| lib/setupmanagers/qemuhck/devices/virtio-mem-pci.json | Adds vectors placeholder to virtio-mem-pci device args. |
| lib/setupmanagers/qemuhck/devices/virtio-keyboard-pci.json | Adds vectors placeholder to virtio-keyboard-pci device args. |
| lib/setupmanagers/qemuhck/devices/virtio-blk-pci.json | Adds queues/vectors placeholders to virtio-blk-pci device args. |
| lib/setupmanagers/qemuhck/devices/virtio-balloon-pci.json | Adds vectors placeholder to virtio-balloon-pci device args. |
| lib/cli.rb | Defines new CLI flags and option storage for virtio_vectors / virtio_queues. |
Suppressed comments (1)
lib/setupmanagers/qemuhck/qemu_machine.rb:474
- --virtio-queues accepts 0/negative values, but those values will still be interpolated into virtio-scsi/virtio-blk params (e.g. num_queues=0 or num-queues=-1), producing invalid QEMU device options. Add validation to reject queues < 1 before building the replacement map.
'@virtio_vectors_param@' => vectors ? ",vectors=#{vectors}" : '',
'@virtio_net_queues_param@' => net_mq_queues_param(queues),
'@virtio_scsi_queues_param@' => queues ? ",num_queues=#{queues}" : '',
'@virtio_blk_queues_param@' => queues ? ",num-queues=#{queues}" : '',
'@netdev_mq_param@' => netdev_mq_queues_param(queues)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
kostyanf14
reviewed
Aug 5, 2026
kostyanf14
approved these changes
Aug 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Allow setting virtqueues and MSI-X vectors on the virtio device under
test via CLI. Queues map to mq=on/num_queues=/num-queues= per device
type; vectors override QEMU's auto-assignment on any virtio-pci device.