Documentation
¶
Index ¶
- type BalloonConfig
- type Client
- func (c *Client) VmAddDevice(ctx context.Context, arg *VmAddDevice) (*PciDeviceInfo, error)
- func (c *Client) VmAddDisk(ctx context.Context, arg *DiskConfig) (*PciDeviceInfo, error)
- func (c *Client) VmAddFs(ctx context.Context, arg *FsConfig) (*PciDeviceInfo, error)
- func (c *Client) VmAddNet(ctx context.Context, arg *NetConfig) (*PciDeviceInfo, error)
- func (c *Client) VmAddPmem(ctx context.Context, arg *PmemConfig) (*PciDeviceInfo, error)
- func (c *Client) VmAddVdpa(ctx context.Context, arg *VdpaConfig) (*PciDeviceInfo, error)
- func (c *Client) VmAddVsock(ctx context.Context, arg *VsockConfig) (*PciDeviceInfo, error)
- func (c *Client) VmBoot(ctx context.Context) error
- func (c *Client) VmCounters(ctx context.Context) (*VmCounters, error)
- func (c *Client) VmCreate(ctx context.Context, arg *VmConfig) error
- func (c *Client) VmDelete(ctx context.Context) error
- func (c *Client) VmInfo(ctx context.Context) (*VmInfo, error)
- func (c *Client) VmPause(ctx context.Context) error
- func (c *Client) VmPowerButton(ctx context.Context) error
- func (c *Client) VmReboot(ctx context.Context) error
- func (c *Client) VmReceiveMigration(ctx context.Context, arg *ReceiveMigrationData) error
- func (c *Client) VmRemoveDevice(ctx context.Context, arg *VmRemoveDevice) error
- func (c *Client) VmResize(ctx context.Context, arg *VmResize) error
- func (c *Client) VmResizeZone(ctx context.Context, arg *VmResizeZone) error
- func (c *Client) VmRestore(ctx context.Context, arg *RestoreConfig) error
- func (c *Client) VmResume(ctx context.Context) error
- func (c *Client) VmSendMigration(ctx context.Context, arg *SendMigrationData) error
- func (c *Client) VmShutdown(ctx context.Context) error
- func (c *Client) VmSnapshot(ctx context.Context, arg *VmSnapshotConfig) error
- func (c *Client) VmmPing(ctx context.Context) (*VmmPingResponse, error)
- func (c *Client) VmmShutdown(ctx context.Context) error
- type CmdLineConfig
- type ConsoleConfig
- type CpuAffinity
- type CpuFeatures
- type CpuTopology
- type CpusConfig
- type DeviceConfig
- type DeviceNode
- type DiskConfig
- type FsConfig
- type InitramfsConfig
- type KernelConfig
- type MemoryConfig
- type MemoryZoneConfig
- type NetConfig
- type NumaConfig
- type NumaDistance
- type PciDeviceInfo
- type PlatformConfig
- type PmemConfig
- type RateLimiterConfig
- type ReceiveMigrationData
- type RestoreConfig
- type RngConfig
- type SendMigrationData
- type SgxEpcConfig
- type TdxConfig
- type TokenBucket
- type VdpaConfig
- type VmAddDevice
- type VmConfig
- type VmCounters
- type VmInfo
- type VmRemoveDevice
- type VmResize
- type VmResizeZone
- type VmSnapshotConfig
- type VmmPingResponse
- type VsockConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BalloonConfig ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) VmAddDevice ¶
func (c *Client) VmAddDevice(ctx context.Context, arg *VmAddDevice) (*PciDeviceInfo, error)
Add a new device to the VM
func (*Client) VmAddDisk ¶
func (c *Client) VmAddDisk(ctx context.Context, arg *DiskConfig) (*PciDeviceInfo, error)
Add a new disk to the VM
func (*Client) VmAddPmem ¶
func (c *Client) VmAddPmem(ctx context.Context, arg *PmemConfig) (*PciDeviceInfo, error)
Add a new pmem device to the VM
func (*Client) VmAddVdpa ¶
func (c *Client) VmAddVdpa(ctx context.Context, arg *VdpaConfig) (*PciDeviceInfo, error)
Add a new vDPA device to the VM
func (*Client) VmAddVsock ¶
func (c *Client) VmAddVsock(ctx context.Context, arg *VsockConfig) (*PciDeviceInfo, error)
Add a new vsock device to the VM
func (*Client) VmCounters ¶
func (c *Client) VmCounters(ctx context.Context) (*VmCounters, error)
Get counters from the VM
func (*Client) VmCreate ¶
Create the cloud-hypervisor Virtual Machine (VM) instance. The instance is not booted, only created.
func (*Client) VmInfo ¶
Returns general information about the cloud-hypervisor Virtual Machine (VM) instance.
func (*Client) VmPowerButton ¶
Trigger a power button in the VM
func (*Client) VmReceiveMigration ¶
func (c *Client) VmReceiveMigration(ctx context.Context, arg *ReceiveMigrationData) error
Receive a VM migration from URL
func (*Client) VmRemoveDevice ¶
func (c *Client) VmRemoveDevice(ctx context.Context, arg *VmRemoveDevice) error
Remove a device from the VM
func (*Client) VmResizeZone ¶
func (c *Client) VmResizeZone(ctx context.Context, arg *VmResizeZone) error
Resize a memory zone
func (*Client) VmRestore ¶
func (c *Client) VmRestore(ctx context.Context, arg *RestoreConfig) error
Restore a VM from a snapshot.
func (*Client) VmSendMigration ¶
func (c *Client) VmSendMigration(ctx context.Context, arg *SendMigrationData) error
Send a VM migration to URL
func (*Client) VmShutdown ¶
Shut the VM instance down.
func (*Client) VmSnapshot ¶
func (c *Client) VmSnapshot(ctx context.Context, arg *VmSnapshotConfig) error
Returns a VM snapshot.
type CmdLineConfig ¶
type CmdLineConfig struct {
Args string `json:"args"`
}
type ConsoleConfig ¶
type CpuAffinity ¶
type CpuFeatures ¶
type CpuFeatures struct {
Amx bool `json:"amx,omitempty"`
}
type CpuTopology ¶
type CpusConfig ¶
type CpusConfig struct {
Affinity []*CpuAffinity `json:"affinity,omitempty"`
BootVcpus int `json:"boot_vcpus"`
Features *CpuFeatures `json:"features,omitempty"`
MaxPhysBits int `json:"max_phys_bits,omitempty"`
MaxVcpus int `json:"max_vcpus"`
Topology *CpuTopology `json:"topology,omitempty"`
}
type DeviceConfig ¶
type DeviceNode ¶
type DiskConfig ¶
type DiskConfig struct {
Direct bool `json:"direct,omitempty"`
Id string `json:"id,omitempty"`
Iommu bool `json:"iommu,omitempty"`
NumQueues int `json:"num_queues,omitempty"`
Path string `json:"path"`
PciSegment int16 `json:"pci_segment,omitempty"`
PollQueue bool `json:"poll_queue,omitempty"`
QueueSize int `json:"queue_size,omitempty"`
RateLimiterConfig *RateLimiterConfig `json:"rate_limiter_config,omitempty"`
Readonly bool `json:"readonly,omitempty"`
VhostSocket string `json:"vhost_socket,omitempty"`
VhostUser bool `json:"vhost_user,omitempty"`
}
type InitramfsConfig ¶
type InitramfsConfig struct {
Path string `json:"path"`
}
type KernelConfig ¶
type KernelConfig struct {
Path string `json:"path"`
}
type MemoryConfig ¶
type MemoryConfig struct {
HotplugMethod string `json:"hotplug_method,omitempty"`
HotplugSize int64 `json:"hotplug_size,omitempty"`
HotpluggedSize int64 `json:"hotplugged_size,omitempty"`
HugepageSize int64 `json:"hugepage_size,omitempty"`
Hugepages bool `json:"hugepages,omitempty"`
Mergeable bool `json:"mergeable,omitempty"`
Prefault bool `json:"prefault,omitempty"`
Size int64 `json:"size"`
Zones []*MemoryZoneConfig `json:"zones,omitempty"`
}
type MemoryZoneConfig ¶
type MemoryZoneConfig struct {
File string `json:"file,omitempty"`
HostNumaNode int `json:"host_numa_node,omitempty"`
HotplugSize int64 `json:"hotplug_size,omitempty"`
HotpluggedSize int64 `json:"hotplugged_size,omitempty"`
HugepageSize int64 `json:"hugepage_size,omitempty"`
Hugepages bool `json:"hugepages,omitempty"`
Id string `json:"id"`
Mergeable bool `json:"mergeable,omitempty"`
Prefault bool `json:"prefault,omitempty"`
Size int64 `json:"size"`
}
type NetConfig ¶
type NetConfig struct {
Id string `json:"id,omitempty"`
Iommu bool `json:"iommu,omitempty"`
Ip string `json:"ip,omitempty"`
Mac string `json:"mac,omitempty"`
Mask string `json:"mask,omitempty"`
NumQueues int `json:"num_queues,omitempty"`
PciSegment int16 `json:"pci_segment,omitempty"`
QueueSize int `json:"queue_size,omitempty"`
RateLimiterConfig *RateLimiterConfig `json:"rate_limiter_config,omitempty"`
Tap string `json:"tap,omitempty"`
VhostMode string `json:"vhost_mode,omitempty"`
VhostSocket string `json:"vhost_socket,omitempty"`
VhostUser bool `json:"vhost_user,omitempty"`
}
type NumaConfig ¶
type NumaConfig struct {
Cpus []int `json:"cpus,omitempty"`
Distances []*NumaDistance `json:"distances,omitempty"`
GuestNumaId int `json:"guest_numa_id"`
MemoryZones []string `json:"memory_zones,omitempty"`
SgxEpcSections []string `json:"sgx_epc_sections,omitempty"`
}
type NumaDistance ¶
type PciDeviceInfo ¶
Information about a PCI device
type PlatformConfig ¶
type PmemConfig ¶
type PmemConfig struct {
DiscardWrites bool `json:"discard_writes,omitempty"`
File string `json:"file"`
Id string `json:"id,omitempty"`
Iommu bool `json:"iommu,omitempty"`
Mergeable bool `json:"mergeable,omitempty"`
PciSegment int16 `json:"pci_segment,omitempty"`
Size int64 `json:"size,omitempty"`
}
type RateLimiterConfig ¶
type RateLimiterConfig struct {
Bandwidth *TokenBucket `json:"bandwidth,omitempty"`
Ops *TokenBucket `json:"ops,omitempty"`
}
Defines an IO rate limiter with independent bytes/s and ops/s limits. Limits are defined by configuring each of the _bandwidth_ and _ops_ token buckets.
type ReceiveMigrationData ¶
type ReceiveMigrationData struct {
ReceiverUrl string `json:"receiver_url"`
}
type RestoreConfig ¶
type SendMigrationData ¶
type SgxEpcConfig ¶
type TokenBucket ¶
type TokenBucket struct {
OneTimeBurst int64 `json:"one_time_burst,omitempty"`
RefillTime int64 `json:"refill_time"`
Size int64 `json:"size"`
}
Defines a token bucket with a maximum capacity (_size_), an initial burst size (_one_time_burst_) and an interval for refilling purposes (_refill_time_). The refill-rate is derived from _size_ and _refill_time_, and it is the constant rate at which the tokens replenish. The refill process only starts happening after the initial burst budget is consumed. Consumption from the token bucket is unbounded in speed which allows for bursts bound in size by the amount of tokens available. Once the token bucket is empty, consumption speed is bound by the refill-rate.
type VdpaConfig ¶
type VmAddDevice ¶
type VmConfig ¶
type VmConfig struct {
Balloon *BalloonConfig `json:"balloon,omitempty"`
Cmdline *CmdLineConfig `json:"cmdline,omitempty"`
Console *ConsoleConfig `json:"console,omitempty"`
Cpus *CpusConfig `json:"cpus,omitempty"`
Devices []*DeviceConfig `json:"devices,omitempty"`
Disks []*DiskConfig `json:"disks,omitempty"`
Fs []*FsConfig `json:"fs,omitempty"`
Initramfs *InitramfsConfig `json:"initramfs,omitempty"`
Iommu bool `json:"iommu,omitempty"`
Kernel *KernelConfig `json:"kernel"`
Memory *MemoryConfig `json:"memory,omitempty"`
Net []*NetConfig `json:"net,omitempty"`
Numa []*NumaConfig `json:"numa,omitempty"`
Platform *PlatformConfig `json:"platform,omitempty"`
Pmem []*PmemConfig `json:"pmem,omitempty"`
Rng *RngConfig `json:"rng,omitempty"`
Serial *ConsoleConfig `json:"serial,omitempty"`
SgxEpc []*SgxEpcConfig `json:"sgx_epc,omitempty"`
Tdx *TdxConfig `json:"tdx,omitempty"`
Vdpa []*VdpaConfig `json:"vdpa,omitempty"`
Vsock *VsockConfig `json:"vsock,omitempty"`
Watchdog bool `json:"watchdog,omitempty"`
}
Virtual machine configuration
type VmCounters ¶
type VmCounters struct {
}
type VmInfo ¶
type VmInfo struct {
Config *VmConfig `json:"config"`
DeviceTree map[string]*DeviceNode `json:"device_tree,omitempty"`
MemoryActualSize int64 `json:"memory_actual_size,omitempty"`
State string `json:"state"`
}
Virtual Machine information
type VmRemoveDevice ¶
type VmRemoveDevice struct {
Id string `json:"id,omitempty"`
}
type VmResizeZone ¶
type VmSnapshotConfig ¶
type VmSnapshotConfig struct {
DestinationUrl string `json:"destination_url,omitempty"`
}
type VmmPingResponse ¶
type VmmPingResponse struct {
Version string `json:"version"`
}
Virtual Machine Monitor information