qemu: put virtiofsd in bin/

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: https://github.com/NixOS/nixpkgs/issues/113172 ("QEmu: virtiofsd prone to be garbage collected.")
Fixes: https://github.com/NixOS/nixpkgs/pull/153007 ("nixos/libvirtd: add ${cfg.qemu.package}/libexec to PATH")
main
Alyssa Ross 2 years ago
parent 26f7da7478
commit c738e61a94
  1. 2
      pkgs/applications/virtualization/qemu/default.nix

@ -220,6 +220,7 @@ stdenv.mkDerivation rec {
# Add a ‘qemu-kvm’ wrapper for compatibility/convenience.
postInstall = ''
ln -s $out/libexec/virtiofsd $out/bin
ln -s $out/bin/qemu-system-${stdenv.hostPlatform.qemuArch} $out/bin/qemu-kvm
'';
@ -240,5 +241,6 @@ stdenv.mkDerivation rec {
mainProgram = "qemu-kvm";
maintainers = with maintainers; [ eelco qyliss ];
platforms = platforms.unix;
priority = 10; # Prefer virtiofsd from the virtiofsd package.
};
}

Loading…
Cancel
Save