Overview
Add VM.HwConfig Support
Implement hardware configuration support for VM-based runtimes:
- Add
HWConfig struct (including device_tree, vcpus, memory, etc.)
- Add
IOMems struct
Runtime Spec Reference
Implemented in runtime-spec as follows:
Found in https://github.com/opencontainers/runtime-spec/blob/main/specs-go/config.go:
HWConfig
// Hardware configuration for the VM image
type HWConfig struct {
// Path to the container device-tree file that should be passed to the VM configuration.
DeviceTree string `json:"deviceTree,omitempty"`
// Number of virtual cpus for the VM.
VCPUs *uint32 `json:"vcpus,omitempty"`
// Maximum memory in bytes allocated to the VM.
Memory *uint64 `json:"memory,omitempty"`
// Host device tree nodes to passthrough to the VM.
DtDevs []string `json:"dtdevs,omitempty"`
// Allow auto-translated domains to access specific hardware I/O memory pages.
IOMems []IOMems `json:"iomems,omitempty"`
// Allows VM to access specific physical IRQs.
Irqs []uint32 `json:"irqs,omitempty"`
}
IOMems
// IOMems contains information about iomem addresses that should be passed to the VM.
type IOMems struct {
// Guest Frame Number to map the iomem range. If GFN is not specified, the mapping will be done to the same Frame Number as was provided in FirstMFN.
FirstGFN *uint64 `json:"firstGFN,omitempty"`
// Physical page number of iomem regions.
FirstMFN *uint64 `json:"firstMFN"`
// Number of pages to be mapped.
NrMFNs *uint64 `json:"nrMFNs"`
}
Related to #309
Overview
Add
VM.HwConfigSupportImplement hardware configuration support for VM-based runtimes:
HWConfigstruct (includingdevice_tree,vcpus,memory, etc.)IOMemsstructRuntime Spec Reference
Implemented in runtime-spec as follows:
Found in https://github.com/opencontainers/runtime-spec/blob/main/specs-go/config.go:
HWConfig
IOMems
Related to #309