Documentation ¶
Index ¶
- Variables
- func Base64toUTF8(str string) string
- type BridgeType
- type CommandType
- type Device
- type DeviceParams
- type DeviceType
- type Drive
- type DriverOption
- type ExecRequest
- type ExecResponse
- type ExecStatusRequest
- type ExecStatusResponse
- type GuestAgentRequest
- type GuestAgentResponse
- type Image
- type Machine
- func (m *Machine) AddDevice(device *Device)
- func (m *Machine) AddNICs(nics []Nic) []*Device
- func (m *Machine) HavePrompt() bool
- func (m *Machine) MonitorCommand(cmd string) error
- func (m *Machine) Reboot() error
- func (m *Machine) ScheduleState(nextState State, timeout time.Duration, evaluation func() bool) error
- func (m *Machine) Start(startCmd string) error
- func (m *Machine) Stop() error
- func (m *Machine) WaitForPrompt() bool
- type Nic
- type QEMUHypervisorDriver
- func (d *QEMUHypervisorDriver) CreateInstance() error
- func (d *QEMUHypervisorDriver) DestroyInstance() error
- func (d *QEMUHypervisorDriver) InstanceConsole() hypervisor.Console
- func (d *QEMUHypervisorDriver) MetadataDriveDatamap() map[string]interface{}
- func (d *QEMUHypervisorDriver) MetadataDrivePath() string
- func (d QEMUHypervisorDriver) RebootInstance() error
- func (d *QEMUHypervisorDriver) Recover(instanceState model.InstanceState) error
- func (d *QEMUHypervisorDriver) StartInstance() error
- func (d *QEMUHypervisorDriver) StopInstance() error
- type QEMUHypervisorProvider
- type State
Constants ¶
This section is empty.
Variables ¶
View Source
var MachineState = map[string]State{ "STOPPED": STOPPED, "STARTING": STARTING, "RUNNING": RUNNING, "STOPPING": STOPPING, "REBOOTING": REBOOTING, "SHUTTINGDOWN": SHUTTINGDOWN, "TERMINATING": TERMINATING, "FAILED": FAILED, }
Functions ¶
func Base64toUTF8 ¶
Types ¶
type BridgeType ¶
type BridgeType int
const ( None BridgeType = iota // 0 Linux OVS )
func (BridgeType) String ¶
func (t BridgeType) String() string
type CommandType ¶
type CommandType int
const ( GuestExec CommandType = iota // 0 GuestExecStatus GuestPing )
TODO: add more types?
type Device ¶
type Device struct { DeviceType string Params *DeviceParams }
func NewDevice ¶
func NewDevice(deviceType DeviceType) *Device
func (*Device) LinkToGuestDevice ¶
type DeviceParams ¶
type DeviceParams struct { Driver string // Wrap the key value pair here because maps are not sorted Options []DriverOption }
type DeviceType ¶
type DeviceType int
-device virtio-serial -chardev socket,path=/tmp/foo,server,nowait,id=foo -device virtserialport,chardev=foo,name=org.fedoraproject.port.0
const ( DevType DeviceType = iota // 0 NetType CharType )
func (DeviceType) String ¶
func (t DeviceType) String() string
type DriverOption ¶
type DriverOption struct {
// contains filtered or unexported fields
}
type ExecRequest ¶
type ExecResponse ¶
type ExecResponse struct {
Pid int `json:"pid,omitempty"`
}
type ExecStatusRequest ¶
type ExecStatusRequest struct {
Pid int `json:"pid,omitempty"`
}
type ExecStatusResponse ¶
type ExecStatusResponse struct { Exited bool `json:"exited,omitempty"` Signal int `json:"signal,omitempty"` Exitcode int `json:"exitcode,omitempty"` Stdout string `json:"out-data,omitempty"` Stderr string `json:"err-data,omitempty"` TruncStdOut string `json:"out-truncated,omitempty"` TruncStdErr string `json:"err-truncated,omitempty"` }
type GuestAgentRequest ¶
type GuestAgentRequest struct { Command string `json:"execute"` Arguments interface{} `json:"arguments,omitempty"` }
func NewGuestAgentExecRequest ¶
func NewGuestAgentExecRequest(cmd []string, output bool) *GuestAgentRequest
func NewGuestAgentExecStatusRequest ¶
func NewGuestAgentExecStatusRequest(pid int) *GuestAgentRequest
func NewGuestAgentRequest ¶
func NewGuestAgentRequest(cmdType CommandType) *GuestAgentRequest
func (*GuestAgentRequest) SendRequest ¶
func (c *GuestAgentRequest) SendRequest(conn net.Conn, response *GuestAgentResponse) error
type GuestAgentResponse ¶
type GuestAgentResponse struct {
Return interface{} `json:"return"`
}
type Machine ¶
type Machine struct { State State Cores int Memory uint64 Name string Display string Vnc string MonitorSocketPath string SerialSocketPath string AgentSocketPath string Devices []*Device Pidfile string Nics []Nic Drives map[string]Drive Process *os.Process Kvm bool }
func NewMachine ¶
func (*Machine) HavePrompt ¶
func (*Machine) MonitorCommand ¶
func (*Machine) ScheduleState ¶
func (m *Machine) ScheduleState(nextState State, timeout time.Duration, evaluation func() bool) error
since machine struct does not get saved in memory for each instance there may not be any points in scheduling states as they are not stored anywhere
func (*Machine) WaitForPrompt ¶
type QEMUHypervisorDriver ¶
type QEMUHypervisorDriver struct { hypervisor.Base // contains filtered or unexported fields }
func (*QEMUHypervisorDriver) CreateInstance ¶
func (d *QEMUHypervisorDriver) CreateInstance() error
func (*QEMUHypervisorDriver) DestroyInstance ¶
func (d *QEMUHypervisorDriver) DestroyInstance() error
func (*QEMUHypervisorDriver) InstanceConsole ¶
func (d *QEMUHypervisorDriver) InstanceConsole() hypervisor.Console
func (*QEMUHypervisorDriver) MetadataDriveDatamap ¶
func (d *QEMUHypervisorDriver) MetadataDriveDatamap() map[string]interface{}
func (*QEMUHypervisorDriver) MetadataDrivePath ¶
func (d *QEMUHypervisorDriver) MetadataDrivePath() string
func (QEMUHypervisorDriver) RebootInstance ¶
func (d QEMUHypervisorDriver) RebootInstance() error
func (*QEMUHypervisorDriver) Recover ¶
func (d *QEMUHypervisorDriver) Recover(instanceState model.InstanceState) error
func (*QEMUHypervisorDriver) StartInstance ¶
func (d *QEMUHypervisorDriver) StartInstance() error
func (*QEMUHypervisorDriver) StopInstance ¶
func (d *QEMUHypervisorDriver) StopInstance() error
type QEMUHypervisorProvider ¶
type QEMUHypervisorProvider struct { }
func (*QEMUHypervisorProvider) CreateDriver ¶
func (p *QEMUHypervisorProvider) CreateDriver(instance *model.Instance, template model.ResourceTemplate) (hypervisor.HypervisorDriver, error)
func (*QEMUHypervisorProvider) LoadConfig ¶
func (p *QEMUHypervisorProvider) LoadConfig(sub *viper.Viper) error
func (*QEMUHypervisorProvider) Name ¶
func (p *QEMUHypervisorProvider) Name() string
Click to show internal directories.
Click to hide internal directories.