hypervisor

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2016 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BaseDir         = "/var/run/hyper"
	HyperSockName   = "hyper.sock"
	TtySockName     = "tty.sock"
	ConsoleSockName = "console.sock"
	ShareDirTag     = "share_dir"
	DefaultKernel   = "/var/lib/hyper/kernel"
	DefaultInitrd   = "/var/lib/hyper/hyper-initrd.img"
	DetachKeys      = "ctrl-p,ctrl-q"

	// cpu/mem hotplug constants
	DefaultMaxCpus = 8     // CONFIG_NR_CPUS hyperstart.git/build/kernel_config
	DefaultMaxMem  = 32768 // size in MiB
)
View Source
const (
	EVENT_VM_START_FAILED = iota
	EVENT_VM_EXIT
	EVENT_VM_KILL
	EVENT_VM_TIMEOUT
	EVENT_POD_FINISH
	EVENT_INIT_CONNECTED
	EVENT_CONTAINER_ADD
	EVENT_CONTAINER_DELETE
	EVENT_VOLUME_ADD
	EVENT_BLOCK_INSERTED
	EVENT_DEV_SKIP
	EVENT_BLOCK_EJECTED
	EVENT_INTERFACE_ADD
	EVENT_INTERFACE_DELETE
	EVENT_INTERFACE_INSERTED
	EVENT_INTERFACE_EJECTED
	EVENT_SERIAL_ADD
	EVENT_SERIAL_DELETE
	EVENT_TTY_OPEN
	EVENT_TTY_CLOSE
	EVENT_PAUSE_RESULT
	COMMAND_RUN_POD
	COMMAND_REPLACE_POD
	COMMAND_STOP_POD
	COMMAND_SHUTDOWN
	COMMAND_RELEASE
	COMMAND_NEWCONTAINER
	COMMAND_ONLINECPUMEM
	COMMAND_ATTACH
	COMMAND_DETACH
	COMMAND_WINDOWSIZE
	COMMAND_ACK
	COMMAND_GET_POD_STATS
	COMMAND_PAUSEVM
	GENERIC_OPERATION
	ERROR_INIT_FAIL
	ERROR_QMP_FAIL
	ERROR_INTERRUPTED
	ERROR_CMD_FAIL
)
View Source
const (
	PauseStateUnpaused = iota
	PauseStateBusy
	PauseStatePaused
)
View Source
const (
	StateInit        = "INIT"
	StatePreparing   = "PREPARING"
	StateStarting    = "STARTING"
	StateRunning     = "RUNNING"
	StatePodStopping = "STOPPING"
	StateCleaning    = "CLEANING"
	StateTerminating = "TERMINATING"
	StateDestroying  = "DESTROYING"
	StateNone        = "NONE"
)

states

Variables

View Source
var InterfaceCount int = 1
View Source
var PciAddrFrom int = 0x05

Functions

func EventString

func EventString(ev int) string

func InitNetwork

func InitNetwork(bIface, bIP string, disableIptables bool) error

func LazyVmLoop

func LazyVmLoop(vmId string, hub chan VmEvent, client chan *types.VmResponse, boot *BootConfig)

func NewVmMessage

func NewVmMessage(m *hyperstartapi.DecodedMessage) []byte

func ReadVmMessage

func ReadVmMessage(conn *net.UnixConn) (*hyperstartapi.DecodedMessage, error)

func SupportLazyMode

func SupportLazyMode() bool

func TtyLiner

func TtyLiner(conn io.Reader, output chan string)

func UnblockSend

func UnblockSend(ch chan *types.VmResponse, u *types.VmResponse)

func VmAssociate

func VmAssociate(vmId string, hub chan VmEvent, client chan *types.VmResponse,
	wg *sync.WaitGroup, pack []byte)

func VmLoop

func VmLoop(vmId string, hub chan VmEvent, client chan *types.VmResponse, boot *BootConfig)

Types

type AttachCommand

type AttachCommand struct {
	Streams   *TtyIO
	Size      *WindowSize
	Container string
}

func (*AttachCommand) Event

func (qe *AttachCommand) Event() int

