Skip to content

Commit 2354c6e

Browse files
committed
doc: Add high-level doc for the config and vf packages
1 parent ffa7446 commit 2354c6e

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

pkg/config/config.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
// Package config provides native go data types to describe a VM configuration
2+
// (memory, CPUs, bootloader, devices, ...).
3+
// It's used by vfkit which generates a VirtualMachine instance after parsing
4+
// its command line using FromOptions().
5+
// It can also be used by application writers who want to start a VM with
6+
// vfkit. After creating a VirtualMachine instance with the needed devices,
7+
// calling VirtualMachine.Cmd() will return an exec.Cmd which can be used
8+
// to start the virtual machine.
9+
//
10+
// This package does not use Code-Hex/vz directly as it must possible to
11+
// cross-compile code using it.
112
package config
213

314
import (

pkg/vf/virtio.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ import (
1313
"golang.org/x/sys/unix"
1414
)
1515

16+
// vf will define toVZ() and AddToVirtualMachineConfig() methods on these types
17+
// We alias the types from the config package to avoid duplicating struct
18+
// definitions between the config and vf packages
1619
type RosettaShare config.RosettaShare
1720
type NVMExpressController config.NVMExpressController
1821
type VirtioBlk config.VirtioBlk

pkg/vf/vm.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
// Package vf converts a config.VirtualMachine configuration to native
2+
// virtualization framework datatypes. It also provides APIs to start/stop/...
3+
// the virtualization framework virtual machine.
4+
//
5+
// The interaction with the virtualization framework is done using the
6+
// Code-Hex/vz Objective-C bindings. This requires cgo, and this package cannot
7+
// be easily cross-compiled, it must be built on macOS.
18
package vf
29

310
import (

0 commit comments

Comments
 (0)