Go to file
Manohar Castelino 1ed52714c0 qmp: wait for POWERDOWN event in ExecuteSystemPowerdown()
ExecuteSystemPowerdown issues `system_powerdown` and waits
for `SHUTDOWN`. The event emitted is `POWERDOWN` per spec.

Without this we get an error even though the VM has shutdown
gracefully.

Per QEMU spec:

```

POWERDOWN (Event)

Emitted when the virtual machine is powered down through the power
control system, such as via ACPI.

Since

0.12

Example

<- { "event": "POWERDOWN",
     "timestamp": { "seconds": 1267040730, "microseconds": 682951 } }

SHUTDOWN (Event)

Emitted when the virtual machine has shut down, indicating that qemu is
about to exit.

Arguments

guest: boolean
If true, the shutdown was triggered by a guest request (such as a
guest-initiated ACPI shutdown request or other hardware-specific action)
rather than a host request (such as sending qemu a SIGINT). (since 2.10)
reason: ShutdownCause
The ShutdownCause which resulted in the SHUTDOWN. (since 4.0)
Note

If the command-line option “-no-shutdown” has been specified, qemu will
not exit, and a STOP event will eventually follow the SHUTDOWN event

Since

0.12

Example

<- { "event": "SHUTDOWN", "data": { "guest": true },
     "timestamp": { "seconds": 1267040730, "microseconds": 682951 } }

```

Signed-off-by: Manohar Castelino <mcastelino@apple.com>
2021-09-16 13:01:58 -07:00
.github/workflows .github/workflows: reimplement github actions CI 2021-07-21 15:08:07 -05:00
qemu qmp: wait for POWERDOWN event in ExecuteSystemPowerdown() 2021-09-16 13:01:58 -07:00
.gitignore Add .gitignore file. 2017-12-11 11:05:31 +00:00
.golangci.yml .github/workflows: reimplement github actions CI 2021-07-21 15:08:07 -05:00
.travis.yml misc: Update for new GitHub organisation name 2020-10-09 09:10:10 +01:00
CONTRIBUTING.md misc: Update for new GitHub organisation name 2020-10-09 09:10:10 +01:00
COPYING Add project documentation 2017-12-11 11:05:31 +00:00
go.mod go: support go modules 2021-07-21 11:38:07 -05:00
README.md qemu: Drop support for versions older than 5.0 2021-08-04 13:42:41 +10:00

Virtual Machine Manager for Go

Go Report Card Build Status GoDoc Coverage Status

Virtual Machine Manager for Go (govmm) is a suite of packages that provide Go APIs for creating and managing virtual machines. There's currently support for only one hypervisor, qemu/kvm (version 5.0 and later), support for which is provided by the github.com/kata-containers/govmm/qemu package.

The qemu package provides APIs for launching qemu instances and for managing those instances via QMP, once launched. VM instances can be stopped, have devices attached to them and monitored for events via the qemu APIs.

The qemu package has no external dependencies apart from the Go standard library and so is nice and easy to vendor inside other projects.