Skip to content

qemu: Add --allow-mmap to virtiofsd for mmap support#201

Merged
cgwalters merged 1 commit intomainfrom
allow-mmap
Feb 2, 2026
Merged

qemu: Add --allow-mmap to virtiofsd for mmap support#201
cgwalters merged 1 commit intomainfrom
allow-mmap

Conversation

@cgwalters
Copy link
Collaborator

The --cache=never flag (added in 50e7601 to avoid FD exhaustion) has a side effect: the guest kernel returns ENODEV for mmap() syscalls on virtiofs files. This breaks nontrivial use cases; while glibc has a fallback for failure to mmap() other tools don't.

Assisted-by: OpenCode (claude-sonnet-4-20250514)

The --cache=never flag (added in 50e7601 to avoid FD exhaustion) has
a side effect: the guest kernel returns ENODEV for mmap() syscalls on
virtiofs files. This breaks nontrivial use cases; while glibc has
a fallback for failure to `mmap()` other tools don't.

Assisted-by: OpenCode (claude-sonnet-4-20250514)
Signed-off-by: Colin Walters <walters@verbum.org>
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 adds the --allow-mmap flag to the virtiofsd command to re-enable mmap() support, which was broken by a previous change that introduced --cache=never. This is a necessary fix for supporting dynamically linked executables and other applications that rely on mmap. The change is accompanied by a new integration test that correctly verifies the fix. The implementation is sound. I have one suggestion to improve the Python script in the new test for better resource management.

@cgwalters cgwalters enabled auto-merge (rebase) February 2, 2026 18:49
Copy link
Collaborator

@gursewak1997 gursewak1997 left a comment

Choose a reason for hiding this comment

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

lgtm

@cgwalters cgwalters merged commit 3e2601c into main Feb 2, 2026
12 checks passed
@gursewak1997 gursewak1997 deleted the allow-mmap branch February 2, 2026 21:03
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