type BlockDescriptor

type BlockDescriptor struct {
	Name       string
	Filename   string
	Format     string
	Fstype     string
	DeviceName string
	ScsiId     int
	Options    map[string]string
}

type BlockdevInsertedEvent

type BlockdevInsertedEvent struct {
	Name       string
	SourceType string //image or volume
	DeviceName string
	ScsiId     int
	ScsiAddr   string // pass scsi addr to hyperstart
}

func (*BlockdevInsertedEvent) Event

func (qe *BlockdevInsertedEvent) Event() int

type BootConfig

type BootConfig struct {
	CPU              int
	Memory           int
	HotAddCpuMem     bool
	BootToBeTemplate bool
	BootFromTemplate bool
	MemoryPath       string
	DevicesStatePath string
	Kernel           string
	Initrd           string
	Bios             string
	Cbfs             string
	Vbox             string

	// For network QoS (kilobytes/s)
	InboundAverage  string
	InboundPeak     string
	OutboundAverage string
	OutboundPeak    string
}

type CommandAck

type CommandAck struct {
	// contains filtered or unexported fields
}

func (*CommandAck) Event

func (qe *CommandAck) Event() int

type CommandError

type CommandError CommandAck

func (*CommandError) Event

func (qe *CommandError) Event() int

type ContainerCreatedEvent

type ContainerCreatedEvent struct {
	Index  int
	Id     string
	Rootfs string
	Image  string // if fstype is `dir`, this should be a path relative to share_dir
	// which described the mounted aufs or overlayfs dir.
	Fstype     string
	Workdir    string
	Entrypoint []string
	Cmd        []string
	Envs       map[string]string
}

func (*ContainerCreatedEvent) Event

func (qe *ContainerCreatedEvent) Event() int

type ContainerInfo

type ContainerInfo struct {
	Id      string
	User    string
	MountId string
	Rootfs  string
	Image   pod.UserVolume // if fstype is `dir`, this should be a path relative to share_dir
	// which described the mounted aufs or overlayfs dir.
	Fstype     string
	Workdir    string
	Entrypoint []string
	Cmd        []string
	Envs       map[string]string
	Initialize bool // need to initialize container environment in start
}

type ContainerStatus added in v0.6.2

type ContainerStatus struct {
	Id       string
	Name     string
	PodId    string
	Image    string
	Cmds     []string
	Logs     LogStatus
	Status   uint32
	ExitCode uint8
}

type ContainerUnmounted

type ContainerUnmounted struct {
	Index   int
	Success bool
}

func (*ContainerUnmounted) Event

func (qe *ContainerUnmounted) Event() int

type DevSkipEvent

type DevSkipEvent struct{}

func (*DevSkipEvent) Event

func (qe *DevSkipEvent) Event() int

type DeviceFailed

type DeviceFailed struct {
	Session VmEvent
}

func (*DeviceFailed) Event

func (qe *DeviceFailed) Event() int

type DriverContext

type DriverContext interface {
	Launch(ctx *VmContext)
	Associate(ctx *VmContext)
	Dump() (map[string]interface{}, error)

	AddDisk(ctx *VmContext, sourceType string, blockInfo *BlockDescriptor)
	RemoveDisk(ctx *VmContext, blockInfo *BlockDescriptor, callback VmEvent)

	AddNic(ctx *VmContext, host *HostNicInfo, guest *GuestNicInfo, result chan<- VmEvent)
	RemoveNic(ctx *VmContext, n *InterfaceCreated, callback VmEvent)

	SetCpus(ctx *VmContext, cpus int, result chan<- error)
	AddMem(ctx *VmContext, slot, size int, result chan<- error)

	Save(ctx *VmContext, path string, result chan<- error)

	Shutdown(ctx *VmContext)
	Kill(ctx *VmContext)

	Pause(ctx *VmContext, pause bool, result chan<- error)

	ConfigureNetwork(vmId, requestedIP string, maps []pod.UserContainerPort, config pod.UserInterface) (*network.Settings, error)
	AllocateNetwork(vmId, requestedIP string, maps []pod.UserContainerPort) (*network.Settings, error)
	ReleaseNetwork(vmId, releasedIP string, maps []pod.UserContainerPort, file *os.File) error

	Stats(ctx *VmContext) (*types.PodStats, error)

	Close()
}

type EmptyContext

type EmptyContext struct{}

func (*EmptyContext) AddDisk

func (ec *EmptyContext) AddDisk(ctx *VmContext, sourceType string, blockInfo *BlockDescriptor)

func (*EmptyContext) AddMem

func (ec *EmptyContext) AddMem(ctx *VmContext, slot, size int, result chan<- error)

func (*EmptyContext) AddNic

func (ec *EmptyContext) AddNic(ctx *VmContext, host *HostNicInfo, guest *GuestNicInfo, result chan<- VmEvent)

func (*EmptyContext) AllocateNetwork

func (ec *EmptyContext) AllocateNetwork(vmId, requestedIP string,
	maps []pod.UserContainerPort) (*network.Settings, error)

func (*EmptyContext) Associate

func (ec *EmptyContext) Associate(ctx *VmContext)

func (*EmptyContext) BuildinNetwork

func (ec *EmptyContext) BuildinNetwork() bool

func (*EmptyContext) Close

func (ec *EmptyContext) Close()

func (*EmptyContext) ConfigureNetwork

func (ec *EmptyContext) ConfigureNetwork(vmId, requestedIP string,
	maps []pod.UserContainerPort, config pod.UserInterface) (*network.Settings, error)

func (*EmptyContext) Dump

func (ec *EmptyContext) Dump() (map[string]interface{}, error)

func (*EmptyContext) Kill

func (ec *EmptyContext) Kill(ctx *VmContext)

func (*EmptyContext) Launch

func (ec *EmptyContext) Launch(ctx *VmContext)

func (*EmptyContext) Pause

func (ec *EmptyContext) Pause(ctx *VmContext, pause bool, result chan<- error)

func (*EmptyContext) ReleaseNetwork

func (ec *EmptyContext) ReleaseNetwork(vmId, releasedIP string,
	maps []pod.UserContainerPort, file *os.File) error

func (*EmptyContext) RemoveDisk

func (ec *EmptyContext) RemoveDisk(ctx *VmContext, blockInfo *BlockDescriptor, callback VmEvent)

func (*EmptyContext) RemoveNic

func (ec *EmptyContext) RemoveNic(ctx *VmContext, n *InterfaceCreated, callback VmEvent)

func (*EmptyContext) Save

func (ec *EmptyContext) Save(ctx *VmContext, path string, result chan<- error)

func (*EmptyContext) SetCpus

func (ec *EmptyContext) SetCpus(ctx *VmContext, cpus int, result chan<- error)

func (*EmptyContext) Shutdown

func (ec *EmptyContext) Shutdown(ctx *VmContext)

func (*EmptyContext) Stats

func (ec *EmptyContext) Stats(ctx *VmContext) (*types.PodStats, error)

type EmptyDriver

type EmptyDriver struct{}

func (*EmptyDriver) InitContext

func (ed *EmptyDriver) InitContext(homeDir string) DriverContext

func (*EmptyDriver) Initialize

func (ed *EmptyDriver) Initialize() error

func (*EmptyDriver) LoadContext

func (ed *EmptyDriver) LoadContext(persisted map[string]interface{}) (DriverContext, error)

func (*EmptyDriver) Name added in v0.6.2

func (ed *EmptyDriver) Name() string

func (*EmptyDriver) SupportLazyMode

func (ed *EmptyDriver) SupportLazyMode() bool

type ExecStatus added in v0.6.2

type ExecStatus struct {
	Id        string
	Container string
	Cmds      string
	Terminal  bool
	ExitCode  uint8
}

type Fanout

type Fanout struct {
	// contains filtered or unexported fields
}

func CreateFanout

func CreateFanout(upstream chan *types.VmResponse, size int, block bool) *Fanout

CreateFanout create a new fanout, and if it is non-blocked, it will start the fanout goroutine at once, otherwise it will start the goroutine when it get the first client

func (*Fanout) Acquire

