Documentation
¶
Index ¶
- type BalloonConfig
- type Client
- func (c *Client) VmAddDevice(ctx context.Context, arg *DeviceConfig) (*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) VmAddUserDevice(ctx context.Context, arg *VmAddUserDevice) (*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) VmCoredump(ctx context.Context, arg *VmCoredumpData) 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) VmmNmi(ctx context.Context) error
- func (c *Client) VmmPing(ctx context.Context) (*VmmPingResponse, error)
- func (c *Client) VmmShutdown(ctx context.Context) error
- type ConsoleConfig
- type CpuAffinity
- type CpuFeatures
- type CpuTopology
- type CpusConfig
- type DebugConsoleConfig
- type DeviceConfig
- type DeviceNode
- type DiskConfig
- type FsConfig
- type LandlockConfig
- type MemoryConfig
- type MemoryZoneConfig
- type NetConfig
- type NumaConfig
- type NumaDistance
- type PayloadConfig
- type PciDeviceInfo
- type PciSegmentConfig
- type PlatformConfig
- type PmemConfig
- type RateLimitGroupConfig
- type RateLimiterConfig
- type ReceiveMigrationData
- type RestoreConfig
- type RngConfig
- type SendMigrationData
- type SgxEpcConfig
- type TokenBucket
- type TpmConfig
- type VdpaConfig
- type VirtQueueAffinity
- type VmAddUserDevice
- type VmConfig
- type VmCoredumpData
- 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 *DeviceConfig) (*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) VmAddUserDevice ¶
func (c *Client) VmAddUserDevice(ctx context.Context, arg *VmAddUserDevice) (*PciDeviceInfo, error)
Add a new userspace 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) VmCoredump ¶
func (c *Client) VmCoredump(ctx context.Context, arg *VmCoredumpData) error
Takes a VM coredump.
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 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"` KvmHyperv bool `json:"kvm_hyperv,omitempty"` MaxPhysBits int `json:"max_phys_bits,omitempty"` MaxVcpus int `json:"max_vcpus"` Topology *CpuTopology `json:"topology,omitempty"` }
type DebugConsoleConfig ¶
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"` QueueAffinity []*VirtQueueAffinity `json:"queue_affinity,omitempty"` QueueSize int `json:"queue_size,omitempty"` RateLimitGroup string `json:"rate_limit_group,omitempty"` RateLimiterConfig *RateLimiterConfig `json:"rate_limiter_config,omitempty"` Readonly bool `json:"readonly,omitempty"` Serial string `json:"serial,omitempty"` VhostSocket string `json:"vhost_socket,omitempty"` VhostUser bool `json:"vhost_user,omitempty"` }
type LandlockConfig ¶
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"` Thp bool `json:"thp,omitempty"` 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 { HostMac string `json:"host_mac,omitempty"` 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"` Mtu int `json:"mtu,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"` PciSegments []int `json:"pci_segments,omitempty"` SgxEpcSections []string `json:"sgx_epc_sections,omitempty"` }
type NumaDistance ¶
type PayloadConfig ¶
type PayloadConfig struct { Cmdline string `json:"cmdline,omitempty"` Firmware string `json:"firmware,omitempty"` Initramfs string `json:"initramfs,omitempty"` Kernel string `json:"kernel,omitempty"` }
Payloads to boot in guest
type PciDeviceInfo ¶
Information about a PCI device
type PciSegmentConfig ¶
type PlatformConfig ¶
type PlatformConfig struct { IommuSegments []int16 `json:"iommu_segments,omitempty"` NumPciSegments int16 `json:"num_pci_segments,omitempty"` OemStrings []string `json:"oem_strings,omitempty"` SerialNumber string `json:"serial_number,omitempty"` Tdx bool `json:"tdx,omitempty"` Uuid string `json:"uuid,omitempty"` }
type PmemConfig ¶
type RateLimitGroupConfig ¶
type RateLimitGroupConfig struct { Id string `json:"id"` RateLimiterConfig *RateLimiterConfig `json:"rate_limiter_config"` }
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 VirtQueueAffinity ¶
type VmAddUserDevice ¶
type VmAddUserDevice struct {
Socket string `json:"socket"`
}
type VmConfig ¶
type VmConfig struct { Balloon *BalloonConfig `json:"balloon,omitempty"` Console *ConsoleConfig `json:"console,omitempty"` Cpus *CpusConfig `json:"cpus,omitempty"` DebugConsole *DebugConsoleConfig `json:"debug_console,omitempty"` Devices []*DeviceConfig `json:"devices,omitempty"` Disks []*DiskConfig `json:"disks,omitempty"` Fs []*FsConfig `json:"fs,omitempty"` Iommu bool `json:"iommu,omitempty"` LandlockEnable bool `json:"landlock_enable,omitempty"` LandlockRules []*LandlockConfig `json:"landlock_rules,omitempty"` Memory *MemoryConfig `json:"memory,omitempty"` Net []*NetConfig `json:"net,omitempty"` Numa []*NumaConfig `json:"numa,omitempty"` Payload *PayloadConfig `json:"payload"` PciSegments []*PciSegmentConfig `json:"pci_segments,omitempty"` Platform *PlatformConfig `json:"platform,omitempty"` Pmem []*PmemConfig `json:"pmem,omitempty"` Pvpanic bool `json:"pvpanic,omitempty"` RateLimitGroups []*RateLimitGroupConfig `json:"rate_limit_groups,omitempty"` Rng *RngConfig `json:"rng,omitempty"` Serial *ConsoleConfig `json:"serial,omitempty"` SgxEpc []*SgxEpcConfig `json:"sgx_epc,omitempty"` Tpm *TpmConfig `json:"tpm,omitempty"` Vdpa []*VdpaConfig `json:"vdpa,omitempty"` Vsock *VsockConfig `json:"vsock,omitempty"` Watchdog bool `json:"watchdog,omitempty"` }
Virtual machine configuration
type VmCoredumpData ¶
type VmCoredumpData struct {
DestinationUrl string `json:"destination_url,omitempty"`
}
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"`
}