Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos/libvirtd: add ${cfg.qemu.package}/libexec to PATH #153007

Closed
wants to merge 1 commit into from

Conversation

ckiee
Copy link
Member

@ckiee ckiee commented Dec 31, 2021

Fixes #113172. This is needed to get libvirt to find the virtiofsd
binary through PATH, working around systemPackages only adding things in
/bin to PATH.

Example usage in libvirtd domain configuration
<filesystem type="mount" accessmode="passthrough">
  <driver type="virtiofs"/>
  <binary path="/run/current-system/sw/bin/virtiofsd" xattr="on"/>
  <source dir="/mnt/chonk"/>
  <target dir="data"/>
  <alias name="fs0"/>
  <address type="pci" domain="0x0000" bus="0x05" slot="0x00" function="0x0"/>
</filesystem>
Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary filesI just checked virtiofsd was added to PATH . It was.
  • 22.05 Release Notes (or backporting 21.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

Fixes NixOS#113172. This is needed to get libvirt to find the virtiofsd
binary through PATH, working around systemPackages only adding things in
/bin to PATH.
@ckiee ckiee mentioned this pull request Feb 18, 2022
13 tasks
alyssais added a commit to alyssais/nixpkgs that referenced this pull request Mar 3, 2022
According to the QEMU documentation, virtiofsd is supposed to be run
directly by users.  It therefore makes sense to have it in bin/, so it
will be in PATH.  Such a change wouldn't make sense upstream, because
it would then conflict with the virtiofsd package, which is generally
preferred if available.  But in Nixpkgs, we don't have to worry about
that and can just make QEMU's virtiofsd a lower priority than the one
from the dedicated package.

[1]: https://qemu.readthedocs.io/en/latest/tools/virtiofsd.html

Fixes: NixOS#113172 ("QEmu: virtiofsd prone to be garbage collected.")
Fixes: NixOS#153007 ("nixos/libvirtd: add ${cfg.qemu.package}/libexec to PATH")
@alyssais alyssais mentioned this pull request Mar 3, 2022
13 tasks
@alyssais
Copy link
Member

alyssais commented Mar 3, 2022

Hi, sorry it's taken me so long to get to this. I've opened #162635, which I think is a better solution as it's not libvirt-specific, and I would appreciate your review.

alyssais added a commit that referenced this pull request Mar 4, 2022
According to the QEMU documentation, virtiofsd is supposed to be run
directly by users.  It therefore makes sense to have it in bin/, so it
will be in PATH.  Such a change wouldn't make sense upstream, because
it would then conflict with the virtiofsd package, which is generally
preferred if available.  But in Nixpkgs, we don't have to worry about
that and can just make QEMU's virtiofsd a lower priority than the one
from the dedicated package.

[1]: https://qemu.readthedocs.io/en/latest/tools/virtiofsd.html

Fixes: #113172 ("QEmu: virtiofsd prone to be garbage collected.")
Fixes: #153007 ("nixos/libvirtd: add ${cfg.qemu.package}/libexec to PATH")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

QEmu: virtiofsd prone to be garbage collected.
2 participants