func (fo *Fanout) Acquire() (chan *types.VmResponse, error)

func (*Fanout) Close

func (fo *Fanout) Close()

func (*Fanout) Release

func (fo *Fanout) Release(client chan *types.VmResponse) error

type GenericOperation

type GenericOperation struct {
	OpName string
	State  []string
	OpFunc func(ctx *VmContext, result chan<- error)
	Result chan<- error
}

func (*GenericOperation) Event

func (qe *GenericOperation) Event() int

type GetPodStatsCommand

type GetPodStatsCommand struct {
	Id string
}

func (*GetPodStatsCommand) Event

func (qe *GetPodStatsCommand) Event() int

type GuestNicInfo

type GuestNicInfo struct {
	Device  string
	Ipaddr  string
	Index   int
	Busaddr int
}

type HandleEvent

type HandleEvent struct {
	Handle func(*types.VmResponse, interface{}, *PodStatus, *Vm) bool
	Data   interface{}
}

type HostNicInfo

type HostNicInfo struct {
	Fd      uint64
	Device  string
	Mac     string
	Bridge  string
	Gateway string
}

type HypervisorDriver

type HypervisorDriver interface {
	Name() string
	InitContext(homeDir string) DriverContext

	LoadContext(persisted map[string]interface{}) (DriverContext, error)

	BuildinNetwork() bool

	InitNetwork(bIface, bIP string, disableIptables bool) error

	SupportLazyMode() bool
}
var HDriver HypervisorDriver

type InitConnectedEvent

type InitConnectedEvent struct {
	// contains filtered or unexported fields
}

func (*InitConnectedEvent) Event

func (qe *InitConnectedEvent) Event() int

type InitFailedEvent

type InitFailedEvent struct {
	Reason string
}

func (*InitFailedEvent) Event

func (qe *InitFailedEvent) Event() int

type InterfaceCreated

type InterfaceCreated struct {
	Index      int
	PCIAddr    int
	Fd         *os.File
	Bridge     string
	HostDevice string
	DeviceName string
	MacAddr    string
	IpAddr     string
	NetMask    string
	RouteTable []*RouteRule
}

func (*InterfaceCreated) Event

func (qe *InterfaceCreated) Event() int

type InterfaceReleased

type InterfaceReleased struct {
	Index   int
	Success bool
}

func (*InterfaceReleased) Event

func (qe *InterfaceReleased) Event() int

type Interrupted

type Interrupted struct {
	Reason string
}

func (*Interrupted) Event

func (qe *Interrupted) Event() int

type LazyDriverContext

type LazyDriverContext interface {
	DriverContext

	LazyLaunch(ctx *VmContext)
	InitVM(ctx *VmContext) error
	LazyAddDisk(ctx *VmContext, name, sourceType, filename, format string, id int)
	LazyAddNic(ctx *VmContext, host *HostNicInfo, guest *GuestNicInfo)
}

type LogStatus

type LogStatus struct {
	Copier  *logger.Copier
	Driver  logger.Logger
	LogPath string
}

type NetDevInsertedEvent

type NetDevInsertedEvent struct {
	Index      int
	DeviceName string
	Address    int
}

func (*NetDevInsertedEvent) Event

func (qe *NetDevInsertedEvent) Event() int

type NetDevRemovedEvent

type NetDevRemovedEvent struct {
	Index int
}

func (*NetDevRemovedEvent) Event

func (qe *NetDevRemovedEvent) Event() int

type NewContainerCommand

type NewContainerCommand struct {
	// contains filtered or unexported fields
}

func (*NewContainerCommand) Event

func (qe *NewContainerCommand) Event() int

type OnlineCpuMemCommand

type OnlineCpuMemCommand struct{}

func (*OnlineCpuMemCommand) Event

func (qe *OnlineCpuMemCommand) Event() int

type PersistInfo

type PersistInfo struct {
	Id          string
	DriverInfo  map[string]interface{}
	UserSpec    *pod.UserPod
	VmSpec      *hyperstartapi.Pod
	HwStat      *VmHwStatus
	VolumeList  []*PersistVolumeInfo
	NetworkList []*PersistNetworkInfo
}

