incusd/instance: Add boot.autorestart

Closes #1096

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
This commit is contained in:
Stéphane Graber 2024-08-30 13:17:11 -04:00
parent 5f46ec93e3
commit a97b38c60e
No known key found for this signature in database
GPG Key ID: C638974D64792D67

View File

@ -29,6 +29,14 @@ var HugePageSizeSuffix = [...]string{"64KB", "1MB", "2MB", "1GB"}
// InstanceConfigKeysAny is a map of config key to validator. (keys applying to containers AND virtual machines).
var InstanceConfigKeysAny = map[string]func(value string) error{
// gendoc:generate(entity=instance, group=boot, key=boot.autorestart)
// If set to `true` will attempt up to 10 restarts over a 1 minute period upon unexpected instance exit.
// ---
// type: bool
// liveupdate: no
// shortdesc: Whether to automatically restart an instance on unexpected exit
"boot.autorestart": validate.Optional(validate.IsBool),
// gendoc:generate(entity=instance, group=boot, key=boot.autostart)
// If set to `false`, restore the last state.
// ---