File tree Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change 17
17
'' ;
18
18
} ;
19
19
20
+ host . useNotifySockets = mkOption {
21
+ type = types . bool ;
22
+ default = false ;
23
+ description = ''
24
+ Enable if all your MicroVMs run with a Hypervisor that sends readiness notification over a VSOCK.
25
+
26
+ If one of your MicroVMs doesn't do this, its systemd service
27
+ will not start up successfully.
28
+ '' ;
29
+ } ;
30
+
20
31
vms = mkOption {
21
32
type = with types ; attrsOf ( submodule ( { config , name , ... } : {
22
33
options = {
235
246
# we also have to include a trigger here.
236
247
restartTriggers = [ guestConfig . system . build . toplevel ] ;
237
248
overrideStrategy = "asDropin" ;
238
- serviceConfig . Type = lib . mkIf guestConfig . microvm . declaredRunner . supportsNotifySocket "notify" ;
249
+ serviceConfig . Type =
250
+ if guestConfig . microvm . declaredRunner . supportsNotifySocket
251
+ then "notify"
252
+ else "simple" ;
239
253
} ;
240
254
"microvm-tap-interfaces@${ name } " = {
241
255
serviceConfig . X-RestartIfChanged = [ "" microvmConfig . restartIfChanged ] ;
436
450
rm booted
437
451
'' ;
438
452
serviceConfig = {
439
- Type = "simple" ;
453
+ Type =
454
+ if config . microvm . host . useNotifySockets
455
+ then "notify"
456
+ else "simple" ;
440
457
WorkingDirectory = "${ stateDir } /%i" ;
441
458
ExecStart = "${ stateDir } /%i/current/bin/microvm-run" ;
442
459
ExecStop = "${ stateDir } /%i/booted/bin/microvm-shutdown" ;
You can’t perform that action at this time.
0 commit comments