type PersistNetworkInfo

type PersistNetworkInfo struct {
	Index      int
	PciAddr    int
	DeviceName string
	IpAddr     string
}

type PersistVolumeInfo

type PersistVolumeInfo struct {
	Name       string
	Filename   string
	Format     string
	Fstype     string
	DeviceName string
	ScsiId     int
	Containers []int
	MontPoints []string
}

type PodFinished

type PodFinished struct {
	// contains filtered or unexported fields
}

func (*PodFinished) Event

func (qe *PodFinished) Event() int

type PodStatus

type PodStatus struct {
	Id            string
	Name          string
	Vm            string
	Wg            *sync.WaitGroup
	Containers    []*ContainerStatus
	Execs         map[string]*ExecStatus
	Status        uint
	Type          string
	RestartPolicy string
	Autoremove    bool
	Handler       *HandleEvent
	StartedAt     string
	FinishedAt    string
}

func NewPod

func NewPod(podId string, userPod *pod.UserPod, handler *HandleEvent) *PodStatus

func (*PodStatus) AddContainer

func (mypod *PodStatus) AddContainer(containerId, name, image string, cmds []string, status uint32)

func (*PodStatus) AddExec added in v0.6.2

func (mypod *PodStatus) AddExec(containerId, execId, cmds string, terminal bool)

func (*PodStatus) CleanupExec added in v0.6.2

func (mypod *PodStatus) CleanupExec()

func (*PodStatus) DeleteContainer added in v0.6.2

func (mypod *PodStatus) DeleteContainer(containerId string)

func (*PodStatus) DeleteExec added in v0.6.2

func (mypod *PodStatus) DeleteExec(execId string)

func (*PodStatus) GetContainer added in v0.6.2

func (mypod *PodStatus) GetContainer(containerId string) *ContainerStatus

func (*PodStatus) GetExec added in v0.6.2

func (mypod *PodStatus) GetExec(execId string) *ExecStatus

func (*PodStatus) GetPodIP

func (mypod *PodStatus) GetPodIP(vm *Vm) []string

func (*PodStatus) SetContainerStatus

func (mypod *PodStatus) SetContainerStatus(status uint32)

func (*PodStatus) SetExecStatus added in v0.6.2

func (mypod *PodStatus) SetExecStatus(execId string, code uint8)

func (*PodStatus) SetOneContainerStatus added in v0.6.2

func (mypod *PodStatus) SetOneContainerStatus(containerId string, code uint8)

func (*PodStatus) SetPodContainerStatus

func (mypod *PodStatus) SetPodContainerStatus(data []uint32)

type PreparingItem

type PreparingItem interface {
	ItemType() string
}

type ReleaseVMCommand

type ReleaseVMCommand struct{}

func (*ReleaseVMCommand) Event

func (qe *ReleaseVMCommand) Event() int

type ReplacePodCommand

type ReplacePodCommand RunPodCommand

func (*ReplacePodCommand) Event

func (qe *ReplacePodCommand) Event() int

type RouteRule

type RouteRule struct {
	Destination string
	Gateway     string
	ViaThis     bool
}

type RunPodCommand

type RunPodCommand struct {
	Spec       *pod.UserPod
	Containers []*ContainerInfo
	Volumes    map[string]*VolumeInfo
	Wg         *sync.WaitGroup
}

func (*RunPodCommand) Event

func (qe *RunPodCommand) Event() int

type RunningContainer

type RunningContainer struct {
	Id string `json:"id"`
}

type ShutdownCommand

type ShutdownCommand struct {
	Wait bool
}

func (*ShutdownCommand) Event

func (qe *ShutdownCommand) Event() int

type TtyIO

type TtyIO struct {
	Stdin     io.ReadCloser
	Stdout    io.Writer
	Stderr    io.Writer
	OutCloser io.Closer
	Callback  chan *types.VmResponse
}

func (*TtyIO) Close

func (tty *TtyIO) Close()

func (*TtyIO) WaitForFinish

func (tty *TtyIO) WaitForFinish() error

type Vm

