Skip to content

Conversation

@kostyanf14
Copy link
Contributor

Works for virtio-net-pci only.

Works for virtio-net-pci only.

Signed-off-by: Kostiantyn Kostiuk <kkostiuk@redhat.com>
Copilot AI review requested due to automatic review settings January 26, 2026 18:20
@gemini-code-assist
Copy link

Summary of Changes

Hello @kostyanf14, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a new capability to control the network speed of virtio-net-pci devices within the testing framework. By adding a dedicated command-line option, users can now precisely define the network bandwidth for their virtualized test environments. This enhancement provides greater flexibility for performance testing and ensures that network-dependent test scenarios can be executed with specific speed configurations, improving the accuracy and relevance of test results.

Highlights

  • New CLI Option: A new command-line option, --net-test-speed, has been introduced to allow users to specify the network device speed in Mbps for testing purposes.
  • Virtio-net-pci Configuration: The virtio-net-pci device configuration in QEMU now supports a speed parameter, enabling dynamic adjustment of network interface speed.
  • Network Speed Management: The NetworkManager has been updated to parse and apply the --net-test-speed option specifically to the network device under test, defaulting to 10000 Mbps (10 Gbps) if not specified.
  • Option Propagation: The net_test_speed option is now correctly propagated through the QEMU machine setup to ensure it is applied during virtual machine creation.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces the capability to specify the network speed for the virtio-net-pci device under test via a new --net-test-speed command-line option. The changes are well-integrated, flowing from the CLI parsing down to the QEMU machine configuration. The implementation is logical and follows the existing patterns in the codebase. I have one minor suggestion to improve type consistency.

include Helper

CONFIG_JSON = 'lib/setupmanagers/qemuhck/network_manager.json'
DEFAULT_NET_SPEED = '10000' # 10G

Choose a reason for hiding this comment

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

medium

For consistency with the --net-test-speed command-line option which is parsed as an Integer, it's better to define DEFAULT_NET_SPEED as an integer as well. This will ensure that the @net_test_speed instance variable always holds a value of the same type, improving code clarity and maintainability.

      DEFAULT_NET_SPEED = 10000 # 10G

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds the ability to configure the network device speed for virtio-net-pci devices under test through a new CLI option --net-test-speed. The feature allows users to specify custom network speeds in Mbps, defaulting to 10000 Mbps (10 Gbps).

Changes:

  • Added --net-test-speed CLI option to specify network test speed in Mbps
  • Updated network manager to apply configurable speed to test devices and default speed to other network device types
  • Modified virtio-net-pci device configuration to include the speed parameter in QEMU command line

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
lib/cli.rb Added new --net-test-speed CLI option with Integer type, default 10000 Mbps
lib/setupmanagers/qemuhck/qemuhck.rb Passes net_test_speed from test options to client VM options; refactored to use test_opt variable for consistency
lib/setupmanagers/qemuhck/qemu_machine.rb Updated NetworkManager initialization to pass options parameter
lib/setupmanagers/qemuhck/network_manager.rb Added DEFAULT_NET_SPEED constant, retrieves net_test_speed from options, applies custom speed to test devices and default to others
lib/setupmanagers/qemuhck/devices/virtio-net-pci.json Added speed parameter to virtio-net-pci device command line

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@logger = logger
@dev_id = 0

@net_test_speed = qemu_options['net_test_speed'] || DEFAULT_NET_SPEED
Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

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

Type inconsistency: qemu_options['net_test_speed'] is an Integer (from CLI parsing), but DEFAULT_NET_SPEED is a String. While this works because ReplacementMap converts values to strings, it's better to ensure consistent types. Consider converting the option value to a string explicitly with .to_s.

Suggested change
@net_test_speed = qemu_options['net_test_speed'] || DEFAULT_NET_SPEED
@net_test_speed = (qemu_options['net_test_speed'] || DEFAULT_NET_SPEED).to_s

Copilot uses AI. Check for mistakes.
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.

1 participant