Skip to content

virtiofs: Fix writable virtiofs mounts#75

Merged
cgwalters merged 1 commit into
bootc-dev:mainfrom
cgwalters:virtiofs-writable
Oct 20, 2025
Merged

virtiofs: Fix writable virtiofs mounts#75
cgwalters merged 1 commit into
bootc-dev:mainfrom
cgwalters:virtiofs-writable

Conversation

@cgwalters
Copy link
Copy Markdown
Collaborator

Regression from previous commit; we unconditionally added --readonly if virtiofsd supported it (which it doesn't yet in the Ubuntu 24.04 but does in Fedora 42+).

We want to support writable mounts.

It turns out the integration tests didn't catch this because they only looked at the permission bits.

Regression from previous commit; we unconditionally added
`--readonly` if virtiofsd supported it (which it doesn't yet
in the Ubuntu 24.04 but does in Fedora 42+).

We want to support writable mounts.

It turns out the integration tests didn't catch this because
they only looked at the permission bits.

Signed-off-by: Colin Walters <walters@verbum.org>
@gemini-code-assist
Copy link
Copy Markdown

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 addresses a critical regression that inadvertently made virtiofs mounts read-only in certain scenarios, hindering expected functionality. The core change involves introducing explicit control over the read-only behavior of virtiofs mounts through a new configuration flag. This ensures that mounts are writable by default unless specifically configured otherwise. Accompanying this fix are updated integration tests that now thoroughly validate both read-only and writable mount operations, providing robust coverage against similar issues.

Highlights

  • Fix Writable Virtiofs Mounts: Resolved a regression that caused virtiofs mounts to be unconditionally read-only if the virtiofsd daemon supported the --readonly flag, even when writable mounts were intended.
  • Explicit Read-Only Control: Introduced a readonly flag in VirtiofsConfig to explicitly control whether a virtiofs mount should be read-only, ensuring the --readonly argument is only passed to virtiofsd when requested.
  • Enhanced Integration Tests: Refactored integration tests to accurately verify both read-only and writable virtiofs mount behavior, preventing future regressions related to mount permissions.
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
Copy Markdown

@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 fixes a regression that caused all virtiofs mounts to be read-only, even when they were intended to be writable. The core fix correctly adds the --readonly flag to virtiofsd only when a read-only mount is explicitly requested.

I appreciate the accompanying changes to the integration tests. Merging the two test helper functions into one and, more importantly, changing the tests to verify writability by actually attempting to write a file is a great improvement that will prevent similar regressions in the future.

I have one suggestion in the test code to improve robustness against special characters, but overall the changes are excellent and directly address the issue. Well done.

Comment thread crates/integration-tests/src/tests/mount_feature.rs
@cgwalters cgwalters enabled auto-merge (rebase) October 17, 2025 17:53
@cgwalters cgwalters merged commit 1bb845b into bootc-dev:main Oct 20, 2025
2 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