Skip to content

Commit

Permalink
nixos-modules/host: add option microvm.virtiofsd.inodeFileHandles
Browse files Browse the repository at this point in the history
  • Loading branch information
astro committed Apr 25, 2024
1 parent efac82e commit ac28e21
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
3 changes: 3 additions & 0 deletions nixos-modules/host/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,9 @@ in
--rlimit-nofile ${toString serviceConfig.LimitNOFILE} \
--thread-pool-size `nproc` \
--posix-acl --xattr \
${lib.optionalString (config.microvm.virtiofsd.inodeFileHandles != null)
"--inode-file-handles=${config.microvm.virtiofsd.inodeFileHandles}"
} \
&
# detach from shell, but remain in systemd cgroup
disown
Expand Down
15 changes: 15 additions & 0 deletions nixos-modules/host/options.nix
Original file line number Diff line number Diff line change
Expand Up @@ -137,5 +137,20 @@
This includes declarative `config.microvm.vms` as well as MicroVMs that are managed through the `microvm` command.
'';
};

virtiofsd.inodeFileHandles = mkOption {
type = with types; nullOr (enum [
"never" "prefer" "mandatory"
]);
default = null;
description = ''
When to use file handles to reference inodes instead of O_PATH file descriptors
(never, prefer, mandatory)
Allows you to overwrite default behavior in case you hit "too
many open files" on eg. ZFS.
<https://gitlab.com/virtio-fs/virtiofsd/-/issues/121>
'';
};
};
}

0 comments on commit ac28e21

Please sign in to comment.