Skip to content

Conversation

@cgwalters
Copy link
Collaborator

The use case here is ephemeral VMs for CI tests; we don't want to leak them across host updates and it's more efficient to not create persistent disks for them.

@cgwalters cgwalters enabled auto-merge (rebase) October 17, 2025 18:52
@gemini-code-assist
Copy link

Summary of Changes

Hello @cgwalters, 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 significant enhancement to the libvirt run command by adding support for --transient virtual machines. This feature allows users to provision short-lived, non-persistent VMs, which are particularly useful for automated testing environments like CI pipelines. By leveraging temporary disk overlays and virsh create for transient domains, the system efficiently manages these ephemeral instances, ensuring they are automatically cleaned up upon shutdown without leaving behind persistent state.

Highlights

  • Transient VM Support: Introduced a --transient flag to the libvirt run command, enabling the creation of ephemeral virtual machines.
  • Ephemeral VM Use Case: These transient VMs are designed for CI tests, avoiding persistent disk creation and ensuring they do not leak across host updates.
  • Integration Test: A new integration test, test_libvirt_transient_vm, has been added to validate the functionality of transient VMs, including verification of non-persistence and proper disk handling.
  • Libvirt Domain Configuration: The DomainBuilder now supports a transient_disk option, which adds a <transient/> element to the VM's XML definition for disk configuration.
  • Optimized Disk Handling: For transient VMs, the system now directly uses the base disk with a temporary overlay instead of cloning it, improving efficiency.
  • Dynamic VM Lifecycle Management: The libvirt run command differentiates between transient and persistent VMs, using virsh create for transient VMs (which are created and started in one step and disappear on shutdown) and the traditional virsh define followed by virsh start for persistent ones.
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 support for transient VMs in libvirt by adding a --transient flag. When used, it creates a non-persistent VM that is removed on shutdown, which is useful for ephemeral CI environments. The implementation correctly uses virsh create for transient domains and skips cloning the base disk, instead relying on libvirt's overlay capabilities. The changes are well-structured and include a comprehensive integration test.

My review includes a few suggestions to improve robustness and maintainability:

  • Refactoring duplicated error-handling logic for virsh commands into a helper.
  • Improving the new integration test by using a proper XML parser instead of string matching to make it less brittle.
  • Replacing a fixed sleep in the test with a more reliable polling mechanism to avoid flakiness.

The use case here is ephemeral VMs for CI tests; we don't
want to leak them across host updates and it's more efficient
to not create persistent disks for them.

Signed-off-by: Colin Walters <[email protected]>
@cgwalters cgwalters merged commit 346ac16 into bootc-dev:main Oct 20, 2025
4 checks passed
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.

2 participants