desc

package
v0.3.10-0-alpha2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 15, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

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

func OptionsToString(options map[string]string) string

Types

type CharDev

type CharDev struct {
	Backend string
	Id      string
	Name    string
	Options map[string]string `json:",omitempty"`
}

func NewCharDev

func NewCharDev(backend, id, name string) *CharDev

type Codec

type Codec struct {
	Id   string
	Type string
	Cad  int
}

type FloppyAddr

type FloppyAddr struct {
	Bus        uint
	Controller uint
}

type FloppyDevice

type FloppyDevice struct {
	*FloppyAddr

	Id      string
	DevType string
	Options map[string]string `json:",omitempty"`
}

type IDEAddr

type IDEAddr struct {
	Unit       uint
	Bus        uint
	Controller uint
}

type IDEDevice

type IDEDevice struct {
	*IDEAddr

	Id      string
	DevType string
	Options map[string]string `json:",omitempty"`
}

func NewIdeDevice

func NewIdeDevice(deviceType, id string) *IDEDevice

type Object

type Object struct {
	ObjType string
	Id      string
	Options map[string]string `json:",omitempty"`
}

func NewObject

func NewObject(objType, id string) *Object

type PCIAddr

type PCIAddr struct {
	Domain   uint
	Bus      uint
	Slot     uint
	Function uint

	Multi *bool
}

%04x:%02x:%02x.%x, domain, bus, slot, function

func (*PCIAddr) Copy

func (addr *PCIAddr) Copy() *PCIAddr

func (*PCIAddr) String

func (addr *PCIAddr) String() string

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) BusStr

func (d *PCIDevice) BusStr() string

func (*PCIDevice) MultiFunction

func (d *PCIDevice) MultiFunction() string

func (*PCIDevice) OptionsStr

func (d *PCIDevice) OptionsStr() string

func (*PCIDevice) SlotFunc

func (d *PCIDevice) SlotFunc() string

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 SGuestCdrom struct {
	Id        string
	Path      string
	Ordinal   int64
	BootIndex *int8

	Ide          *IDEDevice        `json:",omitempty"`
	Scsi         *SCSIDevice       `json:",omitempty"`
	DriveOptions map[string]string `json:",omitempty"`
}

type SGuestControlDesc

type SGuestControlDesc struct {
	IsDaemon bool
	IsMaster bool
	IsSlave  bool

	// is volatile host meaning guest not running on this host right now
	IsVolatileHost bool

	ScalingGroupId     string
	SecurityRules      string
	AdminSecurityRules string
	SrcIpCheck         bool
	SrcMacCheck        bool

	EncryptKeyId string
}

type SGuestCpu

type SGuestCpu struct {
	Cpus    uint
	Sockets uint
	Cores   uint
	Threads uint
	MaxCpus uint

	Model    string
	Vendor   string
	Level    string
	Features map[string]bool `json:",omitempty"`

	Accel string
}

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 SGuestFloppy struct {
	Id      string
	Path    string
	Ordinal int64

	Floppy       *FloppyDevice     `json:",omitempty"`
	DriveOptions map[string]string `json:",omitempty"`
}

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 SGuestIsaSerial struct {
	Pty *CharDev
	Id  string
}

type SGuestIsolatedDevice

type SGuestIsolatedDevice struct {
	api.IsolatedDeviceJsonDesc
	VfioDevs []*VFIODevice `json:",omitempty"`
	Usb      *UsbDevice
}

type SGuestMachine

type SGuestMachine struct {
	Accel string

	// arm only
	GicVersion *string `json:",omitempty"`
}

type SGuestMem

type SGuestMem struct {
	Slots  uint
	MaxMem uint

	SizeMB int64
	Mem    *Object `json:",omitempty"`

	MemSlots []*SMemSlot `json:",omitempty"`
}

type SGuestMetaDesc

type SGuestMetaDesc struct {
	Name         string
	Uuid         string
	OsName       string
	Pubkey       string
	Keypair      string
	Secgroup     string
	Flavor       string
	UserData     string
	Metadata     map[string]string
	ExtraOptions map[string]jsonutils.JSONObject
}

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 SGuestProjectDesc struct {
	Tenant        string
	TenantId      string
	DomainId      string
	ProjectDomain string
}

type SGuestPvScsi

type SGuestPvScsi struct {
	*PCIDevice
}

type SGuestPvpanic

type SGuestPvpanic struct {
	Ioport uint // default ioport 1285(0x505)
	Id     string
}

type SGuestQga

type SGuestQga struct {
	Socket     *CharDev
	SerialPort *VirtSerialPort
}

type SGuestRegionDesc

type SGuestRegionDesc struct {
	Zone     string
	Domain   string
	HostId   string
	Hostname string
}

type SGuestRng

type SGuestRng struct {
	*PCIDevice `json:",omitempty"`

	RngRandom *Object
}

type SGuestVdi

type SGuestVdi struct {
	Spice *SSpiceDesc
}

type SGuestVga

type SGuestVga struct {
	*PCIDevice `json:",omitempty"`
}

type SGuestVirtioScsi

type SGuestVirtioScsi struct {
	*PCIDevice
}

type SGuestVirtioSerial

type SGuestVirtioSerial struct {
	*PCIDevice
}

type SMemDevice

type SMemDevice struct {
	Type string
	Id   string
}

type SMemObject

type SMemObject struct {
	*Object
	SizeMB int64
}

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 SoundCard

type SoundCard struct {
	*PCIDevice `json:",omitempty"`
	Codec      *Codec
}

type UsbAddr

type UsbAddr struct {
	Bus  int
	Port int
}

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

func NewUsbDevice(deviceType, id string) *UsbDevice

type UsbMasterBus

type UsbMasterBus struct {
	Masterbus string
	Port      int
}

type UsbRedir

type UsbRedir struct {
	Id     string
	Source *CharDev
}

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

type VFIODevice struct {
	*PCIDevice

	HostAddr string
	XVga     bool
}

func NewVfioDevice

func NewVfioDevice(controller PCI_CONTROLLER_TYPE, deviceType, id, hostAddr string, hasXVga bool) *VFIODevice

type VirtSerialPort

type VirtSerialPort struct {
	Chardev string
	Name    string

	Options map[string]string `json:",omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL