Skip to content

Commit ac28e21

Browse files
committed
nixos-modules/host: add option microvm.virtiofsd.inodeFileHandles
1 parent efac82e commit ac28e21

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

nixos-modules/host/default.nix

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,9 @@ in
283283
--rlimit-nofile ${toString serviceConfig.LimitNOFILE} \
284284
--thread-pool-size `nproc` \
285285
--posix-acl --xattr \
286+
${lib.optionalString (config.microvm.virtiofsd.inodeFileHandles != null)
287+
"--inode-file-handles=${config.microvm.virtiofsd.inodeFileHandles}"
288+
} \
286289
&
287290
# detach from shell, but remain in systemd cgroup
288291
disown

nixos-modules/host/options.nix

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,5 +137,20 @@
137137
This includes declarative `config.microvm.vms` as well as MicroVMs that are managed through the `microvm` command.
138138
'';
139139
};
140+
141+
virtiofsd.inodeFileHandles = mkOption {
142+
type = with types; nullOr (enum [
143+
"never" "prefer" "mandatory"
144+
]);
145+
default = null;
146+
description = ''
147+
When to use file handles to reference inodes instead of O_PATH file descriptors
148+
(never, prefer, mandatory)
149+
150+
Allows you to overwrite default behavior in case you hit "too
151+
many open files" on eg. ZFS.
152+
<https://gitlab.com/virtio-fs/virtiofsd/-/issues/121>
153+
'';
154+
};
140155
};
141156
}

0 commit comments

Comments
 (0)