1
0
mirror of https://github.com/lxc/incus.git synced 2026-02-05 09:46:19 +01:00

incusd/instances: Support last-state value for boot.autostart

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
This commit is contained in:
Stéphane Graber
2025-12-26 13:51:56 -05:00
parent 8d6d705ee4
commit eee18e103e

View File

@@ -204,7 +204,7 @@ func instanceShouldAutoStart(inst instance.Instance) bool {
autoStart := config["boot.autostart"]
lastState := config["volatile.last_state.power"]
return util.IsTrue(autoStart) || (autoStart == "" && lastState == instance.PowerStateRunning)
return util.IsTrue(autoStart) || ((autoStart == "" || autoStart == "last-state") && lastState == instance.PowerStateRunning)
}
func instancesStart(s *state.State, instances []instance.Instance) {