Skip to content

libvirt: add --bind-storage-ro support for bootc upgrades#16

Closed
cgwalters wants to merge 1 commit intomainfrom
libvirt-bind-storage-ro
Closed

libvirt: add --bind-storage-ro support for bootc upgrades#16
cgwalters wants to merge 1 commit intomainfrom
libvirt-bind-storage-ro

Conversation

@cgwalters
Copy link
Collaborator

@cgwalters cgwalters commented Sep 22, 2025

Implement --bind-storage-ro flag for bcvk libvirt run to enable bootc upgrade workflows from persistent VMs by mounting host container storage read-only.

Assisted-by: Claude Code

Closes: #8

@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 enhances the bcvk libvirt run command by adding a --bind-storage-ro flag, which allows users to securely mount the host system's container storage into a virtual machine as a read-only virtiofs filesystem. This capability is essential for enabling seamless bootc upgrade operations within persistent VMs, ensuring that the VM can access required container images without compromising the host's storage integrity.

Highlights

  • New --bind-storage-ro flag: Introduced a new --bind-storage-ro flag for the bcvk libvirt run command, enabling read-only mounting of host container storage into virtual machines.
  • Enables bootc upgrade workflows: This feature is designed to facilitate bootc upgrade workflows from persistent VMs by providing necessary read-only access to host container images.
  • Virtiofs integration: Implemented VirtiofsFilesystem struct and DomainBuilder methods to generate appropriate libvirt XML configurations for virtiofs mounts, including shared memory backing and read-only attributes.
  • Comprehensive integration testing: A new end-to-end integration test (test_libvirt_bind_storage_ro) has been added to verify the functionality, covering VM creation, XML validation, SSH access, and enforcement of the read-only mount.
  • Documentation updates: The libvirt-run documentation and its man page have been updated to reflect the new flag, its usage, and the benefits of container storage integration.
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

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 mounting host container storage as read-only within libvirt VMs, a valuable feature for bootc upgrade workflows. The implementation is well-structured, encompassing a new CLI flag, modifications to the libvirt domain XML generation, and the addition of a comprehensive integration test. My review has identified a few areas for improvement, including a bug in the new integration test, a misleading error message, and several opportunities to enhance code maintainability and performance. The accompanying documentation updates are clear and effectively explain the new functionality.

@cgwalters cgwalters force-pushed the libvirt-bind-storage-ro branch from 334380e to 165323d Compare September 22, 2025 21:18
@cgwalters
Copy link
Collaborator Author

      error: unsupported configuration: virtiofs does not yet support read-only mode

Ah yes, old libvirt on this Ubuntu version. Well, good job CI at least.

@cgwalters cgwalters force-pushed the libvirt-bind-storage-ro branch from 165323d to af27e21 Compare September 23, 2025 00:35
Implement --bind-storage-ro flag for `bcvk libvirt run` to enable
bootc upgrade workflows from persistent VMs by mounting host container
storage read-only.

Assisted-by: Claude Code
Signed-off-by: Colin Walters <walters@verbum.org>
@cgwalters cgwalters force-pushed the libvirt-bind-storage-ro branch from af27e21 to ce3c9ff Compare September 23, 2025 00:35
@cgwalters cgwalters enabled auto-merge (rebase) September 23, 2025 01:18
@cgwalters cgwalters requested a review from jmarrero September 24, 2025 12:16
@cgwalters
Copy link
Collaborator Author

Closing in favor of #20 which comes from my fork

@cgwalters cgwalters closed this Sep 24, 2025
auto-merge was automatically disabled September 24, 2025 14:21

Pull request was closed

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.

Add libvirt run --bind-storage-ro

1 participant