Documentation ¶
Index ¶
- Constants
- func OptionsToString(options map[string]string) string
- type CharDev
- type Codec
- type FloppyAddr
- type FloppyDevice
- type IDEAddr
- type IDEDevice
- type Object
- type PCIAddr
- type PCIController
- type PCIDevice
- type PCI_CONTROLLER_TYPE
- type SCSIAddr
- type SCSIDevice
- type SGuestCdrom
- type SGuestControlDesc
- type SGuestCpu
- type SGuestDesc
- type SGuestDisk
- type SGuestFloppy
- type SGuestHardwareDesc
- type SGuestIsaSerial
- type SGuestIsolatedDevice
- type SGuestMachine
- type SGuestMem
- type SGuestMetaDesc
- type SGuestNetwork
- type SGuestPCIAddressBus
- type SGuestPCIAddressSlot
- type SGuestPCIAddresses
- type SGuestProjectDesc
- type SGuestPvScsi
- type SGuestPvpanic
- type SGuestQga
- type SGuestRegionDesc
- type SGuestRng
- type SGuestVdi
- type SGuestVga
- type SGuestVirtioScsi
- type SGuestVirtioSerial
- type SMemDevice
- type SMemObject
- type SMemSlot
- type SSpiceDesc
- type SoundCard
- type UsbAddr
- type UsbController
- type UsbDevice
- type UsbMasterBus
- type UsbRedir
- type UsbRedirctDesc
- type VFIODevice
- type VirtSerialPort
Constants ¶
View Source
const ( CONTROLLER_TYPE_PCI_ROOT PCI_CONTROLLER_TYPE = "pci-root" CONTROLLER_TYPE_PCIE_ROOT = "pcie-root" CONTROLLER_TYPE_PCI_BRIDGE = "pci-bridge" CONTROLLER_TYPE_DMI_TO_PCI_BRIDGE = "dmi-to-pci-bridge" CONTROLLER_TYPE_PCIE_TO_PCI_BRIDGE = "pcie-to-pci-bridge" CONTROLLER_TYPE_PCIE_ROOT_PORT = "pcie-root-port" CONTROLLER_TYPE_PCIE_SWITCH_UPSTREAM_PORT = "pcie-switch-upstream-port" CONTROLLER_TYPE_PCIE_SWITCH_DOWNSTREAM_PORT = "pcie-switch-downstream-port" CONTROLLER_TYPE_PCI_EXPANDER_BUS = "pci-expander-bus" CONTROLLER_TYPE_PCIE_EXPANDER_BUS = "pcie-expander-bus" )
View Source
const (
PCI_ADDRESS_SLOT_MAX = 31
)
View Source
const QEMU_GUEST_PCIE_BUS_MAX = 16
Variables ¶
This section is empty.
Functions ¶
func OptionsToString ¶
Types ¶
type CharDev ¶
type CharDev struct { Backend string Id string Name string Options map[string]string `json:",omitempty"` }
func NewCharDev ¶
type FloppyAddr ¶
type FloppyDevice ¶
type FloppyDevice struct { *FloppyAddr Id string DevType string Options map[string]string `json:",omitempty"` }
type IDEDevice ¶
type IDEDevice struct { *IDEAddr Id string DevType string Options map[string]string `json:",omitempty"` }
func NewIdeDevice ¶
type PCIController ¶
type PCIController struct { *PCIDevice CType PCI_CONTROLLER_TYPE }
func NewPCIController ¶
func NewPCIController(controller PCI_CONTROLLER_TYPE) *PCIController
type PCIDevice ¶
type PCIDevice struct { *PCIAddr `json:",omitempty"` DevType string Id string Controller PCI_CONTROLLER_TYPE Options map[string]string `json:",omitempty"` }
func NewPCIDevice ¶
func NewPCIDevice(controller PCI_CONTROLLER_TYPE, deviceType, id string) *PCIDevice
func (*PCIDevice) MultiFunction ¶
func (*PCIDevice) OptionsStr ¶
type PCI_CONTROLLER_TYPE ¶
type PCI_CONTROLLER_TYPE string
type SCSIAddr ¶
type SCSIAddr struct { // The LUN identifies the specific logical unit // to the SCSI initiator when combined with // information such as the target port identifier. Lun uint Bus uint Controller uint }
pvscsi or virtio-scsi-pci
type SCSIDevice ¶
type SCSIDevice struct { *SCSIAddr `json:",omitempty"` Id string DevType string ControllerId string Options map[string]string `json:",omitempty"` }
func NewScsiDevice ¶
func NewScsiDevice(controller, deviceType, id string) *SCSIDevice
type SGuestCdrom ¶
type SGuestControlDesc ¶
type SGuestDesc ¶
type SGuestDesc struct { SGuestProjectDesc SGuestRegionDesc SGuestControlDesc SGuestHardwareDesc SGuestMetaDesc }
type SGuestDisk ¶
type SGuestDisk struct { api.GuestdiskJsonDesc // disk driver virtio Pci *PCIDevice `json:",omitempty"` // disk driver scsi/pvscsi Scsi *SCSIDevice `json:",omitempty"` // disk driver ide/sata Ide *IDEDevice `json:",omitempty"` }
type SGuestFloppy ¶
type SGuestHardwareDesc ¶
type SGuestHardwareDesc struct { Cpu int64 CpuDesc *SGuestCpu `json:",omitempty"` Mem int64 MemDesc *SGuestMem `json:",omitempty"` Bios string BootOrder string // supported machine type: pc, q35, virt Machine string MachineDesc *SGuestMachine `json:",omitempty"` VirtioSerial *SGuestVirtioSerial // std virtio cirrus vmware qlx none Vga string VgaDevice *SGuestVga `json:",omitempty"` // vnc or spice Vdi string VdiDevice *SGuestVdi `json:",omitempty"` VirtioScsi *SGuestVirtioScsi `json:",omitempty"` PvScsi *SGuestPvScsi `json:",omitempty"` Cdroms []*SGuestCdrom `json:"cdroms,omitempty"` Floppys []*SGuestFloppy `json:",omitempty"` Disks []*SGuestDisk `json:",omitempty"` Nics []*SGuestNetwork `json:",omitempty"` NicsStandby []*SGuestNetwork `json:",omitempty"` IsolatedDevices []*SGuestIsolatedDevice `json:",omitempty"` // Random Number Generator Device Rng *SGuestRng `json:",omitempty"` Qga *SGuestQga `json:",omitempty"` Pvpanic *SGuestPvpanic `json:",omitempty"` IsaSerial *SGuestIsaSerial `json:",omitempty"` Usb *UsbController `json:",omitempty"` PCIControllers []*PCIController `json:",omitempty"` AnonymousPCIDevs []*PCIDevice `json:",omitempty"` }
type SGuestIsaSerial ¶
type SGuestIsolatedDevice ¶
type SGuestIsolatedDevice struct { api.IsolatedDeviceJsonDesc VfioDevs []*VFIODevice `json:",omitempty"` Usb *UsbDevice }
type SGuestMachine ¶
type SGuestMetaDesc ¶
type SGuestNetwork ¶
type SGuestNetwork struct { api.GuestnetworkJsonDesc Pci *PCIDevice `json:",omitempty"` }
type SGuestPCIAddressBus ¶
type SGuestPCIAddressBus struct { Slots []*SGuestPCIAddressSlot /* usually 0,0 or 0,31, or 1,31 */ MinSlot uint MaxSlot uint Contorller PCI_CONTROLLER_TYPE }
func NewGuestPCIAddressBus ¶
func NewGuestPCIAddressBus(controller PCI_CONTROLLER_TYPE) (*SGuestPCIAddressBus, error)
func (*SGuestPCIAddressBus) EnsureSlotFunction ¶
func (b *SGuestPCIAddressBus) EnsureSlotFunction(slot, function uint) error
func (*SGuestPCIAddressBus) FindNextUnusedSlot ¶
func (b *SGuestPCIAddressBus) FindNextUnusedSlot(function uint) int
func (*SGuestPCIAddressBus) ReleaseSlotFunction ¶
func (b *SGuestPCIAddressBus) ReleaseSlotFunction(slot, function uint) error
type SGuestPCIAddressSlot ¶
type SGuestPCIAddressSlot struct {
Function uint8
}
type SGuestPCIAddresses ¶
type SGuestPCIAddresses struct {
Buses []*SGuestPCIAddressBus
}
func (*SGuestPCIAddresses) ReleasePCIAddress ¶
func (b *SGuestPCIAddresses) ReleasePCIAddress(addr *PCIAddr) error
type SGuestProjectDesc ¶
type SGuestPvScsi ¶
type SGuestPvScsi struct {
*PCIDevice
}
type SGuestPvpanic ¶
type SGuestQga ¶
type SGuestQga struct { Socket *CharDev SerialPort *VirtSerialPort }
type SGuestRegionDesc ¶
type SGuestVdi ¶
type SGuestVdi struct {
Spice *SSpiceDesc
}
type SGuestVirtioScsi ¶
type SGuestVirtioScsi struct {
*PCIDevice
}
type SGuestVirtioSerial ¶
type SGuestVirtioSerial struct {
*PCIDevice
}
type SMemDevice ¶
type SMemObject ¶
type SMemSlot ¶
type SMemSlot struct { SizeMB int64 MemObj *Object MemDev *SMemDevice }
type SSpiceDesc ¶
type SSpiceDesc struct { // Intel High Definition Audio IntelHDA *SoundCard // vdagent VdagentSerial *SGuestVirtioSerial Vdagent *CharDev VdagentSerialPort *VirtSerialPort // usb redirect UsbRedirct *UsbRedirctDesc Options map[string]string `json:",omitempty"` }
type UsbController ¶
type UsbController struct { *PCIDevice MasterBus *UsbMasterBus `json:",omitempty"` }
func NewUsbController ¶
func NewUsbController(masterbus string, port int) *UsbController
type UsbDevice ¶
type UsbDevice struct { *UsbAddr Id string DevType string Options map[string]string `json:",omitempty"` }
func NewUsbDevice ¶
type UsbMasterBus ¶
type UsbRedirctDesc ¶
type UsbRedirctDesc struct { // EHCI adapter: Enhanced Host Controller Interface, USB2.0 // Depends on UHCI to support full of usb devices EHCI1 *UsbController // UHCI controllers: Universal Host Controller Interface, USB 1.0, 1.1 UHCI1 *UsbController UHCI2 *UsbController UHCI3 *UsbController UsbRedirDev1 *UsbRedir UsbRedirDev2 *UsbRedir }
type VFIODevice ¶
func NewVfioDevice ¶
func NewVfioDevice(controller PCI_CONTROLLER_TYPE, deviceType, id, hostAddr string, hasXVga bool) *VFIODevice
Click to show internal directories.
Click to hide internal directories.