TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/stratosphere-ve/ozone/llms.txt
Use this file to discover all available pages before exploring further.
qemu package provides the runtime lifecycle interface for Ozone-managed virtual machines. It wraps qemu-system-x86_64 invocations and process control behind two simple Go functions — Start and Stop — so that callers never need to construct raw command strings or manage process handles directly.
qemu.Start()
Start launches an interactive prompt asking for the name of the VM to start, then reads the corresponding configuration from vms/<vmname>.json via vmparser.VMParser. If the config file cannot be read, the function prints an error message and returns early.
On success, it prints the loaded VM info struct to stdout and spawns a qemu-system-x86_64 subprocess with the following fixed command-line flags:
| Flag | Value | Purpose |
|---|---|---|
-machine | q35 | Selects the Q35 chipset (PCIe, IOMMU-capable) |
-m | (empty string) | Guest memory argument — sourced from the package-level memsize variable, which is initialized to "" |
-smp | 4 | Configures 4 symmetric multi-processing vCPUs |
-drive | file=myvm.qcow2,format=qcow2 | Attaches the primary qcow2 disk image |
-cdrom | debian.iso | Attaches a Debian installer ISO as a virtual CD-ROM |
-boot | d | Sets boot order to CD-ROM first |
-qmp | tcp:127.0.0.1:4444,server,nowait | Opens a QMP control socket on localhost port 4444 |
Start has no return value.
The package-level variable
memsize is declared as var memsize string = "" and is not read from any configuration file. As a result, the -m flag is passed with an empty string value in the current implementation.qemu.Stop()
Stop prints "stopping qemu" to stdout and then runs system_powerdown as a local subprocess via exec.Command. Any output from the process is captured and printed to stdout. If the command exits with a non-zero status, the error is printed to stdout. Stop has no return value.