mirror of
https://github.com/siderolabs/talos.git
synced 2026-05-05 04:16:21 +02:00
The QEMU VM launcher's /poweroff HTTP endpoint now accepts an optional grace-period query parameter (Go duration format, e.g. "5m"). When set, it sends an ACPI power button event via the QEMU monitor socket instead of immediately killing the process, allowing the guest OS to shut down cleanly. If the guest does not shut down within the grace period, the process is force-killed as a fallback. Without the parameter, the behavior is unchanged (immediate kill). Signed-off-by: Utku Ozdemir <utku.ozdemir@siderolabs.com>
23 lines
572 B
Go
23 lines
572 B
Go
// This Source Code Form is subject to the terms of the Mozilla Public
|
|
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
package vm
|
|
|
|
import "time"
|
|
|
|
// Controller interface should be implemented by the VM to be controlled via the API.
|
|
type Controller interface {
|
|
PowerOn() error
|
|
PowerOff() error
|
|
PowerOffWithGracePeriod(gracePeriod time.Duration) error
|
|
Reboot() error
|
|
PXEBootOnce() error
|
|
Status() Status
|
|
}
|
|
|
|
// Status describes current VM status.
|
|
type Status struct {
|
|
PoweredOn bool
|
|
}
|