type Vm struct {
	Id     string
	Pod    *PodStatus
	Status uint
	Cpu    int
	Mem    int
	Lazy   bool

	Hub chan VmEvent
	// contains filtered or unexported fields
}

func GetVm

func GetVm(vmId string, b *BootConfig, waitStarted, lazy bool) (vm *Vm, err error)

func NewVm

func NewVm(vmId string, cpu, memory int, lazy bool) *Vm

func (*Vm) AddCpu

func (vm *Vm) AddCpu(totalCpu int) error

TODO: deprecated api, it will be removed after the hyper.git updated

func (*Vm) AddMem

func (vm *Vm) AddMem(totalMem int) error

func (*Vm) AddNic

func (vm *Vm) AddNic(idx int, name string, info pod.UserInterface) error

func (*Vm) AddProcess

func (vm *Vm) AddProcess(container, execId string, terminal bool, args []string, env []string, workdir string, tty *TtyIO) error

func (*Vm) AddRoute added in v0.6.2

func (vm *Vm) AddRoute() error

func (*Vm) AssociateVm

func (vm *Vm) AssociateVm(mypod *PodStatus, data []byte) error

This function will only be invoked during daemon start

func (*Vm) Attach

func (vm *Vm) Attach(tty *TtyIO, container string, size *WindowSize) error

func (*Vm) DeleteNic added in v0.6.2

func (vm *Vm) DeleteNic(idx int) error

func (*Vm) Exec

func (vm *Vm) Exec(container, execId, cmd string, terminal bool, tty *TtyIO) error

func (*Vm) GenericOperation

func (vm *Vm) GenericOperation(name string, op func(ctx *VmContext, result chan<- error), states ...string) error

func (*Vm) GetLogOutput

func (vm *Vm) GetLogOutput(container string, callback chan *types.VmResponse) (io.ReadCloser, io.ReadCloser, error)

func (*Vm) GetNextNicNameInVM added in v0.6.2

func (vm *Vm) GetNextNicNameInVM() string

func (*Vm) GetResponseChan

func (vm *Vm) GetResponseChan() (chan *types.VmResponse, error)

func (*Vm) Kill

func (vm *Vm) Kill() (int, string, error)

func (*Vm) KillContainer

func (vm *Vm) KillContainer(container string, signal syscall.Signal) error

func (*Vm) Launch

func (vm *Vm) Launch(b *BootConfig) (err error)

func (*Vm) NewContainer

func (vm *Vm) NewContainer(c *pod.UserContainer, info *ContainerInfo) error

func (*Vm) OnlineCpuMem

func (vm *Vm) OnlineCpuMem() error

func (*Vm) Pause

func (vm *Vm) Pause(pause bool) error

func (*Vm) ReadFile

func (vm *Vm) ReadFile(container, target string) ([]byte, error)

func (*Vm) ReleaseResponseChan

func (vm *Vm) ReleaseResponseChan(ch chan *types.VmResponse)

func (*Vm) ReleaseVm

func (vm *Vm) ReleaseVm() (int, error)

func (*Vm) Save

func (vm *Vm) Save(path string) error

func (*Vm) SendGenericOperation

func (vm *Vm) SendGenericOperation(name string, op func(ctx *VmContext, result chan<- error), states ...string) <-chan error

func (*Vm) SetCpus

func (vm *Vm) SetCpus(cpus int) error

func (*Vm) StartPod

func (vm *Vm) StartPod(mypod *PodStatus, userPod *pod.UserPod,
	cList []*ContainerInfo, vList map[string]*VolumeInfo) *types.VmResponse

func (*Vm) Stats

func (vm *Vm) Stats() *types.VmResponse

func (*Vm) StopPod

func (vm *Vm) StopPod(mypod *PodStatus) *types.VmResponse

func (*Vm) Tty

func (vm *Vm) Tty(containerId, execId string, row, column int) error

func (*Vm) WriteFile

func (vm *Vm) WriteFile(container, target string, data []byte) error

type VmContext

