Skip to content

Commit 7f92389

Browse files
rmgarayastro
authored andcommitted
add securityModel option to 9P shares
1 parent c99107b commit 7f92389

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

lib/runners/qemu.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,13 +195,13 @@ in {
195195
"-object" "memory-backend-memfd,id=mem,size=${toString (mem + balloonMem)}M,share=on"
196196
"-numa" "node,memdev=mem"
197197
] ++
198-
builtins.concatMap ({ proto, index, socket, source, tag, ... }: {
198+
builtins.concatMap ({ proto, index, socket, source, tag, securityModel, ... }: {
199199
"virtiofs" = [
200200
"-chardev" "socket,id=fs${toString index},path=${socket}"
201201
"-device" "vhost-user-fs-${devType},chardev=fs${toString index},tag=${tag}"
202202
];
203203
"9p" = [
204-
"-fsdev" "local,id=fs${toString index},path=${source},security_model=mapped"
204+
"-fsdev" "local,id=fs${toString index},path=${source},security_model=${securityModel}"
205205
"-device" "virtio-9p-${devType},fsdev=fs${toString index},mount_tag=${tag}"
206206
];
207207
}.${proto}) (enumerate 0 shares)

nixos-modules/microvm/options.nix

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,11 @@ in
276276
type = nonEmptyStr;
277277
description = "Path to shared directory tree";
278278
};
279+
securityModel = mkOption {
280+
type = nullOr str;
281+
default = "none";
282+
description = "What security model to use for the shared. Default: none.";
283+
};
279284
mountPoint = mkOption {
280285
type = path;
281286
description = "Where to mount the share inside the container";

0 commit comments

Comments
 (0)