type VmContext struct {
	Id string

	PauseState int
	Boot       *BootConfig

	// Communication Context
	Hub chan VmEvent

	DCtx DriverContext

	HomeDir         string
	HyperSockName   string
	TtySockName     string
	ConsoleSockName string
	ShareDir        string

	InterfaceCount int
	// contains filtered or unexported fields
}

func InitContext

func InitContext(id string, hub chan VmEvent, client chan *types.VmResponse, dc DriverContext, boot *BootConfig) (*VmContext, error)

func (*VmContext) Become

func (ctx *VmContext) Become(handler stateHandler, desc string)

func (*VmContext) Close

func (ctx *VmContext) Close()

func (*VmContext) ConfigureInterface

func (ctx *VmContext) ConfigureInterface(index int, pciAddr int, name string, config pod.UserInterface, result chan<- VmEvent)

func (*VmContext) CreateInterface

func (ctx *VmContext) CreateInterface(index int, pciAddr int, name string)

func (*VmContext) DeleteExec added in v0.6.2

func (ctx *VmContext) DeleteExec(id string)

func (*VmContext) GetNextNicName added in v0.6.2

func (ctx *VmContext) GetNextNicName(result chan<- string)

func (*VmContext) InitDeviceContext

func (ctx *VmContext) InitDeviceContext(spec *pod.UserPod, wg *sync.WaitGroup,
	cInfo []*ContainerInfo, vInfo map[string]*VolumeInfo)

InitDeviceContext will init device info in context

func (*VmContext) Lookup

func (ctx *VmContext) Lookup(container string) int

func (*VmContext) LookupBySession added in v0.6.2

func (ctx *VmContext) LookupBySession(session uint64) string

func (*VmContext) LookupExecBySession added in v0.6.2

func (ctx *VmContext) LookupExecBySession(session uint64) string

func (*VmContext) ReleaseInterface

func (ctx *VmContext) ReleaseInterface(index int, ipAddr string, file *os.File,
	maps []pod.UserContainerPort)

type VmEvent

type VmEvent interface {
	Event() int
}

type VmExit

type VmExit struct{}

func (*VmExit) Event

func (qe *VmExit) Event() int

type VmHwStatus

type VmHwStatus struct {
	PciAddr  int    //next available pci addr for pci hotplug
	ScsiId   int    //next available scsi id for scsi hotplug
	AttachId uint64 //next available attachId for attached tty
}

type VmKilledEvent

type VmKilledEvent struct {
	Success bool
}

func (*VmKilledEvent) Event

func (qe *VmKilledEvent) Event() int

type VmStartFailEvent

type VmStartFailEvent struct {
	Message string
}

func (*VmStartFailEvent) Event

func (qe *VmStartFailEvent) Event() int

type VmTimeout

type VmTimeout struct{}

func (*VmTimeout) Event

func (qe *VmTimeout) Event() int

type VolumeInfo

type VolumeInfo struct {
	Name         string //volumen name in spec
	Filepath     string //block dev absolute path, or dir path relative to share dir
	Fstype       string //"xfs", "ext4" etc. for block dev, or "dir" for dir path
	Format       string //"raw" (or "qcow2") for volume, no meaning for dir path
	DockerVolume bool
}

type VolumeReadyEvent

type VolumeReadyEvent struct {
	Name     string //volumen name in spec
	Filepath string //block dev absolute path, or dir path relative to share dir
	Fstype   string //"xfs", "ext4" etc. for block dev, or "dir" for dir path
	Format   string //"raw" (or "qcow2") for volume, no meaning for dir path
}

func (*VolumeReadyEvent) Event

func (qe *VolumeReadyEvent) Event() int

type VolumeUnmounted

type VolumeUnmounted struct {
	Name    string
	Success bool
}

func (*VolumeUnmounted) Event

func (qe *VolumeUnmounted) Event() int

type WindowSize

type WindowSize struct {
	Row    uint16 `json:"row"`
	Column uint16 `json:"column"`
}

type WindowSizeCommand

type WindowSizeCommand struct {
	ContainerId string
	ExecId      string
	Size        *WindowSize
}

func (*WindowSizeCommand) Event

func (qe *WindowSizeCommand) Event() int

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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